Repository navigation
Use Corepack to manage Yarn instead of committed release - #18
Conversation
There was a problem hiding this comment.
💡 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".
| @@ -6,5 +6,3 @@ enableScripts: true | |||
| nodeLinker: node-modules | |||
|
|
|||
| npmMinimalAgeGate: 0 | |||
There was a problem hiding this comment.
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 👍 / 👎.
| - name: Enable Corepack | ||
| run: corepack enable |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Yarn is now provided by Corepack from the
packageManagerfield (yarn@4.18.1) inpackage.json, so the 3.8 MB release file no longer has to live in the repository..yarn/releases/yarn-4.18.1.cjsyarnPathfrom.yarnrc.ymlcorepack enablestep to the CI workflow beforeactions/setup-node, becausecache: 'yarn'invokesyarnand would otherwise hit the Yarn 1.x preinstalled on the runnerLocal setup
Run
corepack enableonce per machine. After thatyarnresolves to the version pinned inpackageManager.Verification
corepack yarn --versionreports 4.18.1 andcorepack yarn install --immutablecompletes on a clean checkout ofmaster.