chore: migrate to Yarn Berry (v4)#2626
Merged
aws-cdk-automation merged 4 commits intomainfrom Apr 10, 2026
Merged
Conversation
1620a86 to
3cd5077
Compare
Migrate the package manager from Yarn Classic (v1) to Yarn Berry (v4) with `node-modules` linker. This replaces the custom workflow helper functions in `common.ts` with projen primitives (`project.renderWorkflowSetup()` and `github.WorkflowSteps.checkout()`) to keep CI configuration in sync with the package manager settings. Key changes: - Configure `YARN_BERRY` package manager with `node-modules` linker - Replace `--frozen-lockfile` / `--check-files` with `--immutable` - Replace `yarn version --no-git-tag-version --new-version` with Berry syntax - Add `corepack enable` before `actions/setup-node` in all workflows - Use projen primitives for checkout and workflow setup where possible
3cd5077 to
387f6a5
Compare
rix0rrr
approved these changes
Apr 10, 2026
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 jsii-compiler project from Yarn Classic (v1) to Yarn Berry (v4) with the
node-moduleslinker, following the same approach used in jsii-rosetta#3622.The old
common.tsexported hardcoded helper functions (ACTIONS_CHECKOUT,ACTIONS_SETUP_NODE,YARN_INSTALL) that duplicated action versions and flags across all workflows. These have been replaced with a singleworkflowSetup()wrapper around projen'sproject.renderWorkflowSetup(), which automatically generates the correct corepack, setup-node, and install steps based on the package manager configuration. Checkout steps now usegithub.WorkflowSteps.checkout()where possible.Jobs that require custom setup-node configuration (matrix node versions, custom registry URLs) still use inline steps, since the projen primitives don't support those options.
Additionally, a 3-day cooldown has been added to the dependency upgrade workflow as supply chain protection. This is enforced at two levels:
ncu --cooldown=3filters packages during discovery, andYARN_NPM_MINIMAL_AGE_GATE=4320mblocks them atyarn installtime.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.