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

The app template ships the website specification by default #2936

Parked opened this in answer to
Closed without merging

Every generated app now ships the website specification, and each item is covered by a test in the app's own suite. I extracted a scaffolded app and ran its suite: 60 pass, with lint:design and a strict tsc clean. I also ran the new tests with FORGEAPPENV=production and FORGEAPPURL=https://x.test.

Notes

stopped parked by the crew deploy 0bd4949

opened this

Every generated app now ships the website specification, and each item is covered by a test in the app's own suite. I extracted a scaffolded app and ran its suite: 60 pass, with lint:design and a strict tsc clean. I also ran the new tests with FORGE_APP_ENV=production and FORGE_APP_URL=https://x.test. I did not get test/scaffold.test.ts itself to run here. Its child processes failed with a bun temp-directory error under the sandbox, so I ran the extracted app by hand. That test file is unchanged.

What changed (all in src/apps/scaffold.ts)

  • Head: layout() now has rel=canonical, an SVG icon at /icon.svg, a 180px apple-touch icon, /manifest.webmanifest, and og:image. It also has twitter:card=summary_large_image and WebSite JSON-LD with < escaped.
  • Error pages: an error page passes indexable=false, which drops the canonical and JSON-LD and adds noindex.
  • Generated files: the card and the apple-touch icon are PNGs written with node:zlib, so there is no dependency. They are flat accent-colour shapes with no text. The README says to swap in a designed og.png.
  • Accessibility: a skip link, <main id="main">, and an @media (forced-colors: active) block.
  • Crawler files: /sitemap.xml and /llms.txt. The Sitemap: line in robots.txt appears only in production, since previews stay Disallow: /.
  • Error responses: unmatched paths return the app's own styled 404 when the request accepts text/html; scripts still get the plain not found. Errors return a styled 500.
  • Compression and HSTS: new src/compress.ts gzips text bodies of 1 KiB or more when the client accepts gzip, never the event stream or already-encoded bodies. HSTS is now max-age=31536000; includeSubDomains, with no preload.
  • Heading check: a test requires one <h1> and no skipped level on the home page and the error pages.
  • New modules and tests: new modules are src/site.ts and src/compress.ts, and the new tests are in src/site.test.ts. The README and file map in the template are updated.
  • One existing assertion changed: the old twitter:card check in server.test.ts expected summary, and now expects summary_large_image.

Left out on purpose

  • The agent-readiness extras (AI crawler policy, content signals, agent card, .md negotiation) are not built. The generated README says they need an owner decision.
  • The OG card has no text, because drawing text would need a dependency.

To try it: create an app from the template and run bun test. Then open /, /og.png, /sitemap.xml, /llms.txt and /nope.

Closes #2916

commented

Every generated app now ships the website specification, and each item is covered by a test in the app's own suite. I extracted a scaffolded app and ran its suite: 60 pass, with lint:design and a strict tsc clean. I also ran the new tests with FORGE_APP_ENV=production and FORGE_APP_URL=https://x.test. I did not get test/scaffold.test.ts itself to run here. Its child processes failed with a bun temp-directory error under the sandbox, so I ran the extracted app by hand. That test file is unchanged.

What changed (all in src/apps/scaffold.ts)

  • Head: layout() now has rel=canonical, an SVG icon at /icon.svg, a 180px apple-touch icon, /manifest.webmanifest, and og:image. It also has twitter:card=summary_large_image and WebSite JSON-LD with < escaped.
  • Error pages: an error page passes indexable=false, which drops the canonical and JSON-LD and adds noindex.
  • Generated files: the card and the apple-touch icon are PNGs written with node:zlib, so there is no dependency. They are flat accent-colour shapes with no text. The README says to swap in a designed og.png.
  • Accessibility: a skip link, <main id="main">, and an @media (forced-colors: active) block.
  • Crawler files: /sitemap.xml and /llms.txt. The Sitemap: line in robots.txt appears only in production, since previews stay Disallow: /.
  • Error responses: unmatched paths return the app's own styled 404 when the request accepts text/html; scripts still get the plain not found. Errors return a styled 500.
  • Compression and HSTS: new src/compress.ts gzips text bodies of 1 KiB or more when the client accepts gzip, never the event stream or already-encoded bodies. HSTS is now max-age=31536000; includeSubDomains, with no preload.
  • Heading check: a test requires one <h1> and no skipped level on the home page and the error pages.
  • New modules and tests: new modules are src/site.ts and src/compress.ts, and the new tests are in src/site.test.ts. The README and file map in the template are updated.
  • One existing assertion changed: the old twitter:card check in server.test.ts expected summary, and now expects summary_large_image.

Left out on purpose

  • The agent-readiness extras (AI crawler policy, content signals, agent card, .md negotiation) are not built. The generated README says they need an owner decision.
  • The OG card has no text, because drawing text would need a dependency.

To try it: create an app from the template and run bun test. Then open /, /og.png, /sitemap.xml, /llms.txt and /nope.

commented

Parked by the crew: the check failed ("apps that are busy > (unnamed)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs