-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(npm): support updating packageManager
field and Yarn binary
#12088
Conversation
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.
looks good so far, but i like to move the contraints extraction after update phase right before lockfile update binary call is happen
Do you mean you'd like to move these renovate/lib/manager/npm/post-update/yarn.ts Lines 74 to 77 in 6de8930
generateLockFile() calls?
|
I'm not sure, in other managers we prefer to extract the contraints in But the place right before the yarn / npm / pnpm call would be the right place |
I think refactor can be done in another PR, to reduce complications. |
@rarkins Could you let me know what changes are required? |
@ylemkimon I thought you planned to do some refactoring first and then resume this PR? |
@rarkins Nope, I was planning to do them after this PR gets merged 😄 |
@viceice wdyt? |
LGTM, please don't forget 😉 |
🎉 This PR is included in version 28.21.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Updating `yarn` binaries finally supported as of renovatebot/renovate#12088
Updating `yarn` binaries finally supported as of renovatebot/renovate#12088
Changes:
constraints
based on thepackageManager
field, simulating the behavior of CorepackpackageManager
field inpackage.json
Context:
Node v16.9.0+ includes a new tool called Corepack (formerly pmm), to help with managing versions of package managers. It uses the
packageManager
field inpackage.json
, which is in the form of{yarn,pnpm}@<exact version>
.I've tried to create a new manager, but the logic is too intertwined, e.g., the lockfile depends on the version of the package manager. I agree that the
npm
manager is too complex and I see a lot of opportunities to refactor, but it'd be out of scope for this PR.Fixes #11368 if the
packageManager
is set.Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via:
5.18.9
->5.18.10
: https://github.com/ylemkimon/renovate-corepack/pull/55.18.9
->6.16.1
: https://github.com/ylemkimon/renovate-corepack/pull/71.22.11
->1.22.15
: https://github.com/ylemkimon/renovate-yarn-update/pull/52.3.3
->2.4.3
: https://github.com/ylemkimon/renovate-yarn-3/pull/1782.3.3
->3.0.2
: https://github.com/ylemkimon/renovate-yarn-3/pull/181/cc @arcanis (core maintainer of Yarn and Corepack)