build(npm): make the manifest forward-compatible with npm 12 - #30455
Open
caugner wants to merge 2 commits into
Open
build(npm): make the manifest forward-compatible with npm 12#30455caugner wants to merge 2 commits into
caugner wants to merge 2 commits into
Conversation
npm 12 no longer runs `preinstall`/`install`/`postinstall` from dependencies unless the root `package.json` lists them in `allowScripts`. `npm ci` still succeeds, so a missing entry only surfaces later as a missing binary. Generated with `npm approve-scripts --all --no-allow-scripts-pin`, so the entries are name-only and keep matching after a dependency bump.
Combined with `engine-strict=true` in `.npmrc`, `engines.npm: "^11"` makes `npm install` in this repo fail with `EBADENGINE` under npm 12. `devEngines.packageManager` already states the npm version expected for local development, and it accepts npm 12.
Contributor
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
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.
Summary
Add an
allowScriptsallowlist forlefthookandunrs-resolver, and drop theengines.npm: "^11"constraint.Test results and supporting details
package.jsonallowlists them.lefthook'spostinstallregisters the git hooks, so without the entry contributors silently lose them.engine-strict=truein.npmrc,engines.npm: "^11"makes any install here fail outright withEBADENGINEunder npm 12.devEngines.packageManager(npm >=11.8.0) already states what local development expects, and it accepts npm 12.build/package.jsoncarrying onlynameandversion.--no-allow-scripts-pin), so Dependabot bumps need no re-approval commits, at the cost of trusting future versions of the listed packages.npm ci --strict-allow-scriptspasses on npm 12.0.2.Related issues
Part of mdn/fred#1868.