Skip to content

chore: migrate to Corepack-managed Yarn 4#812

Merged
tomcasaburi merged 5 commits intomasterfrom
codex/chore/yarn4-corepack
Mar 19, 2026
Merged

chore: migrate to Corepack-managed Yarn 4#812
tomcasaburi merged 5 commits intomasterfrom
codex/chore/yarn4-corepack

Conversation

@tomcasaburi
Copy link
Member

@tomcasaburi tomcasaburi commented Mar 19, 2026

Summary

  • pin the app to Yarn 4 via Corepack
  • remove reliance on global Yarn Classic
  • align CI, docs, and contributor setup with plain yarn
  • fix Vercel preview installs to use the Yarn 4 install command

Testing

  • yarn install --immutable
  • yarn build
  • yarn type-check
  • yarn lint
  • yarn test --run
  • vercel build

Note

Medium Risk
Build and release pipelines now rely on Corepack/Yarn 4 and yarn install --immutable, which can fail if lock/config isn’t aligned across environments. No runtime product logic changes, but CI/deploy breakage risk is moderate.

Overview
Migrates the repo to Corepack-managed Yarn 4 by pinning packageManager in package.json, adding .yarnrc.yml, and updating contributor docs to use corepack enable with Node pinned via .nvmrc.

Updates GitHub Actions release/test workflows and Vercel builds to run corepack and replace yarn install --frozen-lockfile (and related v1 flags) with yarn install --immutable. Also tweaks dependency sourcing for @plebbit/plebbit-react-hooks (tarball URL) and makes vitest pass when no tests are found (--passWithNoTests).

Written by Cursor Bugbot for commit c4b83e6. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Chores

    • Require Node 22.12.0 and opt into Yarn 4 via Corepack; installs now use immutable installs and the node-modules linker
    • CI and deployment workflows updated to enable Corepack and use unified immutable install commands
    • Package metadata updated to declare Yarn 4 and adjusted dev/test tooling and dependency entries
  • Documentation

    • Contributor/setup and tooling docs updated to reflect Node/Corepack/Yarn changes and new install/build commands

@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
seedit Ready Ready Preview, Comment Mar 19, 2026 7:02am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c682649-e3f6-4217-a5e0-a89dd49902b4

📥 Commits

Reviewing files that changed from the base of the PR and between 9be1bd8 and c4b83e6.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • .github/workflows/test.yml
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/release.yml
  • .github/workflows/test.yml

📝 Walkthrough

Walkthrough

This PR standardizes Node/Yarn tooling: adds .nvmrc (Node 22.12.0), pins Yarn 4 via packageManager, enables Corepack usage, updates CI and Vercel install/build commands to use Corepack + yarn install --immutable, and adjusts docs and package metadata for Yarn 4 compatibility.

Changes

Cohort / File(s) Summary
CI & Release Workflows
.github/workflows/release.yml, .github/workflows/test.yml
Add corepack enable steps; replace yarn install --frozen-lockfile (and Yarn v1 network flags) with yarn install --immutable; preserve retry loop logic.
Platform Build Config
vercel.json
Set installCommand to corepack yarn install --immutable and change buildCommand to corepack yarn build.
Package Manager / Node config
.nvmrc, .yarnrc.yml, package.json
Add .nvmrc (Node 22.12.0); set nodeLinker: node-modules; add packageManager: "yarn@4.13.0"; change dependency source for @plebbit/plebbit-react-hooks; consolidate kubo and adjust devDependencies and test script.
Documentation & Guides
AGENTS.md, README.md
Document contributor setup using nvm and corepack enable; update example hooks and audit commands to use corepack yarn; simplify local setup instructions.
Tooling configs (CI cache change)
.github/workflows/* (jobs)
Remove built-in actions/setup-node@v4 Yarn cache usage in favor of explicit Corepack enablement across jobs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped through Corepack, tidy and spry,
Node twenty-two under a bright sky,
Yarn four hums with immutable song,
CI steps snug, retry loops strong,
A carrot of change — small, swift, and spry.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: migrate to Corepack-managed Yarn 4' directly and clearly summarizes the main change—migrating the project to use Corepack to manage Yarn 4, which is the primary objective of the entire changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/chore/yarn4-corepack
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
package.json (1)

63-63: Reasonable addition of --passWithNoTests.

This flag prevents CI failures when no test files match. Consider removing it once test coverage is established, as it can mask the absence of expected tests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 63, The package.json "test" npm script currently
includes the vitest flag --passWithNoTests which masks missing tests; update the
"test" script (the "test" property in package.json) to remove the
--passWithNoTests flag once you have real test files, so that CI will fail when
tests are absent and ensure test coverage is enforced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 137-139: Add the missing --ignore-engines flag to the Windows
job's yarn install step to match other jobs: update the run command that
currently uses "yarn install --immutable" in the Windows job (the step following
"corepack enable") to include "--ignore-engines" so it reads "yarn install
--immutable --ignore-engines", ensuring consistent behavior with the Linux, Mac,
Android, and finalize-release jobs.

In `@vercel.json`:
- Around line 5-6: The vercel.json uses "installCommand" and "buildCommand" with
"corepack yarn" but Corepack is experimental on Vercel; set the environment
variable ENABLE_EXPERIMENTAL_COREPACK=1 in the Vercel project/deployment
settings and ensure package.json includes a packageManager entry (e.g.,
"packageManager": "yarn@4.x.x") so the "corepack yarn install --immutable" and
"corepack yarn build" commands work reliably during deployments.

---

Nitpick comments:
In `@package.json`:
- Line 63: The package.json "test" npm script currently includes the vitest flag
--passWithNoTests which masks missing tests; update the "test" script (the
"test" property in package.json) to remove the --passWithNoTests flag once you
have real test files, so that CI will fail when tests are absent and ensure test
coverage is enforced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c571c556-f9f7-49f5-8f27-cf300a433460

📥 Commits

Reviewing files that changed from the base of the PR and between 5368970 and 9be1bd8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • .github/workflows/release.yml
  • .github/workflows/test.yml
  • .nvmrc
  • .yarnrc.yml
  • AGENTS.md
  • README.md
  • package.json
  • vercel.json

Comment on lines +137 to +139
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistency: Windows job omits --ignore-engines.

Other jobs (Linux at line 33, Mac at line 94, Android at line 182, finalize-release at line 225) use --ignore-engines, but the Windows job does not. This could cause failures if engine constraints don't match on Windows runners.

🛠️ Proposed fix for consistency
      - run: corepack enable
      - name: Install dependencies (with Node v22)
-       run: yarn install --immutable
+       run: yarn install --immutable --ignore-engines
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable --ignore-engines
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 137 - 139, Add the missing
--ignore-engines flag to the Windows job's yarn install step to match other
jobs: update the run command that currently uses "yarn install --immutable" in
the Windows job (the step following "corepack enable") to include
"--ignore-engines" so it reads "yarn install --immutable --ignore-engines",
ensuring consistent behavior with the Linux, Mac, Android, and finalize-release
jobs.

Comment on lines +5 to +6
"installCommand": "corepack yarn install --immutable",
"buildCommand": "corepack yarn build",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does Vercel support Corepack for Yarn?

💡 Result:

Yes—Vercel supports using Corepack for Yarn, but it’s treated as experimental and must be explicitly enabled.

  • Enable Corepack on Vercel by setting the environment variable ENABLE_EXPERIMENTAL_COREPACK=1, and set your desired Yarn version via packageManager in your root package.json (for example, "packageManager": "yarn@4.x.x"). [1][2]
  • Vercel’s own docs note that if you’re using Yarn 4, you should enable Corepack. [3]

Sources: [1][2][3]


Environment variable required for Corepack to work on Vercel.

While Vercel supports Corepack, it's treated as experimental and requires explicit enablement. The corepack yarn commands in vercel.json will not work without setting the environment variable ENABLE_EXPERIMENTAL_COREPACK=1 in your Vercel deployment settings. Additionally, ensure your package.json includes the packageManager field (e.g., "packageManager": "yarn@4.x.x").

Verify that both the environment variable and package.json configuration are in place before deploying.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vercel.json` around lines 5 - 6, The vercel.json uses "installCommand" and
"buildCommand" with "corepack yarn" but Corepack is experimental on Vercel; set
the environment variable ENABLE_EXPERIMENTAL_COREPACK=1 in the Vercel
project/deployment settings and ensure package.json includes a packageManager
entry (e.g., "packageManager": "yarn@4.x.x") so the "corepack yarn install
--immutable" and "corepack yarn build" commands work reliably during
deployments.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@tomcasaburi tomcasaburi merged commit 5439f6e into master Mar 19, 2026
8 checks passed
@tomcasaburi tomcasaburi deleted the codex/chore/yarn4-corepack branch March 19, 2026 07:06
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