Skip to content

Use Corepack to manage Yarn instead of committed release - #18

Merged
rtivital merged 1 commit into
masterfrom
corepack-yarn
Oct 4, 2026
Merged

rtivital merged 1 commit into
masterfrom
corepack-yarn

Conversation

@rtivital

@rtivital rtivital commented Oct 4, 2026

Copy link
Copy Markdown
Member

Summary

Yarn is now provided by Corepack from the packageManager field (yarn@4.18.1) in package.json, so the 3.8 MB release file no longer has to live in the repository.

  • Remove .yarn/releases/yarn-4.18.1.cjs
  • Remove yarnPath from .yarnrc.yml
  • Add a corepack enable step to the CI workflow before actions/setup-node, because cache: 'yarn' invokes yarn and would otherwise hit the Yarn 1.x preinstalled on the runner

Local setup

Run corepack enable once per machine. After that yarn resolves to the version pinned in packageManager.

Verification

corepack yarn --version reports 4.18.1 and corepack yarn install --immutable completes on a clean checkout of master.

@rtivital
rtivital merged commit 93204f2 into master Oct 4, 2026
1 check passed
@rtivital
rtivital deleted the corepack-yarn branch October 4, 2026 10:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd7a120642

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .yarnrc.yml
@@ -6,5 +6,3 @@ enableScripts: true
nodeLinker: node-modules

npmMinimalAgeGate: 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align the nested package-manager pin before dropping yarnPath

When a command is run from package/, Corepack selects the closest manifest, so it launches the yarn@4.0.1 pinned in package/package.json rather than the root's 4.18.1; Node's Corepack documentation confirms this closest-manifest behavior. Previously yarnPath redirected that invocation to 4.18.1, but after its removal Yarn 4.0.1 loads the root configuration and rejects newer settings such as approvedGitRepositories and npmMinimalAgeGate, preventing installs and other commands from that workspace. Remove or update the nested packageManager field before dropping this override.

Useful? React with 👍 / 👎.

Comment on lines +17 to +18
- name: Enable Corepack
run: corepack enable

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add Corepack to the local setup instructions

This enables Corepack only in CI, while README.md:8 still tells new template users to run yarn without enabling it—and does so before nvm use. Corepack is opt-in and corepack enable installs its shims next to the active Node binary, as documented in Node's Corepack guide, so after removing the repository-managed Yarn release this onboarding path fails for users without pre-enabled Corepack. Reorder the instructions to run nvm use, then corepack enable, then yarn.

Useful? React with 👍 / 👎.

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.

1 participant