Contributing#
goboscript welcomes contributions in the form of Pull Requests. No LLM generated code will be accepted.
goboscript is written in Rust. You'll need to install the Rust toolchain for development.
Setup#
Fork your own copy of the repository and clone it to your local machine.
git clone https://github.com/$USER/goboscript
cd goboscript
Install and set the default Rust toolchain to stable:
rustup toolchain install stable
rustup default stable
Formatting still uses nightly rustfmt options (cargo +nightly fmt), so install
nightly too:
rustup toolchain install nightly
The development scripts also require Python 3.9 or later, Node.js, and the pnpm
version declared in package.json. Install Prettier separately and ensure the
prettier command is available on your PATH. From the repository root, install
the workspace dependencies:
pnpm install --frozen-lockfile
This provides tsx and its dependencies for schema validation. Run the development
commands below from the repository root.
Development#
To make development easier, and to validate the generated Scratch project -- use
the tools/run.py script:
tools/run.py --validate # or `-v`
This assumes that you have set-up a testing project at playground/. (You can create a
testing project by running cargo run -- new -G playground). It will compile the project,
validate it using the schemas from scratch-parser. If the validation fails, Scratch
will refuse to load the project.
To further debug the project, the generated project.json file can be extracted from
the .sb3 file in the playground/ directory, by running the following command:
tools/sb3.py playground/playground.sb3
Lets say that goboscript produced a broken project, and you are able to fix it by
hand -- by modifying the project.json.
You can add back the project.json to the .sb3 file with:
# assuming that project.json is present at `playground/playground.json`
tools/sb3.py playground/playground.sb3 --patch # or `-p`
If you want to validate some .sb3 file, use:
tools/sb3.py path/to/project.sb3 --validate # or `-v`
Documentation#
Install uv, then run pnpm run build:docs to build
the docs or pnpm run dev:docs for a local preview.
Conventions#
We use conventional commits. (See git log --oneline to understand this)