@angular/cli 19.0.0-next.0 → 19.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2017 Google, Inc.
3
+ Copyright (c) 2010-2024 Google LLC. https://angular.dev/license
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/bin/bootstrap.js CHANGED
@@ -18,4 +18,16 @@
18
18
  * range.
19
19
  */
20
20
 
21
- import('../lib/init.js');
21
+ // Enable on-disk code caching if available (Node.js 22.8+)
22
+ // Skip if running inside Bazel via a RUNFILES environment variable check. The cache does not work
23
+ // well with Bazel's hermeticity requirements.
24
+ if (!process.env['RUNFILES']) {
25
+ try {
26
+ const { enableCompileCache } = require('node:module');
27
+
28
+ enableCompileCache?.();
29
+ } catch {}
30
+ }
31
+
32
+ // Initialize the Angular CLI
33
+ void import('../lib/init.js');
@@ -1111,6 +1111,11 @@
1111
1111
  "type": "boolean",
1112
1112
  "default": false,
1113
1113
  "description": "The declaring NgModule exports this component."
1114
+ },
1115
+ "exportDefault": {
1116
+ "type": "boolean",
1117
+ "default": false,
1118
+ "description": "Use default export for the component instead of a named export."
1114
1119
  }
1115
1120
  }
1116
1121
  },
@@ -2331,6 +2336,14 @@
2331
2336
  "type": "boolean",
2332
2337
  "description": "Generates an application shell during build time.",
2333
2338
  "default": false
2339
+ },
2340
+ "outputMode": {
2341
+ "type": "string",
2342
+ "description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR).",
2343
+ "enum": [
2344
+ "static",
2345
+ "server"
2346
+ ]
2334
2347
  }
2335
2348
  },
2336
2349
  "additionalProperties": false,
@@ -3726,12 +3739,6 @@
3726
3739
  "description": "Dev Server target options for Build Facade.",
3727
3740
  "type": "object",
3728
3741
  "properties": {
3729
- "browserTarget": {
3730
- "type": "string",
3731
- "description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
3732
- "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
3733
- "deprecated": true
3734
- },
3735
3742
  "buildTarget": {
3736
3743
  "type": "string",
3737
3744
  "description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
@@ -3864,11 +3871,7 @@
3864
3871
  ]
3865
3872
  }
3866
3873
  },
3867
- "additionalProperties": false,
3868
- "anyOf": [
3869
- {},
3870
- {}
3871
- ]
3874
+ "additionalProperties": false
3872
3875
  },
3873
3876
  "AngularBuildBuildersExtractI18nSchema": {
3874
3877
  "title": "Extract i18n Target",
@@ -3917,12 +3920,6 @@
3917
3920
  "description": "Extract i18n target options for Build Facade.",
3918
3921
  "type": "object",
3919
3922
  "properties": {
3920
- "browserTarget": {
3921
- "type": "string",
3922
- "description": "A browser builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
3923
- "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
3924
- "deprecated": true
3925
- },
3926
3923
  "buildTarget": {
3927
3924
  "type": "string",
3928
3925
  "description": "A builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
@@ -4231,6 +4228,16 @@
4231
4228
  "type": "string"
4232
4229
  }
4233
4230
  },
4231
+ "builderMode": {
4232
+ "type": "string",
4233
+ "description": "Determines how to build the code under test. If set to 'detect', attempts to follow the development builder.",
4234
+ "enum": [
4235
+ "detect",
4236
+ "browser",
4237
+ "application"
4238
+ ],
4239
+ "default": "browser"
4240
+ },
4234
4241
  "webWorkerTsConfig": {
4235
4242
  "type": "string",
4236
4243
  "description": "TypeScript configuration for Web Worker modules."
@@ -232,6 +232,10 @@ export interface AngularComponentOptionsSchema {
232
232
  * The declaring NgModule exports this component.
233
233
  */
234
234
  export?: boolean;
235
+ /**
236
+ * Use default export for the component instead of a named export.
237
+ */
238
+ exportDefault?: boolean;
235
239
  /**
236
240
  * Create the new files at the top level of the current project.
237
241
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "19.0.0-next.0",
3
+ "version": "19.0.0-next.10",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,19 +25,19 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1900.0-next.0",
29
- "@angular-devkit/core": "19.0.0-next.0",
30
- "@angular-devkit/schematics": "19.0.0-next.0",
31
- "@inquirer/prompts": "5.3.8",
32
- "@listr2/prompt-adapter-inquirer": "2.0.15",
33
- "@schematics/angular": "19.0.0-next.0",
28
+ "@angular-devkit/architect": "0.1900.0-next.10",
29
+ "@angular-devkit/core": "19.0.0-next.10",
30
+ "@angular-devkit/schematics": "19.0.0-next.10",
31
+ "@inquirer/prompts": "7.0.0",
32
+ "@listr2/prompt-adapter-inquirer": "2.0.17",
33
+ "@schematics/angular": "19.0.0-next.10",
34
34
  "@yarnpkg/lockfile": "1.1.0",
35
- "ini": "4.1.3",
35
+ "ini": "5.0.0",
36
36
  "jsonc-parser": "3.3.1",
37
- "listr2": "8.2.4",
38
- "npm-package-arg": "11.0.3",
39
- "npm-pick-manifest": "9.1.0",
40
- "pacote": "18.0.6",
37
+ "listr2": "8.2.5",
38
+ "npm-package-arg": "12.0.0",
39
+ "npm-pick-manifest": "10.0.0",
40
+ "pacote": "19.0.0",
41
41
  "resolve": "1.22.8",
42
42
  "semver": "7.6.3",
43
43
  "symbol-observable": "4.0.0",
@@ -46,17 +46,17 @@
46
46
  "ng-update": {
47
47
  "migrations": "@schematics/angular/migrations/migration-collection.json",
48
48
  "packageGroup": {
49
- "@angular/cli": "19.0.0-next.0",
50
- "@angular/build": "19.0.0-next.0",
51
- "@angular/ssr": "19.0.0-next.0",
52
- "@angular-devkit/architect": "0.1900.0-next.0",
53
- "@angular-devkit/build-angular": "19.0.0-next.0",
54
- "@angular-devkit/build-webpack": "0.1900.0-next.0",
55
- "@angular-devkit/core": "19.0.0-next.0",
56
- "@angular-devkit/schematics": "19.0.0-next.0"
49
+ "@angular/cli": "19.0.0-next.10",
50
+ "@angular/build": "19.0.0-next.10",
51
+ "@angular/ssr": "19.0.0-next.10",
52
+ "@angular-devkit/architect": "0.1900.0-next.10",
53
+ "@angular-devkit/build-angular": "19.0.0-next.10",
54
+ "@angular-devkit/build-webpack": "0.1900.0-next.10",
55
+ "@angular-devkit/core": "19.0.0-next.10",
56
+ "@angular-devkit/schematics": "19.0.0-next.10"
57
57
  }
58
58
  },
59
- "packageManager": "yarn@4.4.0",
59
+ "packageManager": "yarn@4.5.0",
60
60
  "engines": {
61
61
  "node": "^18.19.1 || ^20.11.1 || >=22.0.0",
62
62
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
@@ -78,6 +78,7 @@ const analytics_collector_1 = require("../analytics/analytics-collector");
78
78
  const analytics_parameters_1 = require("../analytics/analytics-parameters");
79
79
  const completion_1 = require("../utilities/completion");
80
80
  const memoize_1 = require("../utilities/memoize");
81
+ const json_schema_1 = require("./utilities/json-schema");
81
82
  var CommandScope;
82
83
  (function (CommandScope) {
83
84
  /** Command can only run inside an Angular workspace. */
@@ -182,51 +183,12 @@ let CommandModule = (() => {
182
183
  * **Note:** This method should be called from the command bundler method.
183
184
  */
184
185
  addSchemaOptionsToCommand(localYargs, options) {
185
- const booleanOptionsWithNoPrefix = new Set();
186
- for (const option of options) {
187
- const { default: defaultVal, positional, deprecated, description, alias, userAnalytics, type, hidden, name, choices, } = option;
188
- const sharedOptions = {
189
- alias,
190
- hidden,
191
- description,
192
- deprecated,
193
- choices,
194
- // This should only be done when `--help` is used otherwise default will override options set in angular.json.
195
- ...(this.context.args.options.help ? { default: defaultVal } : {}),
196
- };
197
- let dashedName = core_1.strings.dasherize(name);
198
- // Handle options which have been defined in the schema with `no` prefix.
199
- if (type === 'boolean' && dashedName.startsWith('no-')) {
200
- dashedName = dashedName.slice(3);
201
- booleanOptionsWithNoPrefix.add(dashedName);
202
- }
203
- if (positional === undefined) {
204
- localYargs = localYargs.option(dashedName, {
205
- type,
206
- ...sharedOptions,
207
- });
208
- }
209
- else {
210
- localYargs = localYargs.positional(dashedName, {
211
- type: type === 'array' || type === 'count' ? 'string' : type,
212
- ...sharedOptions,
213
- });
214
- }
215
- // Record option of analytics.
216
- if (userAnalytics !== undefined) {
217
- this.optionsWithAnalytics.set(name, userAnalytics);
218
- }
219
- }
220
- // Handle options which have been defined in the schema with `no` prefix.
221
- if (booleanOptionsWithNoPrefix.size) {
222
- localYargs.middleware((options) => {
223
- for (const key of booleanOptionsWithNoPrefix) {
224
- if (key in options) {
225
- options[`no-${key}`] = !options[key];
226
- delete options[key];
227
- }
228
- }
229
- }, false);
186
+ const optionsWithAnalytics = (0, json_schema_1.addSchemaOptionsToCommand)(localYargs, options,
187
+ // This should only be done when `--help` is used otherwise default will override options set in angular.json.
188
+ /* includeDefaultValues= */ this.context.args.options.help);
189
+ // Record option of analytics.
190
+ for (const [name, userAnalytics] of optionsWithAnalytics) {
191
+ this.optionsWithAnalytics.set(name, userAnalytics);
230
192
  }
231
193
  return localYargs;
232
194
  }
@@ -356,7 +356,7 @@ let SchematicsCommandModule = (() => {
356
356
  return 0;
357
357
  }
358
358
  getProjectName() {
359
- const { workspace, logger } = this.context;
359
+ const { workspace } = this.context;
360
360
  if (!workspace) {
361
361
  return undefined;
362
362
  }
@@ -6,7 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { json } from '@angular-devkit/core';
9
- import yargs from 'yargs';
9
+ import yargs, { Argv } from 'yargs';
10
10
  /**
11
11
  * An option description.
12
12
  */
@@ -36,5 +36,16 @@ export interface Option extends yargs.Options {
36
36
  * If this is falsey, do not report this option.
37
37
  */
38
38
  userAnalytics?: string;
39
+ /**
40
+ * Type of the values in a key/value pair field.
41
+ */
42
+ itemValueType?: 'string';
39
43
  }
40
44
  export declare function parseJsonSchemaToOptions(registry: json.schema.SchemaRegistry, schema: json.JsonObject, interactive?: boolean): Promise<Option[]>;
45
+ /**
46
+ * Adds schema options to a command also this keeps track of options that are required for analytics.
47
+ * **Note:** This method should be called from the command bundler method.
48
+ *
49
+ * @returns A map from option name to analytics configuration.
50
+ */
51
+ export declare function addSchemaOptionsToCommand<T>(localYargs: Argv<T>, options: Option[], includeDefaultValues: boolean): Map<string, string>;
@@ -8,7 +8,38 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
11
+ exports.addSchemaOptionsToCommand = addSchemaOptionsToCommand;
11
12
  const core_1 = require("@angular-devkit/core");
13
+ function coerceToStringMap(dashedName, value) {
14
+ const stringMap = {};
15
+ for (const pair of value) {
16
+ // This happens when the flag isn't passed at all.
17
+ if (pair === undefined) {
18
+ continue;
19
+ }
20
+ const eqIdx = pair.indexOf('=');
21
+ if (eqIdx === -1) {
22
+ // TODO: Remove workaround once yargs properly handles thrown errors from coerce.
23
+ // Right now these sometimes end up as uncaught exceptions instead of proper validation
24
+ // errors with usage output.
25
+ return Promise.reject(new Error(`Invalid value for argument: ${dashedName}, Given: '${pair}', Expected key=value pair`));
26
+ }
27
+ const key = pair.slice(0, eqIdx);
28
+ const value = pair.slice(eqIdx + 1);
29
+ stringMap[key] = value;
30
+ }
31
+ return stringMap;
32
+ }
33
+ function isStringMap(node) {
34
+ // Exclude fields with more specific kinds of properties.
35
+ if (node.properties || node.patternProperties) {
36
+ return false;
37
+ }
38
+ // Restrict to additionalProperties with string values.
39
+ return (core_1.json.isJsonObject(node.additionalProperties) &&
40
+ !node.additionalProperties.enum &&
41
+ node.additionalProperties.type === 'string');
42
+ }
12
43
  async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
13
44
  const options = [];
14
45
  function visitor(current, pointer, parentSchema) {
@@ -52,6 +83,8 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
52
83
  return true;
53
84
  }
54
85
  return false;
86
+ case 'object':
87
+ return isStringMap(current);
55
88
  default:
56
89
  return false;
57
90
  }
@@ -91,7 +124,6 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
91
124
  break;
92
125
  }
93
126
  }
94
- const type = types[0];
95
127
  const $default = current.$default;
96
128
  const $defaultIndex = core_1.json.isJsonObject($default) && $default['$source'] == 'argv' ? $default['index'] : undefined;
97
129
  const positional = typeof $defaultIndex == 'number' ? $defaultIndex : undefined;
@@ -115,7 +147,6 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
115
147
  const option = {
116
148
  name,
117
149
  description: '' + (current.description === undefined ? '' : current.description),
118
- type,
119
150
  default: defaultValue,
120
151
  choices: enumValues.length ? enumValues : undefined,
121
152
  required,
@@ -125,6 +156,14 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
125
156
  userAnalytics,
126
157
  deprecated,
127
158
  positional,
159
+ ...(types[0] === 'object'
160
+ ? {
161
+ type: 'array',
162
+ itemValueType: 'string',
163
+ }
164
+ : {
165
+ type: types[0],
166
+ }),
128
167
  };
129
168
  options.push(option);
130
169
  }
@@ -141,3 +180,65 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
141
180
  return a.name.localeCompare(b.name);
142
181
  });
143
182
  }
183
+ /**
184
+ * Adds schema options to a command also this keeps track of options that are required for analytics.
185
+ * **Note:** This method should be called from the command bundler method.
186
+ *
187
+ * @returns A map from option name to analytics configuration.
188
+ */
189
+ function addSchemaOptionsToCommand(localYargs, options, includeDefaultValues) {
190
+ const booleanOptionsWithNoPrefix = new Set();
191
+ const keyValuePairOptions = new Set();
192
+ const optionsWithAnalytics = new Map();
193
+ for (const option of options) {
194
+ const { default: defaultVal, positional, deprecated, description, alias, userAnalytics, type, itemValueType, hidden, name, choices, } = option;
195
+ let dashedName = core_1.strings.dasherize(name);
196
+ // Handle options which have been defined in the schema with `no` prefix.
197
+ if (type === 'boolean' && dashedName.startsWith('no-')) {
198
+ dashedName = dashedName.slice(3);
199
+ booleanOptionsWithNoPrefix.add(dashedName);
200
+ }
201
+ if (itemValueType) {
202
+ keyValuePairOptions.add(name);
203
+ }
204
+ const sharedOptions = {
205
+ alias,
206
+ hidden,
207
+ description,
208
+ deprecated,
209
+ choices,
210
+ coerce: itemValueType ? coerceToStringMap.bind(null, dashedName) : undefined,
211
+ // This should only be done when `--help` is used otherwise default will override options set in angular.json.
212
+ ...(includeDefaultValues ? { default: defaultVal } : {}),
213
+ };
214
+ if (positional === undefined) {
215
+ localYargs = localYargs.option(dashedName, {
216
+ array: itemValueType ? true : undefined,
217
+ type: itemValueType ?? type,
218
+ ...sharedOptions,
219
+ });
220
+ }
221
+ else {
222
+ localYargs = localYargs.positional(dashedName, {
223
+ type: type === 'array' || type === 'count' ? 'string' : type,
224
+ ...sharedOptions,
225
+ });
226
+ }
227
+ // Record option of analytics.
228
+ if (userAnalytics !== undefined) {
229
+ optionsWithAnalytics.set(name, userAnalytics);
230
+ }
231
+ }
232
+ // Handle options which have been defined in the schema with `no` prefix.
233
+ if (booleanOptionsWithNoPrefix.size) {
234
+ localYargs.middleware((options) => {
235
+ for (const key of booleanOptionsWithNoPrefix) {
236
+ if (key in options) {
237
+ options[`no-${key}`] = !options[key];
238
+ delete options[key];
239
+ }
240
+ }
241
+ }, false);
242
+ }
243
+ return optionsWithAnalytics;
244
+ }
@@ -11,6 +11,10 @@ const architect_command_module_1 = require("../../command-builder/architect-comm
11
11
  const command_config_1 = require("../command-config");
12
12
  class E2eCommandModule extends architect_command_module_1.ArchitectCommandModule {
13
13
  missingTargetChoices = [
14
+ {
15
+ name: 'Playwright',
16
+ value: 'playwright-ng-schematics',
17
+ },
14
18
  {
15
19
  name: 'Cypress',
16
20
  value: '@cypress/schematic',
@@ -25,5 +25,5 @@ class Version {
25
25
  }
26
26
  }
27
27
  // TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
28
- // export const VERSION = new Version('19.0.0-next.0');
28
+ // export const VERSION = new Version('19.0.0-next.10');
29
29
  exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);