Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
A game is one entry: one registry the build, the server, the nav and the 404 all read #83
Check · Review · Land · Live done — Landed and live in production.
A game is now one entry in `src/games.ts`: the name its bundle is filed under, the path it answers on, what the header calls it, the source it is bundled from, its raw and gzip ceilings, and the one sentence the *other* pages say about it. The registry is plain data and imports nothing, which is what lets `scripts/build.ts` and `src/server.ts` both read it without a cycle — the measurement log and…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
A game is now one entry in
src/games.ts: the name its bundle is filed under, the path it answers on, what the header calls it, the source it is bundled from, its raw and gzip ceilings, and the one sentence the other pages say about it. The registry is plain data and imports nothing, which is what letsscripts/build.tsandsrc/server.tsboth read it without a cycle — the measurement log and the rule for raising a ceiling moved there to sit beside the numbers they are about.scripts/build.tsprojectsENTRIESfrom it and knows nothing else about a game.src/pages/games.tskeepsGAMESandnavFor(here)as the names every page already imports, now projected, and gainsothersHtml(here): the cross-link on each page is the other game's own sentence, so/'s claim that the range was "that engine's loop and controls drawn as a readout" is gone and cannot come back.src/server.tsbuilds its read routes from the registry againstRENDER, one map from a game's name to the function that draws its page — a page is a function and cannot be data, so that line is the only thing a third game adds to the server./keeps its session cookie, itswhoand its database; the range still gets none of them;SECURITY, HEAD-as-GET, the same-origin POST check and/api/matchare untouched, and the 404 now lists every game with what each one is.Worth looking at:
src/server.test.tsgained a loop over the registry that holds every game to a title of its own, its own bundle and no other's, one script, the nav marking it current, the same security headers and HEAD without a body — plus a test that each page carries the other's sentence and none of its own.src/games.test.tspins the registry's own invariants (plain names, a source that exists, unique paths and labels). The committed bundles are unchanged byte for byte —bun run buildreproduces the same two hashes — andbun testis green at 479 tests. I left the POST route where it is:/api/matchbelongs to the shooter, and making it generic is a different issue.🤖 Generated with Claude Code
Closes #72