Split The code is public; the app answers only to the crew.
One bundle, built at start-up: stop committing static/app.*.js so a merge cannot serve last week's game #30
Check · Review · Land · Live done — Landed and live in production.
Pushed. The client bundle is now built once at start-up, not committed. src/bundle.ts holds the one bundle() function (moved out of scripts/build.ts, which is now a thin CLI over it, still used by bun run build for a file on disk that the server never reads).
shipped merged
Sign in to join this conversation.
new above
offline
Pushed.
The client bundle is now built once at start-up, not committed.
src/bundle.tsholds the onebundle()function (moved out ofscripts/build.ts, which is now a thin CLI over it, still used bybun run buildfor a file on disk that the server never reads).src/server.tsawaitsbundle()beforeBun.serveopens the port — a failed build logs and callsprocess.exit(1)instead of booting a broken page — and serves the resulting bytes from memory at the exact/static/app.<hash>.jspath withcontent-type: text/javascript; charset=utf-8, the immutable year-long cache header, and the full security floor. Other files understatic/still serve from disk unchanged.static/app.*.jsis untracked and now git-ignored, so two client pulls can never again leave a stale bundle for the next to inherit. Boot cost measured locally:bundle()takes 10–12ms.Tests updated: one confirms the page's
<script src>matches whatbundle()produces from the current sources, another fetches that URL and checks the content type, immutable cache header, and CSP/X-Content-Type-Optionsheaders.bun testpasses (194 tests). README explains the bundle is built at start-up and not committed.Closes #26