Skip to content

fix(@angular/cli): isolate temporary package installation from parent pnpm workspace#33303

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/ng-update-pnpm-workspace
Open

fix(@angular/cli): isolate temporary package installation from parent pnpm workspace#33303
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/ng-update-pnpm-workspace

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Jun 3, 2026

Write an empty pnpm-workspace.yaml file inside the temporary installation directory when using pnpm. This acts as a workspace boundary, preventing pnpm from searching up the directory tree and modifying the parent workspace's lockfile during ng update.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 3, 2026
@clydin clydin force-pushed the fix/ng-update-pnpm-workspace branch from 330ac84 to 391eab3 Compare June 3, 2026 23:20
@clydin clydin marked this pull request as ready for review June 3, 2026 23:51
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request prevents pnpm from traversing up the directory tree and modifying the project's workspace lockfile by writing a blank pnpm-workspace.yaml in the temporary directory. It also updates the mock host, adds unit tests, and introduces an E2E test to verify the fix. The review feedback suggests simplifying the unit tests by configuring the MockHost with the required directory structure directly in its constructor, which avoids manual spying on host.stat and type casting.

Comment thread packages/angular/cli/src/package-managers/package-manager_spec.ts
Comment thread packages/angular/cli/src/package-managers/package-manager_spec.ts
… pnpm workspace

Write an empty pnpm-workspace.yaml file inside the temporary installation directory when using pnpm. This acts as a workspace boundary, preventing pnpm from searching up the directory tree and modifying the parent workspace's lockfile during ng update.
@clydin clydin force-pushed the fix/ng-update-pnpm-workspace branch from 391eab3 to eb893b9 Compare June 4, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant