feat: add Yarn Berry (v2+) support with automatic version switching#1254
Open
ddusht wants to merge 2 commits into
Open
feat: add Yarn Berry (v2+) support with automatic version switching#1254ddusht wants to merge 2 commits into
ddusht wants to merge 2 commits into
Conversation
This was referenced Apr 21, 2026
Open
pacostas
reviewed
Apr 24, 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.
Summary
Adds support for Yarn Berry (v2+), removing the previous limitation of Classic-only installs. The install process is now selected automatically at runtime based on
packageManagerinpackage.json.Changes
switching_install_process.go— NewSwitchingInstallProcessthat readspackageManagerinpackage.jsonand delegates to either the Classic or Berry process. No changes to existingYarnInstallProcesslogic.berry_install_process.go— NewBerryInstallProcessimplementing theInstallProcessinterface:yarn install --immutable(Berry's equivalent of--frozen-lockfile)YARN_NODE_LINKER=node-modulesfor traditionalnode_moduleslayoutinstall-state.gzinto the layer for caching across buildsyarnPathin.yarnrc.yml(invoked asnode <yarnPath> install --immutable); falls back to buildpack-providedyarnwithYARN_IGNORE_PATH=1run/main.go— Wires up both processes throughSwitchingInstallProcess.README.md— Documents Classic vs Berry selection logic andyarnPathbehaviour.Behaviour
packageManagerinpackage.jsonyarn@1.x.xor absentyarn install --frozen-lockfile(Classic)yarn@2.x.xor higheryarn install --immutable(Berry)Checklist