Skip to content

fix(@angular/cli): introduce initial package manager workspace awareness#33039

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:feature-workspace-awareness
Open

fix(@angular/cli): introduce initial package manager workspace awareness#33039
clydin wants to merge 1 commit intoangular:mainfrom
clydin:feature-workspace-awareness

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 23, 2026

This change adds the getCurrentPackageName method to the package manager abstraction. When dealing with workspaces (such as npm workspaces), the parser uses the resolved identity of the active package to prioritize dependencies belonging directly to that subproject.

It ensures that running ng update inside a subproject directory resolves the dependency versions declared for that subproject, while gracefully falling back to root hoisted versions for shared dependencies.

@clydin clydin force-pushed the feature-workspace-awareness branch from a0a776e to 533cb9d Compare April 23, 2026 19:14
This change adds the getCurrentPackageName method to the package manager abstraction.
When dealing with workspaces (such as npm workspaces), the parser uses the resolved identity of the active package to prioritize dependencies belonging directly to that subproject.

It ensures that running ng update inside a subproject directory resolves the dependency versions declared for that subproject, while gracefully falling back to root hoisted versions for shared dependencies.
@clydin clydin force-pushed the feature-workspace-awareness branch from 533cb9d to 2085fdb Compare April 23, 2026 19:48
@clydin clydin added target: patch This PR is targeted for the next patch release action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 23, 2026
@clydin clydin marked this pull request as ready for review April 23, 2026 20:08
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 adds support for identifying and parsing workspace-specific dependencies in monorepo setups for npm-like package managers. It introduces a getPackageNameCommand to the package manager descriptors and updates the dependency parsing logic to extract nested dependencies when a workspace package name is provided. Feedback was provided regarding the efficiency of the getCurrentPackageName method, suggesting that its result be cached to prevent unnecessary repeated executions or file reads.

Comment thread packages/angular/cli/src/package-managers/package-manager.ts
@clydin clydin requested review from alan-agius4 April 23, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer 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