chore: migrate yarn modern to npm registry corepack #1420
Merged
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.
Situation
The current Yarn Modern Installation instructions recommend managing Yarn through Corepack and they now instruct to install Corepack through npm instead of using the version currently still distributed with Node.js. The background is that the Node.js Technical Steering Committee voted to stop distributing the experimental Corepack with Node.js in the long term.
This affects examples, tests and scripts in the repo related to Yarn Modern.
Change
In the appropriate places add
npm install -g corepack.Examples
In both the examples:
Update the
README.mdfile.In the GitHub Actions workflow scripts:
Corepack needs to be installed twice. The first time is to ensure that the right version of Corepack is available for Yarn caching in
actions/setup-node. The second installation is to ensure that Corepack is restored to the latest version in caseactions/setup-nodeinstalls an older version.Since this is quite complex, this is not added to the examples in the README. There are currently submissions in
actions/setup-nodeto directly support Corepack which would make this a lot simpler.MAINTENANCE
In docs/MAINTENANCE.md update the reference to
corepackto note that in future it is planned to unbundle it from Node.js.