Skip to content

fix(build): build island manifest in build:all, not the ignore-scripts-silenced postbuild:apps hook - #1613

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-fix-island-manifest-buildall
Aug 10, 2026
Merged

fix(build): build island manifest in build:all, not the ignore-scripts-silenced postbuild:apps hook#1613
jung-thomas merged 1 commit into
mainfrom
worktree-fix-island-manifest-buildall

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

Five merged fixes (#1584/#1591/#1594/#1595/#1596) appeared "not live" on DEV after a workstation deploy — but the deploy succeeded and build:all did run. The real root cause:

The #1604 island-fingerprint step build:island-manifest (writes hugo/data/island_manifest.json) was wired only into the postbuild:apps npm lifecycle hook. This repo runs ignore-scripts=true globally, so that hook never fires during a local npm run build:all. Consequences:

  • island_manifest.json was never written
  • hugo/layouts/partials/island-src.html fell back to the unhashed /js/<name>.js path
  • Hugo baked the stale path; the approuter shipped old bundles while the freshly-compiled fingerprinted ones (navigator-COpSY_iS.js, homepage-explainers-OVitlVky.js) sat unreferenced next to them

The fixes were compiled — just never referenced. This is a different failure from the "no build:all before mbt" class (that one was already guarded). CI is immune because deploy.yml/unit-tests.yml run npm run postbuild:apps as an explicit step (deploy.yml:217-223 documents the trap). Only workstation deploys hit it.

Fix

  1. package.jsonbuild:all now calls npm run build:island-manifest explicitly (right after build:apps), so it runs regardless of ignore-scripts.
  2. scripts/deploy-mta.cjs — new Step 2.5 fails the deploy fast if hugo/public/index.html bakes only unhashed island paths while a Vite manifest exists (belt-and-suspenders for the whole class).
  3. CLAUDE.md — new gotcha documenting the ignore-scripts/lifecycle-hook trap and the rule: a build artifact needed for a correct ship must be an explicit build:all step, never a post*/pre* hook.

Verification

  • node --check scripts/deploy-mta.cjs
  • Guard regex validated against the real built homepage — matches hashed refs, would die on all-unhashed ✓
  • Locally: with the manifest present, build:hugo now bakes /js/homepage-explainers-OVitlVky.js + /js/navigator-COpSY_iS.js

…build:apps hook

The #1604 island-fingerprint step build:island-manifest (writes
hugo/data/island_manifest.json) lived only in the postbuild:apps npm
lifecycle hook. This repo runs ignore-scripts=true globally, so that hook
never fires during a local `npm run build:all`. The manifest was never
written, island-src.html fell back to the UNHASHED /js/<name>.js path,
and the approuter shipped stale bundles while the freshly-compiled
fingerprinted ones sat unreferenced beside them — merged JS fixes
(#1584/#1591/#1594/#1595/#1596) looked un-deployed though the deploy
succeeded. CI is immune (it runs postbuild:apps as an explicit step).

- build:all now calls build:island-manifest explicitly after build:apps
- deploy-mta.cjs Step 2.5 fails the deploy if hugo/public bakes only
  unhashed island paths while a Vite manifest exists (belt-and-suspenders)
- CLAUDE.md gotcha documenting the ignore-scripts/lifecycle-hook trap
@jung-thomas
jung-thomas merged commit 82af57d into main Aug 10, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant