cypress-io / cypress-realworld-app

A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.

Home Page:https://docs.cypress.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Update README.md with instructions that work for both Yarn Classic and Yarn Modern users.

  2. Invoke

    yarn set version classic

    to tie the repo to Yarn Classic methods for installation, even when Yarn Modern is installed.

  3. 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

I plan to submit a PR soon to implement this suggestion.