fix(@angular/cli): copy packageManager field and yarn config for temp installs#33551
Open
clydin wants to merge 1 commit into
Open
fix(@angular/cli): copy packageManager field and yarn config for temp installs#33551clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances the package manager utility to support copying and sanitizing Yarn configuration files (.yarnrc.yml and .yarnrc.yaml) during temporary package installations. It strips out fields like yarnPath, plugins, and nodeLinker to prevent issues, and appends nodeLinker: node-modules. Additionally, it copies the project's packageManager field to the temporary package.json to ensure Corepack resolves the correct version. Feedback is provided to improve the robustness of the Yarn configuration sanitizer by ensuring only top-level keys (with zero indentation) are stripped, preventing accidental removal of nested properties.
… installs When installing a temporary CLI package during update command execution, the active packageManager field value is copied from the project to the temporary package.json to establish a local version boundary for Corepack and prevent upward directory traversal. Additionally, configuration copying is enabled for Yarn to copy project-level .yarnrc.yml/.yarnrc.yaml files so custom registries and credentials are preserved.
ff8fe33 to
16c44a7
Compare
1 task
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.
When installing a temporary CLI package during update command execution, the active packageManager field value is copied from the project to the temporary package.json to establish a local version boundary for Corepack and prevent upward directory traversal.
Additionally, configuration copying is enabled for Yarn to copy project-level .yarnrc.yml/.yarnrc.yaml files so custom registries and credentials are preserved.