chore: migrate monorepo from Yarn Classic to Yarn Berry#1321
Draft
chore: migrate monorepo from Yarn Classic to Yarn Berry#1321
Conversation
auto-merge was automatically disabled
April 8, 2026 10:58
Pull request was converted to draft
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1321 +/- ##
==========================================
+ Coverage 88.20% 88.29% +0.08%
==========================================
Files 73 73
Lines 10386 10386
Branches 1409 1414 +5
==========================================
+ Hits 9161 9170 +9
+ Misses 1198 1189 -9
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
01df504 to
b548731
Compare
b548731 to
3c92bb8
Compare
Enable `yarnBerry: true` in projenrc and synthesize all packages. Upgrades `cdklabs-projen-project-types` to ^0.3.21 and `projen` to ^0.99.38 which include Yarn Berry support for monorepos.
52d20ce to
8b2f363
Compare
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.
This migrates the monorepo from Yarn Classic (v1) to Yarn Berry (v4.13.0) by enabling the
yarnBerry: trueoption in projenrc.Yarn Classic has been in maintenance mode for years and Yarn Berry is the actively developed version. The migration is needed to stay on a supported package manager and to unblock future improvements that depend on Yarn Berry features, such as better workspace dependency resolution and the
yarn dlxcommand.The actual change is a single line in
.projenrc.ts. Everything else is the result of runningnpx projenwith the updatedcdklabs-projen-project-types(^0.3.21) andprojen(^0.99.38) which now support Yarn Berry monorepos.The
nodeLinker: node-modulessetting in the new.yarnrc.ymlfiles ensures that Yarn Berry continues to use the traditionalnode_moduleslayout. This means the migration should be transparent to all packages and their consumers — no code changes are required, only the tooling around dependency installation and workspace commands changes.Notably, the Yarn Classic
nohoistconfiguration in the rootpackage.jsonis replaced byinstallConfig.hoistingLimits: workspacesin the packages that previously needed it (cloud-assembly-schemaandcloud-assembly-api). This is the Yarn Berry equivalent and achieves the same isolation of bundled dependencies.CI workflows are updated to use
corepack enablebeforesetup-node(so that thepackageManagerfield inpackage.jsonis respected) and allyarn installflags are updated from the Classic syntax (--check-files,--frozen-lockfile) to the Berry equivalents (--no-immutable,--immutable). Task definitions in.projen/tasks.jsonswitch fromyarn workspaces runtoyarn workspaces foreach --all --exclude . --topological-dev runand fromnpxtoyarn dlxwhere appropriate.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license