Local development
Prerequisites
| Tool | Install |
|---|---|
| Rust | rustup — the toolchain itself comes from rust-toolchain.toml |
| cargo tools | cargo install --locked cargo-nextest cargo-deny cargo-machete wasm-pack (or cargo binstall …) |
| Python | uv — it fetches the Python it needs |
| JavaScript | bun |
| Hooks | prek or pre-commit (uv tool install pre-commit) |
Install the JS dependencies for the whole repository once, from the root:
sh
bun installCore crate (Rust)
sh
cargo check --all-targets --all-features # type check
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all --check
cargo nextest run --workspace --all-features
cargo test --doc --workspace --all-features
# The core must stay runtime-free for the browser:
cargo check --target wasm32-unknown-unknown -p rusty_harness --no-default-features --features rt-wasm
# Supply chain:
cargo deny check
cargo machetePython bindings
From crates/rusty-harness-py/:
sh
uv sync # creates .venv with maturin, pytest, ruff, pyright
uv run maturin develop # builds the extension into .venv; rerun after Rust changes
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run pyrightThe type stub rusty_harness.pyi is generated from the Rust annotations. After changing an exported function, regenerate it and commit the result — CI fails on a stale stub:
sh
cargo run -p rusty-harness-py --bin stub_genWASM and TypeScript bindings
From crates/rusty-harness-wasm/:
sh
bun run build # wasm-pack build for bundler, web and nodejs into dist/
bun run test # vitest against the built package
bun run typecheck # tsc --noEmit
wasm-pack test --node # Rust-side wasm-bindgen tests
wasm-pack test --headless --chromeFrom the root, bun run lint (oxlint, type-aware) and bun run format (oxfmt) cover every TypeScript, JSON, TOML and YAML file; bun run format:fix rewrites them.
Docs
sh
bun run --cwd docs dev # live preview at http://localhost:5173/rusty-harness/
bun run --cwd docs build
bun run lint:md
cargo doc --no-deps --all-features -p rusty_harness # API reference