# Run all tests
cargo nextest run
# Run tests for a specific crate
cargo nextest run -p styx-formatThe formatter uses proptest to find edge cases through fuzz testing. Property tests are in crates/styx-format/src/cst_format.rs.
Two invariants are tested:
- Semantics preservation - formatting must not change the document's meaning (tree equality ignoring spans)
- Idempotence -
format(format(x)) == format(x)
Run with more cases to find rare bugs:
PROPTEST_CASES=5000 cargo nextest run -p styx-format proptestsWhen proptest finds a failing case, it saves it to proptest-regressions/ for deterministic replay.
cargo xtask installThis builds a release binary, copies it to ~/.cargo/bin/styx, and codesigns it on macOS.
The Styx playgrounds and editor integrations are published to npm. These packages are loaded via esm.sh CDN in the docs site.
# For WASM builds
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli
# npm login (if not already logged in)
npm login| Package | Location | Description |
|---|---|---|
@bearcove/styx-wasm |
crates/styx-wasm |
WASM bindings for parser |
@bearcove/codemirror-lang-styx |
editors/codemirror-styx |
CodeMirror 6 language support |
@bearcove/monaco-lang-styx |
editors/monaco-styx |
Monaco editor language support |
Each package has prepublishOnly scripts that build automatically:
# Publish all packages
cd crates/styx-wasm && pnpm publish
cd editors/codemirror-styx && pnpm publish
cd editors/monaco-styx && pnpm publishAfter publishing, the docs site playgrounds will automatically use the new versions via esm.sh (may take a few minutes for CDN cache).
Update the version in each package.json before publishing. The playground templates in docs/templates/ reference specific versions in esm.sh URLs - update those too:
// docs/templates/monaco.html, codemirror.html
import { ... } from 'https://esm.sh/@bearcove/styx-wasm@0.1.0';