Support corepack enabled environments for yarn install
MikeMcC399 opened this issue · comments
This is an enhancement suggestion for cypress-io/cypress-realworld-app, the Cypress "Real World App".
What would you like?
The cypress-io/cypress-realworld-app should allow Yarn Modern to be used to install dependencies in addition to the currently documented Yarn Classic package manager.
This is not a suggestion to migrate the repo fully to Yarn Modern. yarn.lock
stays as a v1
file. The README.md is updated, together with .gitignore. No changes are made to the app itself or to any workflows.
Why is this needed?
The currently used package manager, Yarn Classic (Version 1), is frozen except for security fixes. Some user organizations have already migrated to using the follow-on version Yarn Modern (aka Yarn berry), with current stable version 3.6.3
and release candidate 4.0.0
available. The Yarn Modern installation guide recommends using corepack from Node.js to install. To make this backwards compatible, the Yarn Classic runtime .yarn\releases\yarn-1.22.19.cjs
must be committed to the repo. Allowing for Yarn Modern usage with RWA benefits users who have already generally migrated client systems to Yarn Modern.
Steps needed
-
Update README.md with instructions that work for both Yarn Classic and Yarn Modern users.
-
Invoke
yarn set version classic
to tie the repo to Yarn Classic methods for installation, even when Yarn Modern is installed.
-
Merge the following into .gitignore to prevent Yarn Modern temporary files being unnecessarily considered for commit to the repo:
.pnp.* .yarn/* !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions
References
- Yarn (Classic) > Contributing "The 1.x codebase is fairly old and will only accept security fixes."
- Yarn (Classic) > Installation "These instructions only cover Yarn versions prior to 2.0. Those versions entered maintenance mode in January 2020 and will eventually reach their end-of-life in terms of support. Please see the main website for the most up-to-date documentation: yarnpkg.com/getting-started/migration."
- Yarn Modern > Which files should be gitignored?
I plan to submit a PR soon to implement this suggestion.