Contributing¶
Prerequisites¶
- Git
- A Rust toolchain with
cargo,rustfmtandclippy uv(providesuvanduvx) andpython3- For the WebAssembly module: the
wasm32-unknown-unknowntarget andwasm-pack - For the WebAssembly smoke test: Node.js
Getting the code¶
Running the full gate¶
build.sh in the repository root is the canonical check. Run it before you
open a pull request:
It performs these steps in order and stops at the first failure:
- Checks that
git,cargo,rustc,uv,uvxandpython3are present and that the expected project files exist. - Runs
scripts/release-manifests.py checkto confirm that all manifests carry the same version. - Runs
cargo fmt --checkandcargo clippy -D warningson the CLI crate. - Builds and tests the workspace (except the Python crate), including doctests and examples.
- Builds the Python wheel with
uv build, installs it in a temporary virtual environment, runscrates/python/testswith pytest and a smoke test that comparesvexy_json.__version__with the workspace version. - Builds this documentation site in strict mode into a temporary directory.
- Fails if the build changed any tracked or untracked file in the checkout.
The output is also written to build.log.txt. The last line is
BUILD SUCCESS: … or BUILD FAILURE: ….
Working on the documentation¶
The documentation sources are Markdown files in src_docs/md/. The site
configuration is src_docs/mkdocs.yml. The site is built with ProperDocs and
the MaterialX theme into docs/, which GitHub Pages serves.
- Edit or add a page in
src_docs/md/. Add new pages to thenavlist insrc_docs/mkdocs.yml. -
Preview the site:
The preview runs at
http://127.0.0.1:8000and reloads on save. -
Build the site:
This runs
src_docs/build.sh, which builds in strict mode: any warning, such as a broken link between pages, fails the build. The result replaces the contents ofdocs/.
Do not edit files in docs/ by hand; the next build overwrites them. The
.github/workflows/docs.yml workflow rebuilds docs/ on every push to main
that changes src_docs/ or the WebAssembly sources, and commits the result.
The demo and the WebAssembly bundle¶
The browser demo lives in src_docs/md/demo/, with its scripts and styles in
src_docs/md/assets/. The WebAssembly bundle it loads lives in
src_docs/md/pkg/. ProperDocs copies these files to docs/ unchanged.
To rebuild the bundle after changing crates/core or crates/wasm:
- Run
./scripts/build-wasm.sh release. The script writes the new bundle tosrc_docs/md/pkg/. -
Run the smoke test against it:
The test prints
All tests passed!at the end. Deletecrates/wasm/pkg/afterwards. -
Rebuild the site with
./build.sh docs.
Code guidelines¶
- Keep the forgiving behaviour behind
ParserOptionsso that every extension can be switched off. - Add a test in
tests/for each syntax change. The existing files are grouped by topic, such ascomment_handling.rs,number_formats.rsandnewline_as_comma.rs. - When a change affects a binding, update its tests:
crates/python/tests/for Python andcrates/wasm/test.mjsfor WebAssembly. - Record user-visible changes in
CHANGELOG.mdunderUnreleased.
Releasing¶
Maintainers release with ./publish.sh. According to the README, the script
verifies the repository boundary, checkpoints intended changes, runs the full
build, creates and verifies the release tag, then publishes the workspace
crates in dependency order followed by the Python package (built with
uv build, uploaded with uv publish).
Pushing the v* tag starts .github/workflows/release.yml, which tests the
tagged source, builds the CLI binaries, the macOS installer and the
WebAssembly archive, and attaches them to the GitHub release.
Interrupted releases
Registry uploads cannot be undone. If publication stops after the tag was created, check crates.io and PyPI before retrying, and resume only the uploads that are missing. Do not rerun the whole script: it derives the next version from the existing tags.