Converge frontend to Yarn Berry with global cache#340
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the frontend/ package management and CI to use Yarn Berry (via Corepack) with a shared global cache, aiming to reduce redundant installs across git worktrees while keeping the node_modules linker for tool compatibility.
Changes:
- Pin Yarn Berry via
packageManagerand add Yarn configuration for global cache +node-moduleslinker. - Refresh frontend ignore rules for Yarn Berry artifacts.
- Update GitHub Actions workflows/docs to enable Corepack and use Berry’s
--immutableinstall /yarn version patch.
Show a summary per file
| File | Description |
|---|---|
frontend/package.json |
Pins Yarn Berry via packageManager so Corepack selects the intended Yarn version. |
frontend/.yarnrc.yml |
Adds Yarn Berry configuration (global cache + node-modules), but includes security-weakening settings that should be removed/narrowed. |
frontend/.gitignore |
Updates ignore patterns to Yarn Berry’s recommended .yarn/* + exceptions and .pnp.*. |
.github/workflows/frontend-build.yml |
Enables Corepack and switches install to yarn install --immutable (but Corepack step ordering needs fixing). |
.github/workflows/full-release.yml |
Enables Corepack and uses yarn install --immutable during release builds. |
.github/workflows/cut-release.yml |
Enables Corepack and switches to yarn version patch (but should explicitly set up Node). |
.github/copilot-instructions.md |
Updates frontend install command to yarn install --immutable. |
Copilot's findings
- Files reviewed: 7/9 changed files
- Comments generated: 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Converges the
frontend/Node package management to modern Yarn (Berry 4.16.0) configured with a global cache so git worktrees share installed dependencies instead of each re-installingnode_modules. Uses only Yarn's built-in features — no bespoke scripts.Changes
frontend/package.json: added"packageManager": "yarn@4.16.0"so Corepack activates Berry automatically.frontend/.yarnrc.yml(new):nodeLinker: node-modules— keeps a realnode_modulesso vite/jest/playwright/eslint/tsc work unchanged.enableGlobalCache: true— shared global cache.nmMode: hardlinks-global— hardlink from the global cache so worktrees share inodes.frontend/package-lock.json: deleted (stray npm leftover).frontend/yarn.lock: regenerated in Berry format viayarn install.frontend/.gitignore: replaced the old.yarn/+.yarnrc.ymlignores with Yarn's standard entries (.yarn/*with!exceptions forpatches/plugins/releases/sdks/versions, plus.pnp.*)..yarnrc.ymlis now tracked.CI / workflows
frontend-build.yml: addedcorepack enablestep and switchedyarn install --frozen-lockfile→yarn install --immutable(Berry equivalent). Keptcache: 'yarn'+cache-dependency-path: frontend/yarn.lock.cut-release.yml: addedcorepack enable;yarn version --patch --no-git-tag-version→yarn version patch(Berry equivalent, no git tag by default).full-release.yml: addedcorepack enable;yarn install→yarn install --immutable..github/copilot-instructions.md:yarn install --frozen-lockfile→yarn install --immutable.GitHub runners default to Yarn classic v1, which can't read the Berry lockfile, so
corepack enableis required before anyyarninvocation.Verification
In
frontend/, all pass:yarn install/yarn install --immutable(no lockfile drift)yarn lint✅yarn tsc✅yarn build✅yarn test✅ (9 suites, 79 tests)E2E (
yarn test:e2e) skipped — requires browser download.