Contributor-facing notes. For end-user docs see README.md and
docs.opengeometry.io, whose source is in docs/.
- Node.js 26 (what CI uses)
- Rust toolchain 1.88.0
wasm-pack(CI uses 0.13.1) —brew install wasm-packon macOS, orcargo install wasm-pack
main/opengeometry/— Rust core compiled to WebAssemblymain/opengeometry-three/— Three.js wrapper (the published TypeScript SDK)main/dist/— generated npm bundle (do not edit)
npm --prefix main ci
npm run build # Full pipeline: Rust → WASM → TS bundle → main/dist/
npm test # Cargo unit + integration testsnpm run build runs build-core (wasm-pack only), then
node scripts/build/clean-dist.mjs (remove dist/), then rollup -c, then
node scripts/build/prepare-dist.mjs (copy WASM, package metadata, the README and the
licence) in order, all inside main/. Each build starts from an empty dist/, so no file
from an earlier build stays. Running the stages out of order produces stale pkg/ and
bundle mismatches.
npm --prefix main run dev-example # Vite dev server
npm --prefix main run build-example # Static buildRun npm run build first, because the examples import main/dist/index.js by path and
are served with main/dist/ as their public folder.
The example catalog lives at main/opengeometry-three/examples-vite/. Use it (rather
than copying the build into a sibling repo) for local validation.
Both check commands work from the repository root and from the main/ folder, and
write their logs to main/.check/.
npm run checkruns the 18-step gate: formatting, clippy and tests of the kernel andtest-supportcrates, the WebAssembly tests, the build, the worker-bundle check, lint, type checks, source rules, import cycles, duplicates, the example build, and the binding, Node and performance tests.npm run check:fullruns the same 18 steps plus the Playwright browser tests on three 0.168 and 0.184 (20 steps). It needs Playwright's Chromium:npx playwright install chromiuminmain/(on Linux with--with-deps, as CI does).
The root README.md is part of the gate. In the Node tests,
main/scripts/build/readme-code.test.mjs type-checks every ts block of the README
against main/dist/, fails on a ts, typescript or tsx block it does not read, and
checks that main/opengeometry-three/tests/browser/pages/quick-start.ts holds the README's
OpenGeometry.create( line. The browser suite runs that page, which is a hand copy of the
README's quick start, so a change to the quick start changes pages/quick-start.ts too.
The same test type-checks the ts blocks of MIGRATION.md and fails on a fence it does
not read there; the quick-start check covers the README only. The build ships the README,
with its relative links made absolute, and LICENSE.md in main/dist/. MIGRATION.md
is not shipped: the package README links to it on GitHub's main branch.
.github/workflows/verify.yml runs on every push and pull request that changes main/**,
README.md, MIGRATION.md, LICENSE.md or the workflow file, on Ubuntu and macOS. It
runs npm run check, then the two browser runs (node scripts/check/verify.mjs --full --only browser:three-168 and --only browser:three-184), then a fixed two-second guard
on one kernel boolean (cargo run --release --example budgets in main/opengeometry/),
which compares with no recorded result. It uploads the check logs and, from Ubuntu, the
STEP exports. It can also be started by hand.
Three checks compare with numbers recorded on one machine, so they run on a developer's
machine and not on CI (where CI is true). Nothing is recorded on CI.
- The kernel golden test compares the hash of every scene with the golden file of its
target; the one recorded file is
main/opengeometry/tests/fixtures/golden/aarch64-apple-darwin.json. On CI, and on a target with no golden file, it still builds every scene and compares no hash. Its other checks apply there too, except that on CI a boolean matrix row that differs from its stored result is not a failure.TARGETS.mdin that folder says how to record. - The timing budgets compare the performance medians and the storey timings with the
block of
timingsinmain/scripts/bench/performance-baseline.jsonthat is named after the machine, such asdarwin-arm64. On CI the timings are measured and printed, not checked, and a machine with no block is not checked either. The size budgets in the same file are checked everywhere. To record a machine, copy into its block thetimingsthatnpm run test:performanceprints, and therenderMs,transformFlushMsandstepMsof the "Storey performance baseline:" line of the browser run asstoreyFirstRenderMs,storeyTransformFlushMsandstoreyStepMs, and setmeasuredOnto the date. A block needs the three storey keys. - The kernel tests of the
casesandstep_oracletest binaries that compare a body built by the kernel or returned by a boolean, a tessellation, a STEP text or a STEP report digit for digit with one stored undermain/opengeometry/tests/fixtures/cases/make that comparison off CI only. On CI they still run every case and keep their other checks, such as validity, volumes, handler lists and stored errors. A stored body that is only read and written back is still compared digit for digit everywhere, andmain/opengeometry/tests/wasm_core.rscompares, on every machine, the stored tessellations within four ULP and the stored metre STEP texts entity for entity with their numbers within four ULP.
The kernel tests also read main/opengeometry/tests/fixtures/cases/, which holds test
inputs and stored expected results. The BRep bodies are both: each is the stored result
of a builder or of one of five booleans, and an input of the STEP and round-trip tests;
the twelve builder bodies are also inputs of the tessellation tests. The boolean and
batch matrix rows hold their inputs with their stored
result and handlers, and each validity body has its stored verdict. The other stored
results are tessellations, STEP texts, reports and errors, and handler lists. They were
first recorded from the 2.0 kernel by a tool that no longer exists, so no command
regenerates them. A change that moves one edits the stored file by hand in the same
commit and says why. The golden file is the only fixture with a record command.
- Bump
versioninmain/package.json,main/package-lock.json,main/opengeometry/Cargo.toml,main/opengeometry/Cargo.lockandmain/opengeometry/test-support/Cargo.lockso they match (CI fetches with--locked). - If the release changes how existing code must be written, check that
MIGRATION.mdhas its entry (its "Adding an entry" section asks for it in the change that broke the code) and rename an "Unreleased" section after the two versions, such as "2.5 to 2.6". - Rename the
## [Unreleased]heading ofCHANGELOG.mdto the version and the release date, and add the same entry todocs/opengeometry/changelog.mdx. - Run both gates with
CIunset on a machine that has a golden file for its target and atimingsblock, where the golden comparison, the comparisons with stored results and the timing budgets run:npm run check npm run check:full
- Merge to the
mainbranch, then start the GitHub Action at.github/workflows/release.ymlby hand on themainbranch; a push does not publish. It rebuilds, runsnpm run check(required to pass), and publishesmain/dist/to npm if the version is not already on the registry. - The action also creates a GitHub release tagged
v<version>.
If the publish step fails for an environmental reason but the version was already bumped, re-running the workflow will re-attempt publish (the action checks npm and only publishes if the version is missing).