Contributing
Building
Requires the Rust toolchain pinned in mise.toml (mise install rust):
git clone https://github.com/howmanyslop/sloptor && cd sloptorcargo build --locked --release -p rotor_cli # target/release/sloptorRunning the tests
mise run rust:test # full test suite (cargo nextest)cargo nextest run -p rotor_transformer --test diff # differential suite only (see below)mise run rust:conformance # conformance goldens onlymise run rust:forkparity # fork parity and the Lune runtime suites (needs node, rojo, lune)mise run rust:check # lint, then test; required clean before commitsNo Node is required to run rotor itself or the committed differential goldens. A clean clone still needs fixture dependencies installed inside testdata/diff/project, testdata/conformance/project, and testdata/transformers/project (plus tools/sidecar) before the project-layer, conformance, and real-package transformer suites run. Use bun install --no-save first; npm install --no-audit --no-fund still works as a fallback.
The differential suite (how rotor proves byte-parity)
crates/rotor_transformer/tests/diff.rs compiles every fixture project under testdata/diff/project/src/ with rotor and byte-compares the output against committed goldens in testdata/diff/golden/ — which were generated by the real rbxtsc 3.0.0. A fixture passes only when rotor's output is byte-identical; the first diverging line is reported.
Adding a fixture:
- Write the TypeScript in
testdata/diff/project/src/(it must compile cleanly under rbxtsc). - Regenerate goldens:
powershell -File tools/oracle/oracle.ps1(this is the only step that needs the JS toolchain — the script prefers Bun for fixture installs, falls back to npm, and runs the pinnedroblox-ts@3.0.0over the fixture project). - Add the fixture to a list in
crates/rotor_transformer/tests/fixtures/*.txtand runcargo nextest run -p rotor_transformer --test diff.
Existing goldens must stay byte-unchanged when regenerating — git diff testdata/diff/golden/ should only show your new files.
The try-exit optimization in issue #181 is an intentional byte-parity exception:
testdata/diff/golden/37_try.luau and
testdata/conformance/golden/tests/try.spec.luau include Rotor's omission of
provably redundant exit guards. Preserve these corrections when running the oracle.
The switch correction in issue #184 is also an intentional byte-parity
exception: when default precedes a case, Rotor selects the first matching
case before executing bodies in source order. This preserves JavaScript matching
and fall-through instead of dropping all clauses after default. Switches with
default last retain their existing output.
Working on the documentation
The site is an Astro Starlight package in documentation/. The command reference is generated from the CLI by sloptor gen-docs, which the docs dev, check, and build scripts run first:
node --run docs:devmise run documentation runs the type check, build, and unit and browser tests.
Releasing a new version
rotor's version is defined in code: crates/rotor_support/src/version.rs, the single source of the release version. Maintainer flow:
- From a clean working tree, run
pnpm release(bumpp, configured inbump.config.ts). It lists the commits since the last tag and prompts for the next version. - bumpp bumps the
VERSIONconstant, main package, exact optional dependencies, all six platform manifests, and the emitted header comments in lockstep. It then commits, creates thevX.Y.Ztag, and pushes both.
Pass a version or release type to skip the prompt (pnpm release patch, pnpm release 2.8.0), or use --no-push to keep everything local. pnpm release --help lists every flag.
The tag triggers the release GitHub Actions workflow, which verifies the tag, product version, client protocol, main package, and all platform manifests before publishing. It builds the six executables with cargo, each on a native runner, stages seven npm tarballs, and smoke-tests both the API and CLI on matching macOS, Linux, and Windows x64/ARM64 runners. It then publishes the archives and checksums as a GitHub Release; nothing is published to npm.
Project docs
- User documentation: docs.howmanysmall.com/sloptor, built from
documentation/ - Transformer sidecar protocol:
docs/sidecar-protocol.md - Design doc:
docs/superpowers/specs/2026-06-05-rotor-design.md - Full roadmap with every phase and task: Roadmap
- Phase plans:
docs/superpowers/plans/· porting digests (the transformer's source of truth):docs/superpowers/research/
Ground rules
- Byte-parity is law: except for the documented try-exit and switch corrections above, everything that compiles must be byte-identical to
rbxtsc3.0.0. Never silently emit different output — fail loudly with a "not yet supported" diagnostic instead. third_party/tsrsis a generated mirror — never edit it by hand; re-vendor withmise run tsrs:mirror.mise run rust:checkmust be clean before commits.