refactor(@angular/cli): transition update command to use PackageManager abstraction#33364
Conversation
6cdfcbc to
93c2ef7
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the update resolution mechanism in the Angular CLI to use a new RegistryClient class for caching package metadata and manifests, while also moving several dependencies (like pacote, ini, and @yarnpkg/lockfile) to the root package.json. The review feedback suggests improving the robustness of the RegistryClient cache by removing rejected promises to prevent cache poisoning, and optimizing performance by parallelizing sequential async operations using Promise.all when building package info and printing update usage messages.
dbc0c36 to
9e77dfc
Compare
7a65ca5 to
50c1489
Compare
…er abstraction Transition the update command's version resolver to utilize the registry methods from the PackageManager abstraction instead of directly querying the registry via pacote. This introduces a cached RegistryClient wrapper that retrieves package metadata and manifests on-demand. Update resolution helper functions are updated to be asynchronous to support the lazy-loading of registry documents.
…y authentication Configure always-auth in the written .npmrc and .yarnrc test profiles within createNpmConfigForAuthentication. By default, Yarn Classic (v1) does not send the Authorization header on GET requests (such as retrieving manifest metadata via yarn info) unless always-auth is enabled. When ng update uses the PackageManager abstraction under Yarn Classic v1, this ensures the necessary authorization headers are sent to secure registry endpoints.
When running scripts via Yarn Classic (such as yarn ng update), Yarn automatically injects npm_config_registry=https://registry.yarnpkg.com into the child process environment. When the PackageManager abstraction spawns child CLI subprocesses (such as yarn info), those child processes inherit the injected registry environment variable. Because environment variables take highest precedence, this previously caused spawned subprocesses to ignore local .yarnrc files and query the public CDN mirror. Strip npm_config_registry and NPM_CONFIG_REGISTRY from the child process environment when running under Yarn so that spawned subprocesses correctly respect local repository registry settings.
50c1489 to
c5d973d
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |

Transition the update command's version resolver to utilize the registry methods from the PackageManager abstraction instead of directly querying the registry via pacote.
This introduces a cached RegistryClient wrapper that retrieves package metadata and manifests on-demand. Update resolution helper functions are updated to be asynchronous to support the lazy-loading of registry documents.
Fixes #33119 (Honors minimum-release-age and supply-chain policies)
Fixes #27163 (Enforces project-scoped .npmrc / .yarnrc registry settings)
Fixes #26505 (Yarn Plug'n'Play compatibility)
Fixes #28834 (Gracefully handles private/unpublished packages via local package info)