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

Every app template's README says how to run its tests and where its state lives #15180

Merged opened this

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

Merged

The only baked template, templates/app-template.json, already says both things in its README. It has bun test and FORGEAPPDATA (the "state lives under" sentence), so I changed no README and added only the pinning test.

Notes

shipped production is serving it deploy cfe12e4

opened this

The only baked template, templates/app-template.json, already says both things in its README. It has bun test and FORGE_APP_DATA (the "state lives under" sentence), so I changed no README and added only the pinning test.

  • Helper: readmeGaps(readme) in src/core/app_templates.ts returns whichever of the two lines a README lacks.
  • Test: test/templates-readme.test.ts runs readmeGaps on sample READMEs missing each line, then on every templates/*.json. A new or edited template whose README drops either line fails it.
  • Checks: bun x tsc --noEmit is clean and the new test plus test/app_templates.test.ts pass (11 tests). I ran only those two files; the forge runs the rest on push.
  • Not done: I did not check templates that live as marked repositories on the forge (templates a site admin has marked). Only the copy shipped in the image is covered.

To try it, run bun test test/templates-readme.test.ts. To see it fail, delete the bun test line from the README inside templates/app-template.json.

🤖 Generated with Claude Code

Closes #15165

commented

The only baked template, templates/app-template.json, already says both things in its README. It has bun test and FORGE_APP_DATA (the "state lives under" sentence), so I changed no README and added only the pinning test.

  • Helper: readmeGaps(readme) in src/core/app_templates.ts returns whichever of the two lines a README lacks.
  • Test: test/templates-readme.test.ts runs readmeGaps on sample READMEs missing each line, then on every templates/*.json. A new or edited template whose README drops either line fails it.
  • Checks: bun x tsc --noEmit is clean and the new test plus test/app_templates.test.ts pass (11 tests). I ran only those two files; the forge runs the rest on push.
  • Not done: I did not check templates that live as marked repositories on the forge (templates a site admin has marked). Only the copy shipped in the image is covered.

To try it, run bun test test/templates-readme.test.ts. To see it fail, delete the bun test line from the README inside templates/app-template.json.

🤖 Generated with Claude Code

commented

The baked app template's README already says how to run the tests (bun test) and where state lives (FORGE_APP_DATA). I changed no README and added only a pinning test.

The earlier push failed the dead-code check. I had exported a readmeGaps helper from src/core/app_templates.ts that only the test called. I moved it into the test, so src/core/app_templates.ts is back to its original state.

test/templates-readme.test.ts checks the helper against sample READMEs missing each line. It then checks every templates/*.json, so a template whose README drops either line fails.

The check run reported two other failures, "the screen shows the share, the budgets that refused…" and "the guides are read once…". Both pass when I run them here, so I did not change anything for them. I did not re-run the full suite. bun x tsc --noEmit is clean, and the new test, test/unused-exports.test.ts and those two files pass.

I did not check templates that live as marked repositories on the forge; only the copy shipped in the image is covered.

To try it, run bun test test/templates-readme.test.ts. To see it fail, delete the bun test line from the README inside templates/app-template.json.

🤖 Generated with Claude Code

Approved

A test-only pull: it reads every templates/*.json and checks the README for bun test and FORGE_APP_DATA. I confirmed the one baked template carries both. The helper lives in the test, so there is no dead export. There is no page change, and nothing touches the pipeline items. Two things I would do next: (1) match the lines inside the README's code fences or sentences, not anywhere, so a README that says "do not run bun test" cannot pass; (2) cover templates that site admins mark as repositories, which today only the baked copy pins.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs