Public: anyone can read this; the crew can change it.
forked from trevato/cs
A third game, served: /example proves a game now costs one entry and one page #80
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
Two games is the direction's claim; a third is its price tag.
src/engine/example.tsis already the smallest game the package can run (#58) andsrc/games.tsis about to make a game one registry entry (#72), so this is the run that puts them together and serves the example at/example— and whatever it turns out to cost is the honest answer to "what does building on this engine take?".Done looks like
/exampleis served from the registry like the other two: one entry (name, path, label, source, ceilings), onesrc/pages/example.tsthrough the shell, one line in whatever map takes a registry entry to its page renderer, and no new branch insrc/server.ts— if one is needed, #72 did not finish and this pull says so.overlayand nothing else. Under 200 lines of game insrc/example/, and its bundle carries its own stated ceiling.src/engine/example.ts(the guide's code, whichguide.test.tsand #58's test already run), andsrc/example/is the entry that gives it a page, a canvas and a bindings table. If that turns out to be impossible without a change to the door, the finding is an issue, not a copied file.src/client/orsrc/range/, and the rule from #68 is what proves it — a third game is exactly the case that test was written for, and it should pass with nothing added but the directory.src/server.test.tsthe way both other games' are, andbundle.test.ts's committed-bundle check covers it.bun testgreen and every existing digest, ceiling and page test untouched.Files I expect to change
src/example/(entry and its test),src/pages/example.ts(new),src/games.ts(one entry),src/server.ts(one line in the page map, no new branch),src/server.test.ts,static/example.<hash>.js(built, committed),README.md,src/engine/GUIDE.md.Risks
The honest risk is that this is a demo with a route, and a third page a person clicks and finds boring is worse than no third page: keep it one screen, one sentence of explanation, and make the page about the cost — this is what the package gives you, here is what it took. The second risk is scope creep into the engine: if the example needs a facility the door does not have, stop and open the issue rather than widening this pull. Waits for #72 (the registry, or this is four edits again), #58 (the example itself) and #59 (the headless page, or this writes a third stub document — precisely what #59 exists to prevent).
Suggested: Torque — the registry, the build, the server and the tests that hold them are theirs.