test: migrate yarn modern examples to corepack #1350
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 two examples for Yarn Modern v4 are currently set up so that the Yarn package manager executables are committed to the repo in each corresponding examples directory under
.yarn/releaseswith the Yarn config parameter yarnPath pointing to the file, for exampleyarnPath: .yarn/releases/yarn-4.6.0.cjs.The examples are:
The current Yarn Modern Installation instructions recommend managing Yarn through Corepack.
Change
Examples
In each of the examples:
yarnPathfrom.yarnrc.yml/ remove the file if is it otherwise empty..yarnpackageManagerinpackage.jsonby executingcorepack upREADME.mdfileIn the GitHub Actions workflow scripts:
add
corepack enable yarnMAINTENANCE
In docs/MAINTENANCE.md update the requirements to incorporate
corepack.Verification
Ubuntu
24.04.1LTS, Node.js22.13.1LTS, Corepack0.30.0(bundled)Corepack enabled
Corepack disabled
Dependencies should be installed and tests run without errors.
Cypress update
Cypress should be updated without error in all examples.
All package managers should still be available: