@angular/cli 19.0.0-next.2 → 19.0.0-next.4

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/bin/bootstrap.js CHANGED
@@ -18,4 +18,12 @@
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
+ try {
23
+ const { enableCompileCache } = require('node:module');
24
+
25
+ enableCompileCache?.();
26
+ } catch {}
27
+
28
+ // Initialize the Angular CLI
29
+ void import('../lib/init.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "19.0.0-next.2",
3
+ "version": "19.0.0-next.4",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,14 +25,14 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1900.0-next.2",
29
- "@angular-devkit/core": "19.0.0-next.2",
30
- "@angular-devkit/schematics": "19.0.0-next.2",
31
- "@inquirer/prompts": "5.3.8",
28
+ "@angular-devkit/architect": "0.1900.0-next.4",
29
+ "@angular-devkit/core": "19.0.0-next.4",
30
+ "@angular-devkit/schematics": "19.0.0-next.4",
31
+ "@inquirer/prompts": "5.5.0",
32
32
  "@listr2/prompt-adapter-inquirer": "2.0.15",
33
- "@schematics/angular": "19.0.0-next.2",
33
+ "@schematics/angular": "19.0.0-next.4",
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
37
  "listr2": "8.2.4",
38
38
  "npm-package-arg": "11.0.3",
@@ -46,14 +46,14 @@
46
46
  "ng-update": {
47
47
  "migrations": "@schematics/angular/migrations/migration-collection.json",
48
48
  "packageGroup": {
49
- "@angular/cli": "19.0.0-next.2",
50
- "@angular/build": "19.0.0-next.2",
51
- "@angular/ssr": "19.0.0-next.2",
52
- "@angular-devkit/architect": "0.1900.0-next.2",
53
- "@angular-devkit/build-angular": "19.0.0-next.2",
54
- "@angular-devkit/build-webpack": "0.1900.0-next.2",
55
- "@angular-devkit/core": "19.0.0-next.2",
56
- "@angular-devkit/schematics": "19.0.0-next.2"
49
+ "@angular/cli": "19.0.0-next.4",
50
+ "@angular/build": "19.0.0-next.4",
51
+ "@angular/ssr": "19.0.0-next.4",
52
+ "@angular-devkit/architect": "0.1900.0-next.4",
53
+ "@angular-devkit/build-angular": "19.0.0-next.4",
54
+ "@angular-devkit/build-webpack": "0.1900.0-next.4",
55
+ "@angular-devkit/core": "19.0.0-next.4",
56
+ "@angular-devkit/schematics": "19.0.0-next.4"
57
57
  }
58
58
  },
59
59
  "packageManager": "yarn@4.4.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
  }
@@ -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.2');
28
+ // export const VERSION = new Version('19.0.0-next.4');
29
29
  exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);