feat: add support for .corepack.env#642
Merged
aduh95 merged 11 commits intonodejs:mainfrom Feb 28, 2025
Merged
Conversation
Member
|
I'm not sure about this feature. Adding a config file sounds like increased complexity for very little benefit. Do you have examples of when you might use this? |
Contributor
Author
The tests in this PR as well as in #634 are good examples I think |
Contributor
Author
|
And #628 of course |
arcanis
reviewed
Feb 14, 2025
README.md
Outdated
Comment on lines
298
to
300
| Only keys that starts with `COREPACK_` will be taken into account, not all | ||
| keys that start with `COREPACK_` will be taken into account ( | ||
| `COREPACK_ENABLE_DOWNLOAD_PROMPT` and `COREPACK_ENV_FILE` are ignored). |
Contributor
There was a problem hiding this comment.
This would be worth a test, especially for COREPACK_ENABLE_DOWNLOAD_PROMPT (assuming you omitted it for security reasons?)
Contributor
Author
There was a problem hiding this comment.
Good call (yes, btw I’m happy to add more which we think could be security sensitive)
arcanis
approved these changes
Feb 17, 2025
MikeMcC399
reviewed
Feb 17, 2025
Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
aduh95
commented
Feb 20, 2025
This was referenced Feb 28, 2025
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.
This would allow project author to customize the behavior of Corepack – with the recent incident related to npm registry key rotation, it show how it would be useful to override the built-in values. It could also be used to disable auto pinning at a project level.
It's also a first step towards allowing specifying ranges in the
package.json(see #634), which has been requested for a long long time (#95).Fixes: #628