@angular/cli 22.0.7 → 22.0.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "22.0.7",
3
+ "version": "22.0.8",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -15,13 +15,13 @@
15
15
  "sdk"
16
16
  ],
17
17
  "dependencies": {
18
- "@angular-devkit/architect": "0.2200.7",
19
- "@angular-devkit/core": "22.0.7",
20
- "@angular-devkit/schematics": "22.0.7",
18
+ "@angular-devkit/architect": "0.2200.8",
19
+ "@angular-devkit/core": "22.0.8",
20
+ "@angular-devkit/schematics": "22.0.8",
21
21
  "@inquirer/prompts": "8.4.2",
22
22
  "@listr2/prompt-adapter-inquirer": "4.2.3",
23
23
  "@modelcontextprotocol/sdk": "1.29.0",
24
- "@schematics/angular": "22.0.7",
24
+ "@schematics/angular": "22.0.8",
25
25
  "@yarnpkg/lockfile": "1.1.0",
26
26
  "algoliasearch": "5.52.0",
27
27
  "ini": "6.0.0",
@@ -37,14 +37,14 @@
37
37
  "ng-update": {
38
38
  "migrations": "@schematics/angular/migrations/migration-collection.json",
39
39
  "packageGroup": {
40
- "@angular/cli": "22.0.7",
41
- "@angular/build": "22.0.7",
42
- "@angular/ssr": "22.0.7",
43
- "@angular-devkit/architect": "0.2200.7",
44
- "@angular-devkit/build-angular": "22.0.7",
45
- "@angular-devkit/build-webpack": "0.2200.7",
46
- "@angular-devkit/core": "22.0.7",
47
- "@angular-devkit/schematics": "22.0.7"
40
+ "@angular/cli": "22.0.8",
41
+ "@angular/build": "22.0.8",
42
+ "@angular/ssr": "22.0.8",
43
+ "@angular-devkit/architect": "0.2200.8",
44
+ "@angular-devkit/build-angular": "22.0.8",
45
+ "@angular-devkit/build-webpack": "0.2200.8",
46
+ "@angular-devkit/core": "22.0.8",
47
+ "@angular-devkit/schematics": "22.0.8"
48
48
  }
49
49
  },
50
50
  "repository": {
@@ -73,29 +73,29 @@ async function startDevserver(input, context) {
73
73
  });
74
74
  }
75
75
  exports.DEVSERVER_START_TOOL = (0, tool_registry_1.declareTool)({
76
- name: 'devserver.start',
76
+ name: 'devserver_start',
77
77
  title: 'Start Development Server',
78
78
  description: `
79
79
  <Purpose>
80
- Starts the Angular development server ("ng serve") as a background process. Follow this up with "devserver.wait_for_build" to wait until
80
+ Starts the Angular development server ("ng serve") as a background process. Follow this up with "devserver_wait_for_build" to wait until
81
81
  the first build completes.
82
82
  </Purpose>
83
83
  <Use Cases>
84
84
  * **Starting the Server:** Use this tool to begin serving the application. The tool will return immediately while the server runs in the
85
85
  background.
86
- * **Get Initial Build Logs:** Once a dev server has started, use the "devserver.wait_for_build" tool to ensure it's alive. If there are any
87
- build errors, "devserver.wait_for_build" would provide them back and you can give them to the user or rely on them to propose a fix.
88
- * **Get Updated Build Logs:** Important: as long as a devserver is alive (i.e. "devserver.stop" wasn't called), after every time you
89
- make a change to the workspace, re-run "devserver.wait_for_build" to see whether the change was successfully built and wait for the
86
+ * **Get Initial Build Logs:** Once a dev server has started, use the "devserver_wait_for_build" tool to ensure it's alive. If there are any
87
+ build errors, "devserver_wait_for_build" would provide them back and you can give them to the user or rely on them to propose a fix.
88
+ * **Get Updated Build Logs:** Important: as long as a devserver is alive (i.e. "devserver_stop" wasn't called), after every time you
89
+ make a change to the workspace, re-run "devserver_wait_for_build" to see whether the change was successfully built and wait for the
90
90
  devserver to be updated.
91
91
  </Use Cases>
92
92
  <Operational Notes>
93
93
  * This tool manages development servers by itself. It maintains at most a single dev server instance for each project in the monorepo.
94
94
  * This is an asynchronous operation. Subsequent commands can be ran while the server is active.
95
- * Use 'devserver.stop' to gracefully shut down the server and access the full log output.
95
+ * Use 'devserver_stop' to gracefully shut down the server and access the full log output.
96
96
  * **Keeping the Server Alive**: It is often better to keep the server alive between tool calls if you expect the user to request more
97
97
  changes or run more tests, as it saves time on restarts and maintains the file watcher state. You must still call
98
- 'devserver.wait_for_build' after every change to see whether the change was successfully built and be sure that that app was updated.
98
+ 'devserver_wait_for_build' after every change to see whether the change was successfully built and be sure that the app was updated.
99
99
  * **Consistent Ports**: If making multiple calls, it is recommended to reuse the port you got from the first call for subsequent ones.
100
100
  </Operational Notes>
101
101
  `,
@@ -43,11 +43,11 @@ async function stopDevserver(input, context) {
43
43
  });
44
44
  }
45
45
  exports.DEVSERVER_STOP_TOOL = (0, tool_registry_1.declareTool)({
46
- name: 'devserver.stop',
46
+ name: 'devserver_stop',
47
47
  title: 'Stop Development Server',
48
48
  description: `
49
49
  <Purpose>
50
- Stops a running Angular development server ("ng serve") that was started with the "devserver.start" tool.
50
+ Stops a running Angular development server ("ng serve") that was started with the "devserver_start" tool.
51
51
  </Purpose>
52
52
  <Use Cases>
53
53
  * **Stopping the Server:** Use this tool to terminate a running development server and retrieve the logs.
@@ -74,22 +74,22 @@ async function performWait(devserver, timeout) {
74
74
  });
75
75
  }
76
76
  exports.DEVSERVER_WAIT_FOR_BUILD_TOOL = (0, tool_registry_1.declareTool)({
77
- name: 'devserver.wait_for_build',
77
+ name: 'devserver_wait_for_build',
78
78
  title: 'Wait for Devserver Build',
79
79
  description: `
80
80
  <Purpose>
81
- Waits for a dev server that was started with the "devserver.start" tool to complete its build, then reports the build logs from its most
81
+ Waits for a dev server that was started with the "devserver_start" tool to complete its build, then reports the build logs from its most
82
82
  recent build.
83
83
  </Purpose>
84
84
  <Use Cases>
85
- * **Waiting for a build:** As long as a devserver is alive ("devserver.start" was called for this project and "devserver.stop" wasn't
85
+ * **Waiting for a build:** As long as a devserver is alive ("devserver_start" was called for this project and "devserver_stop" wasn't
86
86
  called yet), then if you're making a file change and want to ensure it was successfully built, call this tool instead of any other build
87
87
  tool or command. When it retuns you'll get build logs back **and** you'll know the user's devserver is up-to-date with the latest changes.
88
88
  </Use Cases>
89
89
  <Operational Notes>
90
- * This tool expects that a dev server was launched on the same project with the "devserver.start" tool, otherwise the tool will fail.
90
+ * This tool expects that a dev server was launched on the same project with the "devserver_start" tool, otherwise the tool will fail.
91
91
  * This tool will block until the build is complete or the timeout is reached. If you expect a long build process, consider increasing the
92
- timeout. Timeouts on initial run (right after "devserver.start" calls) or after a big change are not necessarily indicative of an error.
92
+ timeout. Timeouts on initial run (right after "devserver_start" calls) or after a big change are not necessarily indicative of an error.
93
93
  * If you encountered a timeout and it might be reasonable, just call this tool again.
94
94
  * If the dev server is not building, it will return quickly, with the logs from the last build.
95
95
  </Operational Notes>
@@ -26,7 +26,7 @@ class GenericTargetStrategy {
26
26
  async execute(input, context) {
27
27
  if (input.targetName === 'serve' || input.options?.['watch'] === true) {
28
28
  throw new Error(`Watch mode execution (serve target or watch option) is not yet supported by 'run_target'. ` +
29
- `Please use the legacy 'devserver.start' / 'devserver.wait_for_build' tools instead.`);
29
+ `Please use the legacy 'devserver_start' / 'devserver_wait_for_build' tools instead.`);
30
30
  }
31
31
  const args = [];
32
32
  if (BUILT_IN_COMMANDS.has(input.targetName)) {
@@ -58,7 +58,7 @@ This is the single, unified interface for executing all project tasks natively.
58
58
  and disables watch mode to guarantee clean execution.
59
59
  * Output Paths: For official builders, successful builds return the build directory in 'outputPath' under the extensions metadata.
60
60
  * Watch mode (serve target or watch options) is NOT yet supported in this version of run_target.
61
- You MUST use the legacy 'devserver.*' tools for background server lifecycles.
61
+ You MUST use the legacy 'devserver_*' tools for background server lifecycles.
62
62
  </Operational Notes>`,
63
63
  isReadOnly: false,
64
64
  isLocalOnly: true,
@@ -5,6 +5,12 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
+ /**
9
+ * Groups files into batches whose combined argument length (including `baseLength`
10
+ * for the fixed leading arguments) stays under `maxLength`. A file longer on its own
11
+ * than the budget still gets its own batch, so files are never dropped.
12
+ */
13
+ export declare function batchFilesByArgumentLength(files: Iterable<string>, baseLength: number, maxLength: number): string[][];
8
14
  /**
9
15
  * Formats files using Prettier.
10
16
  * @param cwd The current working directory.
@@ -7,6 +7,7 @@
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.batchFilesByArgumentLength = batchFilesByArgumentLength;
10
11
  exports.formatFiles = formatFiles;
11
12
  const node_child_process_1 = require("node:child_process");
12
13
  const promises_1 = require("node:fs/promises");
@@ -15,6 +16,39 @@ const node_path_1 = require("node:path");
15
16
  const node_util_1 = require("node:util");
16
17
  const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
17
18
  let prettierCliPath;
19
+ /**
20
+ * Conservative upper bound for the length of a single spawned command line.
21
+ * Windows caps `CreateProcess` command lines at 32,767 characters; POSIX `ARG_MAX`
22
+ * is larger. Staying below this budget avoids `E2BIG`/`ENAMETOOLONG` when a large
23
+ * migration changes thousands of files.
24
+ */
25
+ const MAX_COMMAND_LINE_LENGTH = 32_000;
26
+ /**
27
+ * Groups files into batches whose combined argument length (including `baseLength`
28
+ * for the fixed leading arguments) stays under `maxLength`. A file longer on its own
29
+ * than the budget still gets its own batch, so files are never dropped.
30
+ */
31
+ function batchFilesByArgumentLength(files, baseLength, maxLength) {
32
+ const batches = [];
33
+ let batch = [];
34
+ let length = baseLength;
35
+ for (const file of files) {
36
+ // Account for the separator between arguments, plus the surrounding quotes the OS
37
+ // adds to paths containing spaces when they are spawned.
38
+ const fileLength = file.length + (file.includes(' ') ? 3 : 1);
39
+ if (batch.length > 0 && length + fileLength > maxLength) {
40
+ batches.push(batch);
41
+ batch = [];
42
+ length = baseLength;
43
+ }
44
+ batch.push(file);
45
+ length += fileLength;
46
+ }
47
+ if (batch.length > 0) {
48
+ batches.push(batch);
49
+ }
50
+ return batches;
51
+ }
18
52
  /**
19
53
  * Formats files using Prettier.
20
54
  * @param cwd The current working directory.
@@ -38,9 +72,34 @@ async function formatFiles(cwd, files) {
38
72
  if (!prettierCliPath) {
39
73
  return;
40
74
  }
41
- await execFileAsync(process.execPath, [prettierCliPath, '--write', '--no-error-on-unmatched-pattern', '--ignore-unknown', ...files], {
42
- cwd,
43
- shell: false,
44
- });
75
+ const baseArgs = [
76
+ prettierCliPath,
77
+ '--write',
78
+ '--no-error-on-unmatched-pattern',
79
+ '--ignore-unknown',
80
+ ];
81
+ // `process.execPath` is spawned as the first argument and also counts toward the
82
+ // command-line limit; it and `prettierCliPath` are absolute paths that may contain
83
+ // spaces and therefore be quoted.
84
+ const baseLength = [process.execPath, ...baseArgs].reduce((total, arg) => total + arg.length + (arg.includes(' ') ? 3 : 1), 0);
85
+ // Spawn Prettier once per batch so repositories with many changed files do not
86
+ // overflow the OS command-line length limit. A failure in one batch (e.g. a file
87
+ // Prettier cannot parse) must not stop the remaining batches, matching the previous
88
+ // single-invocation behavior, so errors are collected and reported together.
89
+ const errors = [];
90
+ for (const batch of batchFilesByArgumentLength(files, baseLength, MAX_COMMAND_LINE_LENGTH)) {
91
+ try {
92
+ await execFileAsync(process.execPath, [...baseArgs, ...batch], {
93
+ cwd,
94
+ shell: false,
95
+ });
96
+ }
97
+ catch (error) {
98
+ errors.push(error instanceof Error ? error.message : String(error));
99
+ }
100
+ }
101
+ if (errors.length > 0) {
102
+ throw new Error(errors.join('\n'));
103
+ }
45
104
  }
46
105
  //# sourceMappingURL=prettier.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prettier.js","sourceRoot":"","sources":["prettier.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAgBH,kCA8BC;AA5CD,2DAA8C;AAC9C,+CAA4C;AAC5C,6CAA4C;AAC5C,yCAA0C;AAC1C,yCAAsC;AAEtC,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,6BAAQ,CAAC,CAAC;AAC1C,IAAI,eAA0C,CAAC;AAE/C;;;;GAIG;AACI,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,KAAkB;IAC/D,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChB,OAA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M,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;AACH,CAAC"}
@@ -22,5 +22,5 @@ class Version {
22
22
  this.patch = patch;
23
23
  }
24
24
  }
25
- exports.VERSION = new Version('22.0.7');
25
+ exports.VERSION = new Version('22.0.8');
26
26
  //# sourceMappingURL=version.js.map