Skip to content

fix(@angular/cli): use the workspace package manager in catalog update guidance - #34671

Closed
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/update-catalog-bun-install-guidance
Closed

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/update-catalog-bun-install-guidance

Conversation

@MeAkib

@MeAkib MeAkib commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

When ng update aborts because a package uses the catalog: protocol, the manual migration steps hardcode pnpm and yarn: the install step suggests 'pnpm install' for every package manager except yarn, and the catalog file hint only names pnpm-workspace.yaml and .yarnrc.yml. Bun workspaces also support catalogs, so a bun workspace is told to run 'pnpm install' and to look for files it does not have.

Build the install command from the detected package manager and name the catalog location it actually uses: pnpm-workspace.yaml for pnpm, .yarnrc.yml for yarn, and the 'workspaces.catalog' field in the root package.json for bun. The previous generic text is kept as a fallback when the package manager is unknown.

The new spec fails without the fix: with packageManager: 'bun', the guidance suggested 'pnpm install' and the pnpm/yarn file names.

…e guidance

When `ng update` aborts because a package uses the `catalog:` protocol, the manual
migration steps hardcode pnpm and yarn: the install step suggests 'pnpm install' for
every package manager except yarn, and the catalog file hint only names
pnpm-workspace.yaml and .yarnrc.yml. Bun workspaces also support catalogs, so a bun
workspace is told to run 'pnpm install' and to look for files it does not have.

Build the install command from the detected package manager and name the catalog
location it actually uses: pnpm-workspace.yaml for pnpm, .yarnrc.yml for yarn, and the
'workspaces.catalog' field in the root package.json for bun. The previous generic text
is kept as a fallback when the package manager is unknown.

The new spec fails without the fix: with `packageManager: 'bun'`, the guidance suggested
'pnpm install' and the pnpm/yarn file names.

@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 updates the catalog update guidance in the Angular CLI update resolver to dynamically reference the correct configuration file and install command based on the active package manager (such as pnpm, yarn, or bun). It also adds a unit test to verify this behavior when using 'bun' as the package manager. I have no additional feedback to provide as the changes are well-implemented and covered by tests.

@alan-agius4

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. We are closing this PR for a couple of reasons:

  1. Regression when packageManager resolves to npm: options.packageManager is always populated with the workspace package manager name ('npm' | 'pnpm' | 'yarn' | 'bun'). Previously, the fallback intentionally defaulted to 'pnpm install' unless 'yarn' was detected because npm does not support the catalog: protocol. With this change, if the CLI resolves npm as the package manager (e.g., via angular.json configuration or missing lockfile), it instructs the user to update pnpm-workspace.yaml or .yarnrc.yml and then run 'npm install', which will fail.
  2. Inaccurate Bun catalog guidance: Referring to the 'workspaces.catalog' field in the root package.json as a "catalog configuration file" is inaccurate, as Bun also supports top-level catalog/catalogs fields as well as named catalogs (workspaces.catalogs).

Since the current message already uses (e.g., pnpm-workspace.yaml or .yarnrc.yml) as an example, we prefer to keep the existing behavior.

@alan-agius4 alan-agius4 closed this Nov 9, 2026
@MeAkib
MeAkib deleted the fix/update-catalog-bun-install-guidance branch November 9, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants