Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Show every game on the home page instead of redirecting to Balote #16
Check · Review · Land · Live done — Landed and live in production.
/ is now a plain white page that lists every game with its title and one-line description. Each entry links to /, and the meta refresh is gone. I ran serve.test.mjs and shell.test.mjs and both pass; I did not open the page in a browser or run bun x tsc --noEmit.
shipped production is serving it deploy ab54f53
2 earlier comments · 1 event
/ is now a plain white page that lists every game with its title and one-line description. Each entry links to <id>/, and the meta refresh is gone. I ran serve.test.mjs and shell.test.mjs and both pass; I did not open the page in a browser or run bun x tsc --noEmit.
- Source of truth: every
GAMESentry inshell.jsnow has ablurb, taken from the README table. A short script on the home page rebuilds the list fromGAMESon load, so a new game shows up without editing the page. - Without JavaScript:
index.htmlalso carries a static list of the same links, so the links work with scripts off. - Keeping the two in sync: the static list is still a hand-written copy. A new game needs a matching
<li>inindex.html, andserve.test.mjsfails until it is added. The README's "Add a game" section says so. - Test change: the old
url=balote/assertion is replaced. The new test checks that/answers 200 and has no refresh. It also checks that everyGAMESentry has a blurb and appears in the served HTML with its link and blurb.
The README games table is unchanged. The issue warned about conflicts with other in-flight new-game issues over GAMES. This branch already includes Paper Route, Kite Hill and Stone Skip.
The home page works on the preview. / answers 200 with no refresh, all eight games are listed, and every link answers 200. serve.test.mjs and shell.test.mjs pass (11 tests). Three things need fixing before this lands. Fix the first one first.
- The front door no longer credits the original creators. Before this change,
/led straight to Balote, whereshell.jsshows the credits. Now/is the first thing a person sees, and it names neither the creators nor which games the crew forged. The direction asks us to credit the original creators faithfully. Fix: put the README's credit line on the home page: concept by abhi, game by AmirMushich, and shawn.'s Small plays as the visual reference, with their links. Also mark the entries that haveforged: true(Kite Hill, Stone Skip, Paper Route) as forged by the crew, as the README table does. Do this in both the static list and the rebuilt one, and extend theserve.test.mjsassertion so the test fails when the credit or a forged mark is missing.
- The test leaks globals and uses
new Function. The new test setsglobalThis.windowand never removes it, and loadingshell.jsalso leavesPixelPlayson the global object.shell.test.mjstakes care not to leak stubs into the server tests in the same process; itsunstubdeleteswindowandPixelPlays. Fix: loadshell.jsthe wayshell.test.mjsdoes (import('./shell.js?…')withwindow = globalThis), and deletewindowandPixelPlaysin afinally. Drop thenew Functioncall, which is eval in all but name.
- The static list and the script disagree on
soon, and the script's comment is wrong. The script dropssoonentries, but the test requires everyGAMESentry,soonones included, to appear in the static HTML as a link. The firstsoongame will either break the test or link to a folder that does not exist. Fix: filtersoonin the test the same way the script does. Also, the comment says "a new game needs no edit here", but the README and the test both require a matching<li>here. Make the comment say what is true.
No security problems: the server is static, the script writes with textContent, and there is no state, no writes and no tty.
All three review points are fixed and pushed to the same branch. serve.test.mjs and shell.test.mjs pass (11 tests). I did not run bun x tsc --noEmit and did not open the page in a browser.
- Credits and forged marks. The home page now has a footer with the README credit line: concept by abhi, game by AmirMushich, and shawn.'s Small plays as the visual reference, each linked. Kite Hill, Stone Skip and Paper Route show "Game forged by the crew" in both the static list and the rebuilt one. The rebuilt list reads that wording from
PixelPlays.FORGED_NOTE, whichshell.jsnow exports. The test fails if a credit link is missing, a forged game lacks the mark, or a non-forged game has it. - Test cleanup. The
new Functioncall is gone. The test now doesawait import('./shell.js?home')withwindow = globalThis, readswindow.PixelPlays, and deleteswindowandPixelPlaysin afinally. soonentries and the comment. The test now skipssoonentries, as the script does. The script's comment now says the static list must list the same games, whichserve.test.mjschecks, and that the script rebuilds it fromGAMES.
I couldn't reproduce the preview failure, so the fix I pushed is a guess. The full bun test passes here, 45 tests, and I ran it a dozen times, once with FORGE_TEST_SOCKET set, with no failures. Whether the preview now passes will only show on the next deploy.
The deploy log shows only every game page and its track is served failing, and it ran 12 fewer assertions than I get locally. That fits the test failing partway through its loop. serve.mjs sent responses without a content-length. Node therefore used chunked framing, including on the HEAD requests that test makes for each track. A client reusing the connection can trip on that, which could explain a failure that comes and goes. I added content-length to the 200 responses in serve.mjs.
If the preview fails again, the log should say which assertion in that test broke. Nothing else changed.
All five earlier asks are met at this head:
- Credits and forged marks: met. The home page footer carries the README credit line, with links to abhi, AmirMushich and shawn.'s Small plays. Kite Hill, Stone Skip and Paper Route show "Game forged by the crew" in both the static list and the rebuilt one. The rebuilt list reads the wording from
PixelPlays.FORGED_NOTE. The test fails if a credit link or a mark is missing or misplaced. - Script comment: met. It now says the static list must match and that
serve.test.mjschecks it. soonfilter: met. The test and the script both dropsoonentries.- Global cleanup: met.
windowandPixelPlaysare deleted in afinally. new Function: met. It is replaced byawait import('./shell.js?home').
The only other change since b87a5d1 is content-length on the 200 responses in serve.mjs. It is correct, since it is the length of the buffer actually read, and harmless.
On the preview at this head:
/answers 200 with no refresh, lists all 8 games with their blurbs and shows the credits footer.- All 8 game links answer 200.
shell.jsis served withcontent-length,nosniffandno-referrer.
This is a static app with no writes, identity or terminal, so the door and identity items do not apply.
Non-blocking: the static <li> list duplicates the GAMES entries by hand. The test catches any drift, but serving / from GAMES in serve.mjs would remove the copy altogether.
/is now a plain white page that lists every game with its title and one-line description. Each entry links to<id>/, and the meta refresh is gone. I ranserve.test.mjsandshell.test.mjsand both pass; I did not open the page in a browser or runbun x tsc --noEmit.GAMESentry inshell.jsnow has ablurb, taken from the README table. A short script on the home page rebuilds the list fromGAMESon load, so a new game shows up without editing the page.index.htmlalso carries a static list of the same links, so the links work with scripts off.<li>inindex.html, andserve.test.mjsfails until it is added. The README's "Add a game" section says so.url=balote/assertion is replaced. The new test checks that/answers 200 and has no refresh. It also checks that everyGAMESentry has a blurb and appears in the served HTML with its link and blurb.The README games table is unchanged. The issue warned about conflicts with other in-flight new-game issues over
GAMES. This branch already includes Paper Route, Kite Hill and Stone Skip.Closes #7