Repository navigation
fix: move lefthook build approval to pnpm-workspace.yaml - #2378
Merged
Merged
Conversation
pnpm v11 no longer reads the package.json `pnpm` field, so onlyBuiltDependencies was ignored and a root `pnpm install` failed with ERR_PNPM_IGNORED_BUILDS for anyone on default build-script approval. Disable lefthook's own postinstall via allowBuilds instead (prepare already installs the hook). ppr-ui has its own pnpm-workspace.yaml so it is unaffected by the new root one.
thorwolpert
approved these changes
Oct 1, 2026
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.
Follow-up to #2364 / #2377, part of the Git Hooks RFC rollout (bcgov/entity#34619).
Problem
pnpm v11 no longer reads the
pnpmfield inpackage.json, so the rootonlyBuiltDependencies: [lefthook]is ignored. For anyone on pnpm's default build-script approval, a rootpnpm installends with:and exits 1. The hook still gets installed (via
prepare), but the install reports failure. Confirmed on a fresh clone ofmain.Fix
pnpmfield frompackage.jsonpnpm-workspace.yamlwithallowBuilds: lefthook: false- lefthook's own postinstall doesn't need to run sincepreparealready installs the hookppr-uihas its ownpnpm-workspace.yaml, so it keeps resolving its own settings and isn't affected by the new root one (checked:pnpm config get allowBuildsinppr-uistill returns its own list).Tested
Windows, pnpm 11.9.0, default build-script approval:
pnpm install --frozen-lockfileexits 0, hook installed, lockfile unchangedppr-api/→ commit blocked