-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add npm supply-chain hardening #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| semver-major-days: 7 | ||
| semver-minor-days: 7 | ||
| semver-patch-days: 7 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ignore-scripts=true | ||
| min-release-age=3 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [install] | ||
| minimumReleaseAge = 259200 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
What npm CLI version introduced.npmrcsupport formin-release-age, and what is npm's behavior when this key is unknown or unsupported?💡 Result:
npm CLI version 11.10.0 introduced support for the
min-release-agekey in.npmrc[1][2][3]. This feature was added via pull request#8965, merged in commit 66d6e11 on 2026-02-10, and released on 2026-02-11 [4][3]. Secondary sources confirm it requires npm v11.10.0 or above [5][6].Citations:
🏁 Script executed:
Repository: kitze/apple-crusher
Length of output: 83
🏁 Script executed:
Repository: kitze/apple-crusher
Length of output: 86
🌐 Web query:
npm behavior with unknown or unsupported keys in .npmrc configuration file💡 Result:
When npm reads a.npmrc file, it only recognizes configuration keys that are officially defined for npm. If your.npmrc contains unknown/unsupported top-level keys, npm behavior (as of npm v11) is: 1) npm warns about unknown keys starting in npm v11.2.0 - npm’s.npmrc documentation states that “Starting in npm v11.2.0, npm warns when unknown configuration keys are defined in.npmrc.” [1] - The warning format is illustrated (e.g., “warn Unknown user config "electron_mirror". This will stop working in the next major version of npm.”). [1] 2) Historically tolerated keys will eventually stop working (and may become hard errors) - The docs explicitly say that these unknown keys “were historically tolerated but are not officially supported” and that “A future major version of npm will treat unknown top-level keys as errors.” [1] - npm/cli issue discussions reiterate the intended deprecation and that unknown keys produce warnings with future versions. [2][3] 3) Recommended handling for “third-party” config keys - npm’s docs recommend that “Custom keys intended for third-party tools (for example, electron-builder) should not be placed in.npmrc.” [1] - Instead, it recommends using environment variables for cross-platform configuration. [1] Practical implication - In current npm v11.x, unknown.npmrc keys typically do not get applied as npm config; they mainly cause warnings and are slated for breakage in a future major release. [1] If you tell me the specific.npmrc keys you’re using (the exact lines), I can tell you whether they’re recognized npm config keys or likely fall into the “unknown/unsupported” category per npm’s documented behavior.
Citations:
🌐 Web query:
npm v10 npm v11 npm v12 support for .npmrc keys and handling of unknown configuration keys💡 Result:
npm v10 supports all standard.npmrc keys as listed in the official config documentation, with no warnings or errors for unknown keys[1][2]. npm v11 (starting from v11.2.0) introduced warnings for unknown/unsupported configuration keys in.npmrc files (user, project, global). Only officially supported keys are recognized; custom keys (e.g., electron_mirror for third-party tools) trigger warnings like "npm warn Unknown user config 'key'. This will stop working in the next major version of npm."[3][4][5][6][7]. Recommendations: Use package.json#config for package-specific settings (exposed as npm_package_config_* env vars, no warnings), environment variables, or CLI flags with --[4][5]. npm v12: No specific changes found in current releases (latest v11.13.0 as of 2026-05-13); warnings continue from v11[8][9][10][11]. A proposed breaking change to make unknown.npmrc keys hard errors (instead of warnings) is open in npm/cli#9276 (created 2026-04-23), targeted for a future major version (likely v12), along with errors for unknown CLI flags/abbreviations[12]. As of now, v12 docs not available, handling matches v11 (warnings). Supported keys are consistent across versions: auth-related (_auth, _authToken, etc., must be registry-scoped), registry, cache, etc. See full list in docs[1][4][2][13]. Custom/third-party keys never officially supported; prior tolerance ended with warnings in v11[4][5]. Use
npm config lsto list active configs,npm config editto edit.npmrc[14].Citations:
🏁 Script executed:
# Read package.json to check npm version constraints cat package.jsonRepository: kitze/apple-crusher
Length of output: 1212
Require npm ≥11.10.0 for
min-release-ageguardrail.The
min-release-agekey requires npm v11.10.0 or later. Without pinning npm (viaengines.npmin package.json orpackageManagerfield), developers on npm v10 will silently ignore this setting, and those on npm v11.0–v11.9 will receive warnings but still skip enforcement. Add an npm version constraint and enforce it in CI to ensure the guardrail is consistently applied.🤖 Prompt for AI Agents