Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 4 behind

What ships is what runs: the committed range bundle boots under the stub page #36

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`src/range/bundle.test.ts` boots the committed artifact: it finds `static/range.<hash>.js` with `isBundleOf("range", …)` over `STATIC_DIR` from `scripts/build.ts`, installs the stub page from `src/range/dom.ts`, imports the bundle so the entry self-boots, and then holds it to drawn text — both canvases sized to their box, a `tick` line and a `yaw` line in the readout, the test's clock stepping the…

shipped production is serving it deploy ae07c2d

opened this

src/range/bundle.test.ts boots the committed artifact: it finds static/range.<hash>.js with isBundleOf("range", …) over STATIC_DIR from scripts/build.ts, installs the stub page from src/range/dom.ts, imports the bundle so the entry self-boots, and then holds it to drawn text — both canvases sized to their box, a tick line and a yaw line in the readout, the test's clock stepping the tick count from 1 to 2, KeyW turning held nothing into held forward and back, and a canvas with no 2D context putting "No 2D canvas" on the page instead of throwing. Every boot undoes its install(), and a last test asserts no document is left on the globals for another file to inherit. A broken bundle really does fail: replacing the file with export const boot = () => {} fails three of the four, and removing it fails with expected exactly one range.<hash>.js in …/static, found 0 — run \bun run build\ and commit the bundle.

Two things worth a look. A cache-busting query does not work under Bun — import(url + "?a=1") and ?a=2 evaluate the module once, which I verified before relying on it — so each boot also copies the committed bytes to its own path in a mkdtemp directory (removed in afterAll, nothing written into the repository); the query is still there for the runtimes that honour it, and the comment says which one does the work. And no module that ships changed: the only edit outside the new test is src/range/independence.test.ts, widened by one line so a .test.ts — which is in no bundle, the same licence it already gives bun:test and node: — may import scripts/build.ts, with a case pinning that a shipping module still may not. The stub in dom.ts needed nothing added; the shooter's bundle stays out of scope as the issue asks. bun test: 279 pass, 0 fail, the new file in 45 ms.

🤖 Generated with Claude Code

Closes #35

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs