Skip to content

fix(@angular/cli): abort and guide manual mitigation when updating catalog packages#33566

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-catalog-update-mitigation
Open

fix(@angular/cli): abort and guide manual mitigation when updating catalog packages#33566
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-catalog-update-mitigation

Conversation

@clydin

@clydin clydin commented Jul 14, 2026

Copy link
Copy Markdown
Member

When packages to be updated are configured to use catalogs (e.g. '@angular/core': 'catalog:'), ng update cannot modify the shared catalog configuration files directly without potentially breaking other monorepo projects.

Detect catalog updates early in resolveUserUpdatePlan, resolve the target versions from the registry, and abort with a detailed step-by-step instruction on how to manually update their catalog config file, run package manager install, and execute migration schematics via 'ng update --migrate-only --from '.

Closes #31780

@clydin clydin marked this pull request as ready for review July 14, 2026 19:41

@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 introduces a check for packages configured to use catalogs (e.g., using the catalog: specifier) during the ng update process. Since catalogs are shared across monorepos and cannot be modified directly by ng update, the new checkCatalogUpdates function blocks the update and provides clear instructions on how to manually update the catalog configuration and run the migration schematics. A corresponding unit test has been added to verify this behavior. Feedback on this PR highlights a critical issue where package names containing version suffixes (e.g., @angular/core@16) will bypass the catalog check and cause metadata lookup failures. A code suggestion is provided to parse the package name and version before performing the checks.

Comment thread packages/angular/cli/src/commands/update/update-resolver.ts
@clydin clydin force-pushed the fix-catalog-update-mitigation branch from a1d1bb9 to d6c223a Compare July 14, 2026 19:46
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jul 15, 2026
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver_spec.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver_spec.ts
@clydin clydin force-pushed the fix-catalog-update-mitigation branch from d6c223a to 0dc269f Compare July 15, 2026 18:52
…talog packages

When packages to be updated are configured to use catalogs (e.g. '@angular/core': 'catalog:'), ng update cannot modify the shared catalog configuration files directly without potentially breaking other monorepo projects.

Detect catalog updates early in resolveUserUpdatePlan, resolve the target versions from the registry, and abort with a detailed step-by-step instruction on how to manually update their catalog config file, run package manager install, and execute migration schematics via 'ng update --migrate-only --from <installed-version>'.
@clydin clydin force-pushed the fix-catalog-update-mitigation branch from 0dc269f to 790e090 Compare July 15, 2026 19:01
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support yarn/pnpm catalogs

2 participants