Skip to content

Commit 6cdfcbc

Browse files
committed
refactor(@angular/cli): transition update command to use PackageManager 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.
1 parent 0130da9 commit 6cdfcbc

7 files changed

Lines changed: 537 additions & 462 deletions

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,16 @@
8888
"@types/node": "^22.12.0",
8989
"@types/npm-package-arg": "^6.1.0",
9090
"@types/pacote": "^11.1.3",
91+
"pacote": "21.5.0",
9192
"@types/picomatch": "^4.0.0",
9293
"@types/progress": "^2.0.3",
9394
"@types/semver": "^7.3.12",
9495
"@types/watchpack": "^2.4.4",
9596
"@types/yargs": "^17.0.20",
9697
"@types/yargs-parser": "^21.0.0",
9798
"@types/yarnpkg__lockfile": "^1.1.5",
99+
"@yarnpkg/lockfile": "1.1.0",
100+
"ini": "7.0.0",
98101
"@typescript-eslint/eslint-plugin": "8.60.1",
99102
"@typescript-eslint/parser": "8.60.1",
100103
"ajv": "8.20.0",

packages/angular/cli/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,10 @@ ts_project(
6161
":node_modules/@inquirer/prompts",
6262
":node_modules/@listr2/prompt-adapter-inquirer",
6363
":node_modules/@modelcontextprotocol/sdk",
64-
":node_modules/@yarnpkg/lockfile",
6564
":node_modules/algoliasearch",
66-
":node_modules/ini",
6765
":node_modules/jsonc-parser",
6866
":node_modules/listr2",
6967
":node_modules/npm-package-arg",
70-
":node_modules/pacote",
7168
":node_modules/parse5-html-rewriting-stream",
7269
":node_modules/yargs",
7370
":node_modules/zod",
@@ -79,6 +76,9 @@ ts_project(
7976
"//:node_modules/@types/semver",
8077
"//:node_modules/@types/yargs",
8178
"//:node_modules/@types/yarnpkg__lockfile",
79+
"//:node_modules/@yarnpkg/lockfile",
80+
"//:node_modules/ini",
81+
"//:node_modules/pacote",
8282
"//:node_modules/semver",
8383
"//:node_modules/typescript",
8484
],

packages/angular/cli/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
"@listr2/prompt-adapter-inquirer": "4.2.4",
2020
"@modelcontextprotocol/sdk": "1.29.0",
2121
"@schematics/angular": "workspace:0.0.0-PLACEHOLDER",
22-
"@yarnpkg/lockfile": "1.1.0",
2322
"algoliasearch": "5.53.0",
24-
"ini": "7.0.0",
2523
"jsonc-parser": "3.3.1",
2624
"listr2": "10.2.1",
2725
"npm-package-arg": "14.0.0",
28-
"pacote": "21.5.0",
2926
"parse5-html-rewriting-stream": "8.0.1",
3027
"semver": "7.8.1",
3128
"yargs": "18.0.0",

packages/angular/cli/src/commands/update/cli.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,16 @@ export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs
254254
packages: [],
255255
workspaceRoot: this.context.root,
256256
},
257+
packageManager,
257258
logger,
258259
);
259260

260-
printUpdateUsageMessage(plan.packageInfoMap, logger, options.next);
261+
await printUpdateUsageMessage(
262+
plan.packageInfoMap,
263+
plan.registryClient,
264+
logger,
265+
options.next,
266+
);
261267

262268
return 0;
263269
} catch (error) {
@@ -525,6 +531,7 @@ export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs
525531
verbose: options.verbose,
526532
workspaceRoot: this.context.root,
527533
},
534+
packageManager,
528535
logger,
529536
);
530537
} catch (error) {

0 commit comments

Comments
 (0)