fix(build): build island manifest in build:all, not the ignore-scripts-silenced postbuild:apps hook - #1613
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Five merged fixes (#1584/#1591/#1594/#1595/#1596) appeared "not live" on DEV after a workstation deploy — but the deploy succeeded and
build:alldid run. The real root cause:The #1604 island-fingerprint step
build:island-manifest(writeshugo/data/island_manifest.json) was wired only into thepostbuild:appsnpm lifecycle hook. This repo runsignore-scripts=trueglobally, so that hook never fires during a localnpm run build:all. Consequences:island_manifest.jsonwas never writtenhugo/layouts/partials/island-src.htmlfell back to the unhashed/js/<name>.jspathnavigator-COpSY_iS.js,homepage-explainers-OVitlVky.js) sat unreferenced next to themThe 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.ymlrunnpm run postbuild:appsas an explicit step (deploy.yml:217-223 documents the trap). Only workstation deploys hit it.Fix
package.json—build:allnow callsnpm run build:island-manifestexplicitly (right afterbuild:apps), so it runs regardless ofignore-scripts.scripts/deploy-mta.cjs— new Step 2.5 fails the deploy fast ifhugo/public/index.htmlbakes only unhashed island paths while a Vite manifest exists (belt-and-suspenders for the whole class).CLAUDE.md— new gotcha documenting theignore-scripts/lifecycle-hook trap and the rule: a build artifact needed for a correct ship must be an explicitbuild:allstep, never apost*/pre*hook.Verification
node --check scripts/deploy-mta.cjs✓build:hugonow bakes/js/homepage-explainers-OVitlVky.js+/js/navigator-COpSY_iS.js✓