@angular/cli 21.0.0-next.1 → 21.0.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/lib/cli/index.js +1 -0
  2. package/lib/cli/index.js.map +1 -0
  3. package/lib/code-examples.db +0 -0
  4. package/lib/config/schema.json +272 -46
  5. package/lib/config/workspace-schema.d.ts +55 -0
  6. package/lib/config/workspace-schema.js +22 -1
  7. package/lib/config/workspace-schema.js.map +1 -0
  8. package/lib/init.js +1 -0
  9. package/lib/init.js.map +1 -0
  10. package/package.json +24 -23
  11. package/src/analytics/analytics-collector.js +1 -0
  12. package/src/analytics/analytics-collector.js.map +1 -0
  13. package/src/analytics/analytics-parameters.js +1 -0
  14. package/src/analytics/analytics-parameters.js.map +1 -0
  15. package/src/analytics/analytics.js +1 -0
  16. package/src/analytics/analytics.js.map +1 -0
  17. package/src/command-builder/architect-base-command-module.js +1 -0
  18. package/src/command-builder/architect-base-command-module.js.map +1 -0
  19. package/src/command-builder/architect-command-module.js +21 -7
  20. package/src/command-builder/architect-command-module.js.map +1 -0
  21. package/src/command-builder/command-module.js +1 -0
  22. package/src/command-builder/command-module.js.map +1 -0
  23. package/src/command-builder/command-runner.js +2 -2
  24. package/src/command-builder/command-runner.js.map +1 -0
  25. package/src/command-builder/schematics-command-module.js +1 -0
  26. package/src/command-builder/schematics-command-module.js.map +1 -0
  27. package/src/command-builder/utilities/command.js +1 -0
  28. package/src/command-builder/utilities/command.js.map +1 -0
  29. package/src/command-builder/utilities/json-help.js +1 -0
  30. package/src/command-builder/utilities/json-help.js.map +1 -0
  31. package/src/command-builder/utilities/json-schema.d.ts +13 -1
  32. package/src/command-builder/utilities/json-schema.js +180 -100
  33. package/src/command-builder/utilities/json-schema.js.map +1 -0
  34. package/src/command-builder/utilities/normalize-options-middleware.js +1 -0
  35. package/src/command-builder/utilities/normalize-options-middleware.js.map +1 -0
  36. package/src/command-builder/utilities/schematic-engine-host.js +1 -0
  37. package/src/command-builder/utilities/schematic-engine-host.js.map +1 -0
  38. package/src/command-builder/utilities/schematic-workflow.js +1 -0
  39. package/src/command-builder/utilities/schematic-workflow.js.map +1 -0
  40. package/src/commands/add/cli.js +66 -26
  41. package/src/commands/add/cli.js.map +1 -0
  42. package/src/commands/analytics/cli.js +1 -0
  43. package/src/commands/analytics/cli.js.map +1 -0
  44. package/src/commands/analytics/info/cli.js +1 -0
  45. package/src/commands/analytics/info/cli.js.map +1 -0
  46. package/src/commands/analytics/settings/cli.js +1 -0
  47. package/src/commands/analytics/settings/cli.js.map +1 -0
  48. package/src/commands/build/cli.js +1 -0
  49. package/src/commands/build/cli.js.map +1 -0
  50. package/src/commands/cache/clean/cli.js +1 -0
  51. package/src/commands/cache/clean/cli.js.map +1 -0
  52. package/src/commands/cache/cli.js +1 -0
  53. package/src/commands/cache/cli.js.map +1 -0
  54. package/src/commands/cache/info/cli.js +36 -11
  55. package/src/commands/cache/info/cli.js.map +1 -0
  56. package/src/commands/cache/settings/cli.js +1 -0
  57. package/src/commands/cache/settings/cli.js.map +1 -0
  58. package/src/commands/cache/utilities.js +1 -0
  59. package/src/commands/cache/utilities.js.map +1 -0
  60. package/src/commands/command-config.js +1 -0
  61. package/src/commands/command-config.js.map +1 -0
  62. package/src/commands/completion/cli.js +1 -0
  63. package/src/commands/completion/cli.js.map +1 -0
  64. package/src/commands/config/cli.js +1 -0
  65. package/src/commands/config/cli.js.map +1 -0
  66. package/src/commands/deploy/cli.js +1 -0
  67. package/src/commands/deploy/cli.js.map +1 -0
  68. package/src/commands/e2e/cli.js +1 -0
  69. package/src/commands/e2e/cli.js.map +1 -0
  70. package/src/commands/extract-i18n/cli.js +1 -0
  71. package/src/commands/extract-i18n/cli.js.map +1 -0
  72. package/src/commands/generate/cli.js +1 -0
  73. package/src/commands/generate/cli.js.map +1 -0
  74. package/src/commands/lint/cli.js +1 -0
  75. package/src/commands/lint/cli.js.map +1 -0
  76. package/src/commands/make-this-awesome/cli.js +1 -0
  77. package/src/commands/make-this-awesome/cli.js.map +1 -0
  78. package/src/commands/mcp/cli.js +1 -0
  79. package/src/commands/mcp/cli.js.map +1 -0
  80. package/src/commands/mcp/constants.d.ts +1 -1
  81. package/src/commands/mcp/constants.js +2 -1
  82. package/src/commands/mcp/constants.js.map +1 -0
  83. package/src/commands/mcp/mcp-server.d.ts +3 -3
  84. package/src/commands/mcp/mcp-server.js +40 -4
  85. package/src/commands/mcp/mcp-server.js.map +1 -0
  86. package/src/commands/mcp/resources/ai-tutor.md +627 -0
  87. package/src/commands/mcp/resources/instructions.js +1 -0
  88. package/src/commands/mcp/resources/instructions.js.map +1 -0
  89. package/src/commands/mcp/tools/ai-tutor.d.ts +8 -0
  90. package/src/commands/mcp/tools/ai-tutor.js +62 -0
  91. package/src/commands/mcp/tools/ai-tutor.js.map +1 -0
  92. package/src/commands/mcp/tools/best-practices.d.ts +4 -1
  93. package/src/commands/mcp/tools/best-practices.js +167 -22
  94. package/src/commands/mcp/tools/best-practices.js.map +1 -0
  95. package/src/commands/mcp/tools/doc-search.d.ts +20 -1
  96. package/src/commands/mcp/tools/doc-search.js +186 -67
  97. package/src/commands/mcp/tools/doc-search.js.map +1 -0
  98. package/src/commands/mcp/tools/examples.d.ts +35 -1
  99. package/src/commands/mcp/tools/examples.js +414 -56
  100. package/src/commands/mcp/tools/examples.js.map +1 -0
  101. package/src/commands/mcp/tools/modernize.js +29 -17
  102. package/src/commands/mcp/tools/modernize.js.map +1 -0
  103. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.d.ts +17 -0
  104. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.js +62 -0
  105. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.js.map +1 -0
  106. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_single_file.d.ts +12 -0
  107. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_single_file.js +73 -0
  108. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_single_file.js.map +1 -0
  109. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.d.ts +11 -0
  110. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js +106 -0
  111. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js.map +1 -0
  112. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +15 -0
  113. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +238 -0
  114. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js.map +1 -0
  115. package/src/commands/mcp/tools/onpush-zoneless-migration/send_debug_message.d.ts +10 -0
  116. package/src/commands/mcp/tools/onpush-zoneless-migration/send_debug_message.js +20 -0
  117. package/src/commands/mcp/tools/onpush-zoneless-migration/send_debug_message.js.map +1 -0
  118. package/src/commands/mcp/tools/onpush-zoneless-migration/ts_utils.d.ts +36 -0
  119. package/src/commands/mcp/tools/onpush-zoneless-migration/ts_utils.js +136 -0
  120. package/src/commands/mcp/tools/onpush-zoneless-migration/ts_utils.js.map +1 -0
  121. package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +13 -0
  122. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +10 -0
  123. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js.map +1 -0
  124. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +14 -0
  125. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +228 -0
  126. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -0
  127. package/src/commands/mcp/tools/projects.d.ts +75 -16
  128. package/src/commands/mcp/tools/projects.js +427 -30
  129. package/src/commands/mcp/tools/projects.js.map +1 -0
  130. package/src/commands/mcp/tools/tool-registry.d.ts +2 -1
  131. package/src/commands/mcp/tools/tool-registry.js +4 -2
  132. package/src/commands/mcp/tools/tool-registry.js.map +1 -0
  133. package/src/commands/new/cli.js +2 -0
  134. package/src/commands/new/cli.js.map +1 -0
  135. package/src/commands/run/cli.js +1 -0
  136. package/src/commands/run/cli.js.map +1 -0
  137. package/src/commands/serve/cli.js +1 -0
  138. package/src/commands/serve/cli.js.map +1 -0
  139. package/src/commands/test/cli.js +1 -0
  140. package/src/commands/test/cli.js.map +1 -0
  141. package/src/commands/update/cli.js +1 -0
  142. package/src/commands/update/cli.js.map +1 -0
  143. package/src/commands/update/schematic/index.js +1 -0
  144. package/src/commands/update/schematic/index.js.map +1 -0
  145. package/src/commands/update/schematic/schema.js +1 -0
  146. package/src/commands/update/schematic/schema.js.map +1 -0
  147. package/src/commands/version/cli.d.ts +3 -7
  148. package/src/commands/version/cli.js +50 -49
  149. package/src/commands/version/cli.js.map +1 -0
  150. package/src/commands/version/version-info.d.ts +28 -10
  151. package/src/commands/version/version-info.js +34 -50
  152. package/src/commands/version/version-info.js.map +1 -0
  153. package/src/package-managers/discovery.d.ts +23 -0
  154. package/src/package-managers/discovery.js +110 -0
  155. package/src/package-managers/discovery.js.map +1 -0
  156. package/src/package-managers/error.d.ts +31 -0
  157. package/src/package-managers/error.js +41 -0
  158. package/src/package-managers/error.js.map +1 -0
  159. package/src/package-managers/factory.d.ts +25 -0
  160. package/src/package-managers/factory.js +123 -0
  161. package/src/package-managers/factory.js.map +1 -0
  162. package/src/package-managers/host.d.ts +64 -0
  163. package/src/package-managers/host.js +69 -0
  164. package/src/package-managers/host.js.map +1 -0
  165. package/src/package-managers/index.d.ts +12 -0
  166. package/src/package-managers/index.js +15 -0
  167. package/src/package-managers/index.js.map +1 -0
  168. package/src/package-managers/logger.d.ts +27 -0
  169. package/src/package-managers/logger.js +10 -0
  170. package/src/package-managers/logger.js.map +1 -0
  171. package/src/package-managers/package-manager-descriptor.d.ts +204 -0
  172. package/src/package-managers/package-manager-descriptor.js +147 -0
  173. package/src/package-managers/package-manager-descriptor.js.map +1 -0
  174. package/src/package-managers/package-manager.d.ts +144 -0
  175. package/src/package-managers/package-manager.js +304 -0
  176. package/src/package-managers/package-manager.js.map +1 -0
  177. package/src/package-managers/package-metadata.d.ts +87 -0
  178. package/src/package-managers/package-metadata.js +10 -0
  179. package/src/package-managers/package-metadata.js.map +1 -0
  180. package/src/package-managers/package-tree.d.ts +23 -0
  181. package/src/package-managers/package-tree.js +10 -0
  182. package/src/package-managers/package-tree.js.map +1 -0
  183. package/src/package-managers/parsers.d.ts +92 -0
  184. package/src/package-managers/parsers.js +234 -0
  185. package/src/package-managers/parsers.js.map +1 -0
  186. package/src/package-managers/testing/mock-host.d.ts +26 -0
  187. package/src/package-managers/testing/mock-host.js +53 -0
  188. package/src/package-managers/testing/mock-host.js.map +1 -0
  189. package/src/utilities/color.js +1 -0
  190. package/src/utilities/color.js.map +1 -0
  191. package/src/utilities/completion.js +1 -0
  192. package/src/utilities/completion.js.map +1 -0
  193. package/src/utilities/config.js +1 -0
  194. package/src/utilities/config.js.map +1 -0
  195. package/src/utilities/environment-options.js +1 -0
  196. package/src/utilities/environment-options.js.map +1 -0
  197. package/src/utilities/eol.js +1 -0
  198. package/src/utilities/eol.js.map +1 -0
  199. package/src/utilities/error.js +1 -0
  200. package/src/utilities/error.js.map +1 -0
  201. package/src/utilities/find-up.js +1 -0
  202. package/src/utilities/find-up.js.map +1 -0
  203. package/src/utilities/json-file.js +1 -0
  204. package/src/utilities/json-file.js.map +1 -0
  205. package/src/utilities/log-file.js +1 -0
  206. package/src/utilities/log-file.js.map +1 -0
  207. package/src/utilities/memoize.js +1 -0
  208. package/src/utilities/memoize.js.map +1 -0
  209. package/src/utilities/package-manager.d.ts +12 -0
  210. package/src/utilities/package-manager.js +52 -35
  211. package/src/utilities/package-manager.js.map +1 -0
  212. package/src/utilities/package-metadata.js +1 -0
  213. package/src/utilities/package-metadata.js.map +1 -0
  214. package/src/utilities/package-tree.js +1 -0
  215. package/src/utilities/package-tree.js.map +1 -0
  216. package/src/utilities/project.js +1 -0
  217. package/src/utilities/project.js.map +1 -0
  218. package/src/utilities/prompt.js +1 -0
  219. package/src/utilities/prompt.js.map +1 -0
  220. package/src/utilities/tty.js +1 -0
  221. package/src/utilities/tty.js.map +1 -0
  222. package/src/utilities/version.js +2 -1
  223. package/src/utilities/version.js.map +1 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ /**
9
+ * @fileoverview This file defines a custom error class for the package manager
10
+ * abstraction. This allows for structured error handling and provides consumers
11
+ * with detailed information about the process failure.
12
+ */
13
+ /**
14
+ * A custom error class for package manager-related errors.
15
+ *
16
+ * This error class provides structured data about the failed process,
17
+ * including stdout, stderr, and the exit code.
18
+ */
19
+ export declare class PackageManagerError extends Error {
20
+ readonly stdout: string;
21
+ readonly stderr: string;
22
+ readonly exitCode: number | null;
23
+ /**
24
+ * Creates a new `PackageManagerError` instance.
25
+ * @param message The error message.
26
+ * @param stdout The standard output of the failed process.
27
+ * @param stderr The standard error of the failed process.
28
+ * @param exitCode The exit code of the failed process.
29
+ */
30
+ constructor(message: string, stdout: string, stderr: string, exitCode: number | null);
31
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.PackageManagerError = void 0;
11
+ /**
12
+ * @fileoverview This file defines a custom error class for the package manager
13
+ * abstraction. This allows for structured error handling and provides consumers
14
+ * with detailed information about the process failure.
15
+ */
16
+ /**
17
+ * A custom error class for package manager-related errors.
18
+ *
19
+ * This error class provides structured data about the failed process,
20
+ * including stdout, stderr, and the exit code.
21
+ */
22
+ class PackageManagerError extends Error {
23
+ stdout;
24
+ stderr;
25
+ exitCode;
26
+ /**
27
+ * Creates a new `PackageManagerError` instance.
28
+ * @param message The error message.
29
+ * @param stdout The standard output of the failed process.
30
+ * @param stderr The standard error of the failed process.
31
+ * @param exitCode The exit code of the failed process.
32
+ */
33
+ constructor(message, stdout, stderr, exitCode) {
34
+ super(message);
35
+ this.stdout = stdout;
36
+ this.stderr = stderr;
37
+ this.exitCode = exitCode;
38
+ }
39
+ }
40
+ exports.PackageManagerError = PackageManagerError;
41
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["error.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,KAAK;IAU1B;IACA;IACA;IAXlB;;;;;;OAMG;IACH,YACE,OAAe,EACC,MAAc,EACd,MAAc,EACd,QAAuB;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAe;IAGzC,CAAC;CACF;AAhBD,kDAgBC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Logger } from './logger';
9
+ import { PackageManager } from './package-manager';
10
+ import { PackageManagerName } from './package-manager-descriptor';
11
+ /**
12
+ * Creates a new `PackageManager` instance for a given project.
13
+ *
14
+ * This function is the main entry point for the package manager abstraction.
15
+ * It will determine, verify, and instantiate the correct package manager.
16
+ *
17
+ * @param options An object containing the options for creating the package manager.
18
+ * @returns A promise that resolves to a new `PackageManager` instance.
19
+ */
20
+ export declare function createPackageManager(options: {
21
+ cwd: string;
22
+ configuredPackageManager?: PackageManagerName;
23
+ logger?: Logger;
24
+ dryRun?: boolean;
25
+ }): Promise<PackageManager>;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.createPackageManager = createPackageManager;
11
+ const semver_1 = require("semver");
12
+ const discovery_1 = require("./discovery");
13
+ const host_1 = require("./host");
14
+ const package_manager_1 = require("./package-manager");
15
+ const package_manager_descriptor_1 = require("./package-manager-descriptor");
16
+ /**
17
+ * The default package manager to use when none is discovered or configured.
18
+ */
19
+ const DEFAULT_PACKAGE_MANAGER = 'npm';
20
+ /**
21
+ * Gets the version of yarn installed on the system.
22
+ * @param host A `Host` instance for running commands.
23
+ * @param cwd The absolute path to the working directory.
24
+ * @param logger An optional logger instance.
25
+ * @returns A promise that resolves to the yarn version string, or null if yarn is not installed.
26
+ */
27
+ async function getYarnVersion(host, cwd, logger) {
28
+ logger?.debug(`Getting yarn version...`);
29
+ try {
30
+ const { stdout } = await host.runCommand('yarn', ['--version'], { cwd });
31
+ const version = stdout.trim();
32
+ logger?.debug(`Yarn version is '${version}'.`);
33
+ return version;
34
+ }
35
+ catch (e) {
36
+ logger?.debug('Failed to get yarn version.');
37
+ return null;
38
+ }
39
+ }
40
+ /**
41
+ * Determines the package manager to use for a given project.
42
+ *
43
+ * This function will determine the package manager by checking for a configured
44
+ * package manager, discovering the package manager from lockfiles, or falling
45
+ * back to a default. It also handles differentiation between yarn classic and modern.
46
+ *
47
+ * @param host A `Host` instance for interacting with the file system and running commands.
48
+ * @param cwd The directory to start the search from.
49
+ * @param configured An optional, explicitly configured package manager.
50
+ * @param logger An optional logger instance.
51
+ * @returns A promise that resolves to an object containing the name and source of the package manager.
52
+ */
53
+ async function determinePackageManager(host, cwd, configured, logger, dryRun) {
54
+ let name;
55
+ let source;
56
+ if (configured) {
57
+ name = configured;
58
+ source = 'configured';
59
+ logger?.debug(`Using configured package manager: '${name}'.`);
60
+ }
61
+ else {
62
+ const discovered = await (0, discovery_1.discover)(host, cwd, logger);
63
+ if (discovered) {
64
+ name = discovered;
65
+ source = 'discovered';
66
+ logger?.debug(`Discovered package manager: '${name}'.`);
67
+ }
68
+ else {
69
+ name = DEFAULT_PACKAGE_MANAGER;
70
+ source = 'default';
71
+ logger?.debug(`No lockfile found. Using default package manager: '${DEFAULT_PACKAGE_MANAGER}'.`);
72
+ }
73
+ }
74
+ if (name === 'yarn' && !dryRun) {
75
+ const version = await getYarnVersion(host, cwd, logger);
76
+ if (version && (0, semver_1.major)(version) < 2) {
77
+ name = 'yarn-classic';
78
+ logger?.debug(`Detected yarn classic. Using 'yarn-classic'.`);
79
+ }
80
+ }
81
+ else if (name === 'yarn') {
82
+ logger?.debug('Skipping yarn version check due to dry run. Assuming modern yarn.');
83
+ }
84
+ return { name, source };
85
+ }
86
+ /**
87
+ * Creates a new `PackageManager` instance for a given project.
88
+ *
89
+ * This function is the main entry point for the package manager abstraction.
90
+ * It will determine, verify, and instantiate the correct package manager.
91
+ *
92
+ * @param options An object containing the options for creating the package manager.
93
+ * @returns A promise that resolves to a new `PackageManager` instance.
94
+ */
95
+ async function createPackageManager(options) {
96
+ const { cwd, configuredPackageManager, logger, dryRun } = options;
97
+ const host = host_1.NodeJS_HOST;
98
+ const { name, source } = await determinePackageManager(host, cwd, configuredPackageManager, logger, dryRun);
99
+ const descriptor = package_manager_descriptor_1.SUPPORTED_PACKAGE_MANAGERS[name];
100
+ if (!descriptor) {
101
+ throw new Error(`Unsupported package manager: "${name}"`);
102
+ }
103
+ const packageManager = new package_manager_1.PackageManager(host, cwd, descriptor, { dryRun, logger });
104
+ // Do not verify if the package manager is installed during a dry run.
105
+ if (!dryRun) {
106
+ try {
107
+ await packageManager.getVersion();
108
+ }
109
+ catch {
110
+ if (source === 'default') {
111
+ throw new Error(`'${DEFAULT_PACKAGE_MANAGER}' was selected as the default package manager, but it is not installed or` +
112
+ ` cannot be found in the PATH. Please install '${DEFAULT_PACKAGE_MANAGER}' to continue.`);
113
+ }
114
+ else {
115
+ throw new Error(`The project is configured to use '${name}', but it is not installed or cannot be` +
116
+ ` found in the PATH. Please install '${name}' to continue.`);
117
+ }
118
+ }
119
+ }
120
+ logger?.debug(`Successfully created PackageManager for '${name}'.`);
121
+ return packageManager;
122
+ }
123
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["factory.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAqGH,oDA8CC;AAjJD,mCAA+B;AAC/B,2CAAuC;AACvC,iCAA2C;AAE3C,uDAAmD;AACnD,6EAA8F;AAE9F;;GAEG;AACH,MAAM,uBAAuB,GAAuB,KAAK,CAAC;AAE1D;;;;;;GAMG;AACH,KAAK,UAAU,cAAc,CAAC,IAAU,EAAE,GAAW,EAAE,MAAe;IACpE,MAAM,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAEzC,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,EAAE,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAC;QAE/C,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,KAAK,UAAU,uBAAuB,CACpC,IAAU,EACV,GAAW,EACX,UAA+B,EAC/B,MAAe,EACf,MAAgB;IAEhB,IAAI,IAAwB,CAAC;IAC7B,IAAI,MAA+C,CAAC;IAEpD,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,GAAG,UAAU,CAAC;QAClB,MAAM,GAAG,YAAY,CAAC;QACtB,MAAM,EAAE,KAAK,CAAC,sCAAsC,IAAI,IAAI,CAAC,CAAC;IAChE,CAAC;SAAM,CAAC;QACN,MAAM,UAAU,GAAG,MAAM,IAAA,oBAAQ,EAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACrD,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,GAAG,UAAU,CAAC;YAClB,MAAM,GAAG,YAAY,CAAC;YACtB,MAAM,EAAE,KAAK,CAAC,gCAAgC,IAAI,IAAI,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,uBAAuB,CAAC;YAC/B,MAAM,GAAG,SAAS,CAAC;YACnB,MAAM,EAAE,KAAK,CACX,sDAAsD,uBAAuB,IAAI,CAClF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,OAAO,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,IAAI,GAAG,cAAc,CAAC;YACtB,MAAM,EAAE,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,MAAM,EAAE,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,oBAAoB,CAAC,OAK1C;IACC,MAAM,EAAE,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,IAAI,GAAG,kBAAW,CAAC;IAEzB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,uBAAuB,CACpD,IAAI,EACJ,GAAG,EACH,wBAAwB,EACxB,MAAM,EACN,MAAM,CACP,CAAC;IAEF,MAAM,UAAU,GAAG,uDAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAErF,sEAAsE;IACtE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,IAAI,CAAC;YACH,MAAM,cAAc,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CACb,IAAI,uBAAuB,2EAA2E;oBACpG,iDAAiD,uBAAuB,gBAAgB,CAC3F,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,yCAAyC;oBAChF,uCAAuC,IAAI,gBAAgB,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,EAAE,KAAK,CAAC,4CAA4C,IAAI,IAAI,CAAC,CAAC;IAEpE,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Stats } from 'node:fs';
9
+ /**
10
+ * An abstraction layer for side-effectful operations.
11
+ */
12
+ export interface Host {
13
+ /**
14
+ * Gets the stats of a file or directory.
15
+ * @param path The path to the file or directory.
16
+ * @returns A promise that resolves to the stats.
17
+ */
18
+ stat(path: string): Promise<Stats>;
19
+ /**
20
+ * Reads the contents of a directory.
21
+ * @param path The path to the directory.
22
+ * @returns A promise that resolves to an array of file and directory names.
23
+ */
24
+ readdir(path: string): Promise<string[]>;
25
+ /**
26
+ * Creates a new, unique temporary directory.
27
+ * @returns A promise that resolves to the absolute path of the created directory.
28
+ */
29
+ createTempDirectory(): Promise<string>;
30
+ /**
31
+ * Deletes a directory recursively.
32
+ * @param path The path to the directory to delete.
33
+ * @returns A promise that resolves when the deletion is complete.
34
+ */
35
+ deleteDirectory(path: string): Promise<void>;
36
+ /**
37
+ * Writes content to a file.
38
+ * @param path The path to the file.
39
+ * @param content The content to write.
40
+ * @returns A promise that resolves when the write is complete.
41
+ */
42
+ writeFile(path: string, content: string): Promise<void>;
43
+ /**
44
+ * Spawns a child process and returns a promise that resolves with the process's
45
+ * output or rejects with a structured error.
46
+ * @param command The command to run.
47
+ * @param args The arguments to pass to the command.
48
+ * @param options Options for the child process.
49
+ * @returns A promise that resolves with the standard output and standard error of the command.
50
+ */
51
+ runCommand(command: string, args: readonly string[], options?: {
52
+ timeout?: number;
53
+ stdio?: 'pipe' | 'ignore';
54
+ cwd?: string;
55
+ env?: Record<string, string>;
56
+ }): Promise<{
57
+ stdout: string;
58
+ stderr: string;
59
+ }>;
60
+ }
61
+ /**
62
+ * A concrete implementation of the `Host` interface that uses the Node.js APIs.
63
+ */
64
+ export declare const NodeJS_HOST: Host;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NodeJS_HOST = void 0;
11
+ /**
12
+ * @fileoverview
13
+ * This file defines an abstraction layer for side-effectful operations, such as
14
+ * file system access and command execution. This allows for easier testing by
15
+ * enabling the injection of mock or test-specific implementations.
16
+ */
17
+ const node_child_process_1 = require("node:child_process");
18
+ const promises_1 = require("node:fs/promises");
19
+ const node_os_1 = require("node:os");
20
+ const node_path_1 = require("node:path");
21
+ const error_1 = require("./error");
22
+ /**
23
+ * A concrete implementation of the `Host` interface that uses the Node.js APIs.
24
+ */
25
+ exports.NodeJS_HOST = {
26
+ stat: promises_1.stat,
27
+ readdir: promises_1.readdir,
28
+ writeFile: promises_1.writeFile,
29
+ createTempDirectory: () => (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'angular-cli-')),
30
+ deleteDirectory: (path) => (0, promises_1.rm)(path, { recursive: true, force: true }),
31
+ runCommand: async (command, args, options = {}) => {
32
+ const signal = options.timeout ? AbortSignal.timeout(options.timeout) : undefined;
33
+ return new Promise((resolve, reject) => {
34
+ const childProcess = (0, node_child_process_1.spawn)(command, args, {
35
+ shell: false,
36
+ stdio: options.stdio ?? 'pipe',
37
+ signal,
38
+ cwd: options.cwd,
39
+ env: {
40
+ ...process.env,
41
+ ...options.env,
42
+ },
43
+ });
44
+ let stdout = '';
45
+ childProcess.stdout?.on('data', (data) => (stdout += data.toString()));
46
+ let stderr = '';
47
+ childProcess.stderr?.on('data', (data) => (stderr += data.toString()));
48
+ childProcess.on('close', (code) => {
49
+ if (code === 0) {
50
+ resolve({ stdout, stderr });
51
+ }
52
+ else {
53
+ const message = `Process exited with code ${code}.`;
54
+ reject(new error_1.PackageManagerError(message, stdout, stderr, code));
55
+ }
56
+ });
57
+ childProcess.on('error', (err) => {
58
+ if (err.name === 'AbortError') {
59
+ const message = `Process timed out.`;
60
+ reject(new error_1.PackageManagerError(message, stdout, stderr, null));
61
+ return;
62
+ }
63
+ const message = `Process failed with error: ${err.message}`;
64
+ reject(new error_1.PackageManagerError(message, stdout, stderr, null));
65
+ });
66
+ });
67
+ },
68
+ };
69
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;GAKG;AAEH,2DAA2C;AAE3C,+CAAyE;AACzE,qCAAiC;AACjC,yCAAiC;AACjC,mCAA8C;AA6D9C;;GAEG;AACU,QAAA,WAAW,GAAS;IAC/B,IAAI,EAAJ,eAAI;IACJ,OAAO,EAAP,kBAAO;IACP,SAAS,EAAT,oBAAS;IACT,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,IAAA,gBAAI,EAAC,IAAA,gBAAM,GAAE,EAAE,cAAc,CAAC,CAAC;IAClE,eAAe,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,aAAE,EAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC7E,UAAU,EAAE,KAAK,EACf,OAAe,EACf,IAAuB,EACvB,UAKI,EAAE,EACuC,EAAE;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAElF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,YAAY,GAAG,IAAA,0BAAK,EAAC,OAAO,EAAE,IAAI,EAAE;gBACxC,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,MAAM;gBAC9B,MAAM;gBACN,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,GAAG,EAAE;oBACH,GAAG,OAAO,CAAC,GAAG;oBACd,GAAG,OAAO,CAAC,GAAG;iBACf;aACF,CAAC,CAAC;YAEH,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEvE,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEvE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC9B,CAAC;qBAAM,CAAC;oBACN,MAAM,OAAO,GAAG,4BAA4B,IAAI,GAAG,CAAC;oBACpD,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC9B,MAAM,OAAO,GAAG,oBAAoB,CAAC;oBACrC,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;oBAE/D,OAAO;gBACT,CAAC;gBACD,MAAM,OAAO,GAAG,8BAA8B,GAAG,CAAC,OAAO,EAAE,CAAC;gBAC5D,MAAM,CAAC,IAAI,2BAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ export { createPackageManager } from './factory';
9
+ export type { PackageManagerName } from './package-manager-descriptor';
10
+ export { PackageManager } from './package-manager';
11
+ export type * from './package-metadata';
12
+ export type { InstalledPackage } from './package-tree';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.PackageManager = exports.createPackageManager = void 0;
11
+ var factory_1 = require("./factory");
12
+ Object.defineProperty(exports, "createPackageManager", { enumerable: true, get: function () { return factory_1.createPackageManager; } });
13
+ var package_manager_1 = require("./package-manager");
14
+ Object.defineProperty(exports, "PackageManager", { enumerable: true, get: function () { return package_manager_1.PackageManager; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qCAAiD;AAAxC,+GAAA,oBAAoB,OAAA;AAE7B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ /**
9
+ * @fileoverview This file defines a basic logger interface that is used by
10
+ * the package manager abstraction. This allows the abstraction to be decoupled
11
+ * from any specific logging implementation.
12
+ */
13
+ /**
14
+ * A basic logger interface for the package manager abstraction.
15
+ */
16
+ export interface Logger {
17
+ /**
18
+ * Logs a debug message.
19
+ * @param message The message to log.
20
+ */
21
+ debug(message: string): void;
22
+ /**
23
+ * Logs an informational message.
24
+ * @param message The message to log.
25
+ */
26
+ info(message: string): void;
27
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["logger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ /**
9
+ * @fileoverview This file defines the data structures and configuration for
10
+ * supported package managers. It is the single source of truth for all
11
+ * package-manager-specific commands, flags, and output parsing.
12
+ */
13
+ import { Logger } from './logger';
14
+ import { PackageManifest, PackageMetadata } from './package-metadata';
15
+ import { InstalledPackage } from './package-tree';
16
+ import { parseNpmLikeDependencies, parseNpmLikeManifest, parseNpmLikeMetadata, parseYarnClassicDependencies, parseYarnLegacyManifest, parseYarnModernDependencies } from './parsers';
17
+ /**
18
+ * An interface that describes the commands and properties of a package manager.
19
+ */
20
+ export interface PackageManagerDescriptor {
21
+ /** The binary executable for the package manager. */
22
+ readonly binary: string;
23
+ /** The lockfile names used by the package manager. */
24
+ readonly lockfiles: readonly string[];
25
+ /** The command to add a package. */
26
+ readonly addCommand: string;
27
+ /** The command to install all dependencies. */
28
+ readonly installCommand: readonly string[];
29
+ /** The flag to force a clean installation. */
30
+ readonly forceFlag: string;
31
+ /** The flag to save a package with an exact version. */
32
+ readonly saveExactFlag: string;
33
+ /** The flag to save a package with a tilde version range. */
34
+ readonly saveTildeFlag: string;
35
+ /** The flag to save a package as a dev dependency. */
36
+ readonly saveDevFlag: string;
37
+ /** The flag to prevent the lockfile from being updated. */
38
+ readonly noLockfileFlag: string;
39
+ /** The flag to prevent lifecycle scripts from being executed. */
40
+ readonly ignoreScriptsFlag: string;
41
+ /** A function that returns the arguments and environment variables to use a custom registry. */
42
+ readonly getRegistryOptions?: (registry: string) => {
43
+ args?: string[];
44
+ env?: Record<string, string>;
45
+ };
46
+ /** The command to get the package manager's version. */
47
+ readonly versionCommand: readonly string[];
48
+ /** The command to list all installed dependencies. */
49
+ readonly listDependenciesCommand: readonly string[];
50
+ /** The command to fetch the registry manifest of a package. */
51
+ readonly getManifestCommand: readonly string[];
52
+ /** A function that formats the arguments for field-filtered registry views. */
53
+ readonly viewCommandFieldArgFormatter?: (fields: readonly string[]) => string[];
54
+ /** A collection of functions to parse the output of specific commands. */
55
+ readonly outputParsers: {
56
+ /** A function to parse the output of `listDependenciesCommand`. */
57
+ listDependencies: (stdout: string, logger?: Logger) => Map<string, InstalledPackage>;
58
+ /** A function to parse the output of `getManifestCommand` for a specific version. */
59
+ getPackageManifest: (stdout: string, logger?: Logger) => PackageManifest | null;
60
+ /** A function to parse the output of `getManifestCommand` for the full package metadata. */
61
+ getRegistryMetadata: (stdout: string, logger?: Logger) => PackageMetadata | null;
62
+ };
63
+ }
64
+ /** A type that represents the name of a supported package manager. */
65
+ export type PackageManagerName = keyof typeof SUPPORTED_PACKAGE_MANAGERS;
66
+ /**
67
+ * A map of supported package managers to their descriptors.
68
+ * This is the single source of truth for all package-manager-specific
69
+ * configuration and behavior.
70
+ *
71
+ * Each descriptor is intentionally explicit and self-contained. This approach
72
+ * avoids inheritance or fallback logic between package managers, ensuring that
73
+ * the behavior for each one is clear, predictable, and easy to modify in
74
+ * isolation. For example, `yarn-classic` does not inherit any properties from
75
+ * the `yarn` descriptor; it is a complete and independent definition.
76
+ */
77
+ export declare const SUPPORTED_PACKAGE_MANAGERS: {
78
+ npm: {
79
+ binary: string;
80
+ lockfiles: string[];
81
+ addCommand: string;
82
+ installCommand: string[];
83
+ forceFlag: string;
84
+ saveExactFlag: string;
85
+ saveTildeFlag: string;
86
+ saveDevFlag: string;
87
+ noLockfileFlag: string;
88
+ ignoreScriptsFlag: string;
89
+ getRegistryOptions: (registry: string) => {
90
+ args: string[];
91
+ };
92
+ versionCommand: string[];
93
+ listDependenciesCommand: string[];
94
+ getManifestCommand: string[];
95
+ viewCommandFieldArgFormatter: (fields: readonly string[]) => string[];
96
+ outputParsers: {
97
+ listDependencies: typeof parseNpmLikeDependencies;
98
+ getPackageManifest: typeof parseNpmLikeManifest;
99
+ getRegistryMetadata: typeof parseNpmLikeMetadata;
100
+ };
101
+ };
102
+ yarn: {
103
+ binary: string;
104
+ lockfiles: string[];
105
+ addCommand: string;
106
+ installCommand: string[];
107
+ forceFlag: string;
108
+ saveExactFlag: string;
109
+ saveTildeFlag: string;
110
+ saveDevFlag: string;
111
+ noLockfileFlag: string;
112
+ ignoreScriptsFlag: string;
113
+ getRegistryOptions: (registry: string) => {
114
+ env: {
115
+ NPM_CONFIG_REGISTRY: string;
116
+ };
117
+ };
118
+ versionCommand: string[];
119
+ listDependenciesCommand: string[];
120
+ getManifestCommand: string[];
121
+ viewCommandFieldArgFormatter: (fields: readonly string[]) => string[];
122
+ outputParsers: {
123
+ listDependencies: typeof parseYarnModernDependencies;
124
+ getPackageManifest: typeof parseNpmLikeManifest;
125
+ getRegistryMetadata: typeof parseNpmLikeMetadata;
126
+ };
127
+ };
128
+ 'yarn-classic': {
129
+ binary: string;
130
+ lockfiles: never[];
131
+ addCommand: string;
132
+ installCommand: string[];
133
+ forceFlag: string;
134
+ saveExactFlag: string;
135
+ saveTildeFlag: string;
136
+ saveDevFlag: string;
137
+ noLockfileFlag: string;
138
+ ignoreScriptsFlag: string;
139
+ getRegistryOptions: (registry: string) => {
140
+ args: string[];
141
+ };
142
+ versionCommand: string[];
143
+ listDependenciesCommand: string[];
144
+ getManifestCommand: string[];
145
+ outputParsers: {
146
+ listDependencies: typeof parseYarnClassicDependencies;
147
+ getPackageManifest: typeof parseYarnLegacyManifest;
148
+ getRegistryMetadata: typeof parseNpmLikeMetadata;
149
+ };
150
+ };
151
+ pnpm: {
152
+ binary: string;
153
+ lockfiles: string[];
154
+ addCommand: string;
155
+ installCommand: string[];
156
+ forceFlag: string;
157
+ saveExactFlag: string;
158
+ saveTildeFlag: string;
159
+ saveDevFlag: string;
160
+ noLockfileFlag: string;
161
+ ignoreScriptsFlag: string;
162
+ getRegistryOptions: (registry: string) => {
163
+ args: string[];
164
+ };
165
+ versionCommand: string[];
166
+ listDependenciesCommand: string[];
167
+ getManifestCommand: string[];
168
+ viewCommandFieldArgFormatter: (fields: readonly string[]) => string[];
169
+ outputParsers: {
170
+ listDependencies: typeof parseNpmLikeDependencies;
171
+ getPackageManifest: typeof parseNpmLikeManifest;
172
+ getRegistryMetadata: typeof parseNpmLikeMetadata;
173
+ };
174
+ };
175
+ bun: {
176
+ binary: string;
177
+ lockfiles: string[];
178
+ addCommand: string;
179
+ installCommand: string[];
180
+ forceFlag: string;
181
+ saveExactFlag: string;
182
+ saveTildeFlag: string;
183
+ saveDevFlag: string;
184
+ noLockfileFlag: string;
185
+ ignoreScriptsFlag: string;
186
+ getRegistryOptions: (registry: string) => {
187
+ args: string[];
188
+ };
189
+ versionCommand: string[];
190
+ listDependenciesCommand: string[];
191
+ getManifestCommand: string[];
192
+ viewCommandFieldArgFormatter: (fields: readonly string[]) => string[];
193
+ outputParsers: {
194
+ listDependencies: typeof parseNpmLikeDependencies;
195
+ getPackageManifest: typeof parseNpmLikeManifest;
196
+ getRegistryMetadata: typeof parseNpmLikeMetadata;
197
+ };
198
+ };
199
+ };
200
+ /**
201
+ * The order of precedence for package managers.
202
+ * This is a best-effort ordering based on estimated Angular community usage and default presence.
203
+ */
204
+ export declare const PACKAGE_MANAGER_PRECEDENCE: readonly PackageManagerName[];