Skip to content

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

Merged
dgp1130 merged 1 commit into
angular:mainfrom
clydin:feature-workspace-awareness
Apr 27, 2026
Merged

fix(@angular/cli): introduce initial package manager workspace awareness#33039
dgp1130 merged 1 commit into
angular:mainfrom
clydin:feature-workspace-awareness

Conversation

@clydin

@clydin clydin commented Apr 23, 2026

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown

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
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 27, 2026
@dgp1130
dgp1130 requested review from alan-agius4 and removed request for alan-agius4 April 27, 2026 15:39
@dgp1130
dgp1130 merged commit d6121b5 into angular:main Apr 27, 2026
39 checks passed
@dgp1130

dgp1130 commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin
clydin deleted the feature-workspace-awareness branch April 27, 2026 15:43
@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker 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.

3 participants