Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: migrate yarn modern examples to corepack #1350

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

MikeMcC399
Copy link
Collaborator

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/releases with the Yarn config parameter yarnPath pointing to the file, for example yarnPath: .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:

  1. Remove yarnPath from .yarnrc.yml / remove the file if is it otherwise empty.
  2. Remove the directory .yarn
  3. Add a hash to packageManager in package.json by executing corepack up
  4. Update the README.md file

In the GitHub Actions workflow scripts:

add

corepack enable yarn

MAINTENANCE

In docs/MAINTENANCE.md update the requirements to incorporate corepack.

Verification

Ubuntu 24.04.1 LTS, Node.js 22.13.1 LTS, Corepack 0.30.0 (bundled)

Corepack enabled

corepack enable yarn
cd examples/yarn-modern
yarn
yarn test

cd ../yarn-modern-pnp
yarn
yarn test

Corepack disabled

corepack disable yarn
npm install yarn@latest -g
cd examples/yarn-classic
yarn
yarn test

Dependencies should be installed and tests run without errors.

Cypress update

corepack disable yarn
corepack disable pnpm
npm install pnpm@latest -g
git clean -xfd
npm run update:cypress

Cypress should be updated without error in all examples.

All package managers should still be available:

npm -v # 10.9.x
yarn -v # 1.22.x
pnpm -v # 9.15.x

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 added type: enhancement New feature or request tests ci labels Jan 24, 2025
@MikeMcC399 MikeMcC399 self-assigned this Jan 24, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review January 24, 2025 13:08
@MikeMcC399

This comment was marked as outdated.

@jennifer-shehane jennifer-shehane merged commit 6e739ad into cypress-io:master Jan 24, 2025
76 checks passed
@MikeMcC399 MikeMcC399 deleted the yarn-modern-corepack branch January 24, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci tests type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Yarn Modern examples to Corepack
3 participants