docs: update yarn contributing requirements with corepack #30877
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.
Additional details
Following the CONTRIBUTING Requirements for Yarn installation, with
corepack
enabled, fails:Background
The CONTRIBUTING Requirements instructions for Yarn are incomplete and simply link to the Yarn 1 Classic installation instructions.
In the meantime, Yarn by default refers to Yarn Modern (4.x) and the experimental
corepack
technology has been introduced, generally, and in PR #30860 thecorepack
packageManager
key was added to the Cypress repo.Yarn 1 Classic is however no longer supported and
corepack
installation instructions have not been added to its installation documentation.If a contributor user has
corepack
enabled, then the instructions in Yarn 1 Classic installation instructions fail. For instance on Ubuntu24.04.1
LTS with Node.js20.18.1
using n as Node version manager:corepack enable yarn npm install --global yarn
With the addition of
packageManager
to Cypress' package.json, through PR #30860, the instructions change:If
corepack
is already enabled (corepack enable yarn
), then Yarn does not need to be explicitly installed. When executingyarn
in the Cypress repo,corepack
will ask the following if the configured version of Yarn 1 is not already cached:If
corepack
is not previously enabled for Yarn, then the following will enablecorepack
, download Yarn 1 (as configured by Cypress), and executeyarn install
in one step, without any further prompting:Subsequently,
yarn
can be called without prependingcorepack
to the command.Note that
corepack
is currently experimental and disabled by default.Change
Modify the CONTRIBUTING Requirements Yarn installation section:
corepack
is enabled.Steps to test
On Ubuntu
24.04.1
LTS, Node.jsv20.18.1
according to .node-version. Set up system according to CONTRIBUTING Requirements.Confirm that Corepack offers to install Yarn and that running yarn is successful:
How has the user experience changed?
Affects contributors to repo only. No end-user changes.
PR Tasks
cypress-documentation
?type definitions
?