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

chore: remove committed Yarn 1.22.22 cjs #1610

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Jan 15, 2025

Issue

The repo is currently configured to use .yarn/releases/yarn-1.22.22.cjs as Yarn 1 Classic package manager if the user has Node.js experimental corepack enabled.

For comparison, the cypress repo is now configured with its package.json defining the packageManager key without however committing any Yarn package manager executable code to its repo.

The cypress setup is sufficient to enable Yarn 1 Classic to be used. If a user does not have the configured packageManager version installed locally, then corepack will install it and store it in the node/corepack cache - on Ubuntu in ~/.cache/node/corepack. It is not necessary to commit Yarn to the repo.

Concerns were raised by @emilyrohrbough in #1408 (comment) from Nov 2023, although these were not followed up with actions until now.

Background

Alternatives:

yarn set version classic # causes .yarn/releases/yarn-classic.cjs to be installed in the repo
yarn set version 1.22.22 # causes .yarn/releases/yarn-1.22.22.cjs to be installed in the repo
corepack use yarn@1 # causes only "packageManager": "[email protected]+sha512 to be set (and runs yarn)

Change

Verification

On Ubuntu 24.04.1 LTS, using Node.js 20.12.0 according to .node-version.

Corepack disabled

Install Yarn Classic globally and run yarn:

corepack disable
npm install yarn@latest -g
yarn -v
git clean -xfd
yarn
git status

Confirm that Yarn v1.22.22 is used to install, that there are no errors and no files identified by git for committing.

Corepack enabled

Enable corepack and run yarn:

corepack disable
rm -rf ~/.cache/node/corepack
npm uninstall yarn -g
corepack enable yarn
git clean -xfd
yarn
git status

Confirm that Corepack prompts to install https://registry.yarnpkg.com/yarn/-/yarn-1.22.22.tgz, and after confirming with "Y", that yarn is downloaded and then installs dependencies with no errors. There should also be no files identified by git for committing after yarn install has completed.

@cypress-app-bot
Copy link

@jennifer-shehane jennifer-shehane merged commit 3573e78 into cypress-io:develop Jan 15, 2025
8 checks passed
@MikeMcC399 MikeMcC399 deleted the remove/yarn-cjs branch January 16, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants