-
Notifications
You must be signed in to change notification settings - Fork 195
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
feat: let .corepack.env
be a lock file
#668
base: main
Are you sure you want to change the base?
Conversation
To be clear, this is only going to update Its not going to create |
Yes correct, if it exists and contains the env key – so it’s currently opt-in, I think we could discuss whether we want to flip that to opt-out once the |
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.
Why do we need that considering that packageManager
can already be used as a lock for devEngines.packageManager
?
So one can git ignore it I believe is the ask |
I'm not sure I follow the use case. Why would they use Corepack (or devEngine) if they don't want to lock the version in the project? |
Then disable auto pinning? I don't think this behavior should have been made the default anyway. |
@zanminkian could you give an example of use case where putting a .gitignored |
I tend to agree. I believe the default auto-pinning was added as a response to earlier TSC meetings where this was a recommendation to making corepack stable and default enabled with node distributions. Now that corepack is no longer going to be bundled with node, we could consider disabling the auto pinning behavior. |
With #642 and #643 landed, we can consider using
.corepack.env
as a lockfile. If thepackage.json
defines adevEngines.packageManager
, we can accept an env variable that defines the exact version Corepack should be using; if that version is put in a.corepack.env
(Node.js 20+ users only), it's effectively a lockfile.I'm not a fan of the env variable name chosen, happy to use a different one.
Fixes: #402
Fixes: #95
Fixes: #682