From ab52f48e50d0dd242ad5b0cfbee9c458946cd427 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Tue, 11 Aug 2026 08:37:25 -0400 Subject: Show the build's commit in the page footer Workers can't shell out at request time, so the commit has to be baked in before wrangler bundles the sources. compile-views.ts grows a second job and becomes scripts/build.ts: alongside the precompiled views it writes src/commit.generated.ts with `git describe --tags --always --dirty`, which yields a bare short hash until the repo is tagged and marks builds made from an unclean working copy. Co-Authored-By: Claude Opus 5 --- cgithub/CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cgithub/CLAUDE.md') diff --git a/cgithub/CLAUDE.md b/cgithub/CLAUDE.md index 37774cc..0ef4b47 100644 --- a/cgithub/CLAUDE.md +++ b/cgithub/CLAUDE.md @@ -24,7 +24,7 @@ pnpm test - `src/worker.ts` - Cloudflare Workers entry (config in `wrangler.jsonc`) - `src/scraper.ts` - GitHub HTML fetching and JSON extraction logic -**Templates:** `views/*.eta` - Eta templates with layout inheritance (`layout.eta` as base). On Workers, runtime code generation is disallowed, so `scripts/compile-views.ts` precompiles templates to `src/views.generated.ts` (gitignored, regenerated by the `dev`/`deploy` scripts). +**Templates:** `views/*.eta` - Eta templates with layout inheritance (`layout.eta` as base). On Workers, runtime code generation is disallowed, so `scripts/build.ts` precompiles templates to `src/views.generated.ts`. The same script records the build's `git describe` output in `src/commit.generated.ts` for the page footer. Both are gitignored and regenerated by the `dev`/`deploy` scripts. **Static files:** `public/static/*`, served by Workers Static Assets. -- cgit v1.3.1