lua-annotations build-time processor/validator
Project description
lua-annotations-python
A lua annotation processor written in python; it's targeted toward Roblox development and is to be used as a modular game framework or simply a build-time processor.
Documentation
Key concepts
Processor
- Expandable with an API
- Allows for functionality during build-time, runtime, or for both.
Game framework
- Services (
@service) define individual game logic - Controllers (
@controller) define per-instance behavior and are automatically mapped to instances containing CollectionService tags - Dependency injection for services and controllers with automatic load ordering
- Seamless networking bridge; simply import "remote services" (wrappers of RemoteEvents/Functions)
CLI usage
To setup your project, run lua-anot init path/to/project. This creates a default config file. Don't forget to change the default environment paths if your project setup differs!
This is mostly a CLI tool; to build a project, run this command: lua-anot build path/to/project. This command assumes the project directory contains a annotations.config.json file. You may specify a custom filename using the --config or -c argument.
The program also has a watch command, which detects changes and automatically rebuilds; used via lua-anot watch.
Multiple workspaces
A workspace represents one individual place synced with rojo. Multi-place games would require using multiple. It is also possible to have multiple paths per ennvironment, if you want to.
Defining custom annotations
The program contains an easy API to do so!
#Runs after annotation parsing
class MyExtension(Extension):
def on_build_test_anot(ctx: AnnotationBuildCtx):
print(f'Hello World, {ctx.annotation.name}!')
#Runs after all files have been processed
def on_post_process(ctx: PostProcessCtx):
print('Build finished!')
def load(ctx: ExtensionRegistry):
ctx.register_anot(AnnotationDef('moduleTest', scope='module', on_build=self.on_build_test_anot)
def load(ctx: ExtensionRegistry):
ctx.register_extension(MyExtension())
add it to your project's config file:
annotations.config.json
extensions = [
["path", "my_extension/main.py"]
]
Note: see the documentation for more info.
Since the project uses this API internally for optional extensions, you may also see the sourcecode under /src/extensions/ for reference!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lua_annotations-0.2.0.tar.gz.
File metadata
- Download URL: lua_annotations-0.2.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df888c48ab0bdbbc3fe18b7247496e53334cee9a2e570c5c2649b70305bc3819
|
|
| MD5 |
0a5ea8d5277b6caacf550a0f1fe0b1da
|
|
| BLAKE2b-256 |
44cdadda6913716df86a06afabb16733af83ca3b9266e927a216f68f754cdbf6
|
Provenance
The following attestation bundles were made for lua_annotations-0.2.0.tar.gz:
Publisher:
python-publish.yml on pigxity-games/lua-annotations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lua_annotations-0.2.0.tar.gz -
Subject digest:
df888c48ab0bdbbc3fe18b7247496e53334cee9a2e570c5c2649b70305bc3819 - Sigstore transparency entry: 1060423644
- Sigstore integration time:
-
Permalink:
pigxity-games/lua-annotations@c42932aa00ad8704d8c130500021e2007b4c6c09 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/pigxity-games
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c42932aa00ad8704d8c130500021e2007b4c6c09 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lua_annotations-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lua_annotations-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f89b7d05bf87d953efd21224768995b6bdfe723cd8c7f1d95f7dc7dcd96bb820
|
|
| MD5 |
2c0e2e5384f38858998f058224cf93a6
|
|
| BLAKE2b-256 |
5e0d0bd8c160ccb31d1cf3df02378390eeefaaa59e43e2616e899ab169978051
|
Provenance
The following attestation bundles were made for lua_annotations-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on pigxity-games/lua-annotations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lua_annotations-0.2.0-py3-none-any.whl -
Subject digest:
f89b7d05bf87d953efd21224768995b6bdfe723cd8c7f1d95f7dc7dcd96bb820 - Sigstore transparency entry: 1060423706
- Sigstore integration time:
-
Permalink:
pigxity-games/lua-annotations@c42932aa00ad8704d8c130500021e2007b4c6c09 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/pigxity-games
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c42932aa00ad8704d8c130500021e2007b4c6c09 -
Trigger Event:
release
-
Statement type: