@angular/cli 19.0.0-next.1 → 19.0.0-next.11

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');
@@ -929,6 +929,11 @@
929
929
  "description": "Creates an application with Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) enabled.",
930
930
  "type": "boolean",
931
931
  "default": false
932
+ },
933
+ "experimentalZoneless": {
934
+ "description": "Create an application that does not utilize zone.js.",
935
+ "type": "boolean",
936
+ "default": false
932
937
  }
933
938
  }
934
939
  },
@@ -1111,6 +1116,11 @@
1111
1116
  "type": "boolean",
1112
1117
  "default": false,
1113
1118
  "description": "The declaring NgModule exports this component."
1119
+ },
1120
+ "exportDefault": {
1121
+ "type": "boolean",
1122
+ "default": false,
1123
+ "description": "Use default export for the component instead of a named export."
1114
1124
  }
1115
1125
  }
1116
1126
  },
@@ -1651,6 +1661,11 @@
1651
1661
  "ssr": {
1652
1662
  "description": "Creates an application with Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) enabled.",
1653
1663
  "type": "boolean"
1664
+ },
1665
+ "experimentalZoneless": {
1666
+ "description": "Create an application that does not utilize zone.js.",
1667
+ "type": "boolean",
1668
+ "default": false
1654
1669
  }
1655
1670
  }
1656
1671
  },
@@ -1908,6 +1923,34 @@
1908
1923
  "type": "string"
1909
1924
  },
1910
1925
  "default": []
1926
+ },
1927
+ "sass": {
1928
+ "description": "Options to pass to the sass preprocessor.",
1929
+ "type": "object",
1930
+ "properties": {
1931
+ "fatalDeprecations": {
1932
+ "description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
1933
+ "type": "array",
1934
+ "items": {
1935
+ "type": "string"
1936
+ }
1937
+ },
1938
+ "silenceDeprecations": {
1939
+ "description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
1940
+ "type": "array",
1941
+ "items": {
1942
+ "type": "string"
1943
+ }
1944
+ },
1945
+ "futureDeprecations": {
1946
+ "description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
1947
+ "type": "array",
1948
+ "items": {
1949
+ "type": "string"
1950
+ }
1951
+ }
1952
+ },
1953
+ "additionalProperties": false
1911
1954
  }
1912
1955
  },
1913
1956
  "additionalProperties": false
@@ -2321,6 +2364,14 @@
2321
2364
  "entry": {
2322
2365
  "type": "string",
2323
2366
  "description": "The server entry-point that when executed will spawn the web server."
2367
+ },
2368
+ "experimentalPlatform": {
2369
+ "description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the schematics may undergo changes in future versions.",
2370
+ "default": "node",
2371
+ "enum": [
2372
+ "node",
2373
+ "neutral"
2374
+ ]
2324
2375
  }
2325
2376
  },
2326
2377
  "additionalProperties": false
@@ -2331,6 +2382,14 @@
2331
2382
  "type": "boolean",
2332
2383
  "description": "Generates an application shell during build time.",
2333
2384
  "default": false
2385
+ },
2386
+ "outputMode": {
2387
+ "type": "string",
2388
+ "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).",
2389
+ "enum": [
2390
+ "static",
2391
+ "server"
2392
+ ]
2334
2393
  }
2335
2394
  },
2336
2395
  "additionalProperties": false,
@@ -4215,6 +4274,16 @@
4215
4274
  "type": "string"
4216
4275
  }
4217
4276
  },
4277
+ "builderMode": {
4278
+ "type": "string",
4279
+ "description": "Determines how to build the code under test. If set to 'detect', attempts to follow the development builder.",
4280
+ "enum": [
4281
+ "detect",
4282
+ "browser",
4283
+ "application"
4284
+ ],
4285
+ "default": "browser"
4286
+ },
4218
4287
  "webWorkerTsConfig": {
4219
4288
  "type": "string",
4220
4289
  "description": "TypeScript configuration for Web Worker modules."
@@ -104,6 +104,10 @@ export interface SchematicOptions {
104
104
  * Generates a new basic application definition in the "projects" subfolder of the workspace.
105
105
  */
106
106
  export interface AngularApplicationOptionsSchema {
107
+ /**
108
+ * Create an application that does not utilize zone.js.
109
+ */
110
+ experimentalZoneless?: boolean;
107
111
  /**
108
112
  * Include styles inline in the root component.ts file. Only CSS styles can be included
109
113
  * inline. Default is false, meaning that an external styles file is created and referenced
@@ -232,6 +236,10 @@ export interface AngularComponentOptionsSchema {
232
236
  * The declaring NgModule exports this component.
233
237
  */
234
238
  export?: boolean;
239
+ /**
240
+ * Use default export for the component instead of a named export.
241
+ */
242
+ exportDefault?: boolean;
235
243
  /**
236
244
  * Create the new files at the top level of the current project.
237
245
  */
@@ -541,6 +549,10 @@ export interface AngularNgNewOptionsSchema {
541
549
  * The directory name to create the workspace in.
542
550
  */
543
551
  directory?: string;
552
+ /**
553
+ * Create an application that does not utilize zone.js.
554
+ */
555
+ experimentalZoneless?: boolean;
544
556
  /**
545
557
  * Include styles inline in the component TS file. By default, an external styles file is
546
558
  * created and referenced in the component TypeScript file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "19.0.0-next.1",
3
+ "version": "19.0.0-next.11",
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.1",
29
- "@angular-devkit/core": "19.0.0-next.1",
30
- "@angular-devkit/schematics": "19.0.0-next.1",
31
- "@inquirer/prompts": "5.3.8",
32
- "@listr2/prompt-adapter-inquirer": "2.0.15",
33
- "@schematics/angular": "19.0.0-next.1",
28
+ "@angular-devkit/architect": "0.1900.0-next.11",
29
+ "@angular-devkit/core": "19.0.0-next.11",
30
+ "@angular-devkit/schematics": "19.0.0-next.11",
31
+ "@inquirer/prompts": "7.0.0",
32
+ "@listr2/prompt-adapter-inquirer": "2.0.17",
33
+ "@schematics/angular": "19.0.0-next.11",
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.1",
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.1",
50
- "@angular/build": "19.0.0-next.1",
51
- "@angular/ssr": "19.0.0-next.1",
52
- "@angular-devkit/architect": "0.1900.0-next.1",
53
- "@angular-devkit/build-angular": "19.0.0-next.1",
54
- "@angular-devkit/build-webpack": "0.1900.0-next.1",
55
- "@angular-devkit/core": "19.0.0-next.1",
56
- "@angular-devkit/schematics": "19.0.0-next.1"
49
+ "@angular/cli": "19.0.0-next.11",
50
+ "@angular/build": "19.0.0-next.11",
51
+ "@angular/ssr": "19.0.0-next.11",
52
+ "@angular-devkit/architect": "0.1900.0-next.11",
53
+ "@angular-devkit/build-angular": "19.0.0-next.11",
54
+ "@angular-devkit/build-webpack": "0.1900.0-next.11",
55
+ "@angular-devkit/core": "19.0.0-next.11",
56
+ "@angular-devkit/schematics": "19.0.0-next.11"
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.1');
28
+ // export const VERSION = new Version('19.0.0-next.11');
29
29
  exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);