@angular/cli 15.0.0-next.2 → 15.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/ng.js CHANGED
@@ -41,12 +41,12 @@ if (version[0] % 2 === 1 && version[0] > 16) {
41
41
  (version[0] === 14 && version[1] < 15) ||
42
42
  (version[0] === 16 && version[1] < 10)
43
43
  ) {
44
- // Error and exit if less than 14.15 or 15.x or less than 16.10
44
+ // Error and exit if less than 14.20 or 15.x or less than 16.10
45
45
  console.error(
46
46
  'Node.js version ' +
47
47
  process.version +
48
48
  ' detected.\n' +
49
- 'The Angular CLI requires a minimum Node.js version of either v14.15, or v16.10.\n\n' +
49
+ 'The Angular CLI requires a minimum Node.js version of either v14.20, or v16.10.\n\n' +
50
50
  'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
51
51
  );
52
52
 
@@ -1662,8 +1662,22 @@
1662
1662
  "description": "The full path for the main entry point to the app, relative to the current workspace."
1663
1663
  },
1664
1664
  "polyfills": {
1665
- "type": "string",
1666
- "description": "The full path for the polyfills file, relative to the current workspace."
1665
+ "description": "Polyfills to be included in the build.",
1666
+ "oneOf": [
1667
+ {
1668
+ "type": "array",
1669
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
1670
+ "items": {
1671
+ "type": "string",
1672
+ "uniqueItems": true
1673
+ },
1674
+ "default": []
1675
+ },
1676
+ {
1677
+ "type": "string",
1678
+ "description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
1679
+ }
1680
+ ]
1667
1681
  },
1668
1682
  "tsConfig": {
1669
1683
  "type": "string",
@@ -2215,8 +2229,22 @@
2215
2229
  "description": "The full path for the main entry point to the app, relative to the current workspace."
2216
2230
  },
2217
2231
  "polyfills": {
2218
- "type": "string",
2219
- "description": "The full path for the polyfills file, relative to the current workspace."
2232
+ "description": "Polyfills to be included in the build.",
2233
+ "oneOf": [
2234
+ {
2235
+ "type": "array",
2236
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
2237
+ "items": {
2238
+ "type": "string",
2239
+ "uniqueItems": true
2240
+ },
2241
+ "default": []
2242
+ },
2243
+ {
2244
+ "type": "string",
2245
+ "description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
2246
+ }
2247
+ ]
2220
2248
  },
2221
2249
  "tsConfig": {
2222
2250
  "type": "string",
@@ -2900,8 +2928,22 @@
2900
2928
  "description": "The name of the Karma configuration file."
2901
2929
  },
2902
2930
  "polyfills": {
2903
- "type": "string",
2904
- "description": "The name of the polyfills file."
2931
+ "description": "Polyfills to be included in the build.",
2932
+ "oneOf": [
2933
+ {
2934
+ "type": "array",
2935
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
2936
+ "items": {
2937
+ "type": "string",
2938
+ "uniqueItems": true
2939
+ },
2940
+ "default": []
2941
+ },
2942
+ {
2943
+ "type": "string",
2944
+ "description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
2945
+ }
2946
+ ]
2905
2947
  },
2906
2948
  "assets": {
2907
2949
  "type": "array",
@@ -3012,6 +3054,9 @@
3012
3054
  "items": {
3013
3055
  "type": "string"
3014
3056
  },
3057
+ "default": [
3058
+ "**/*.spec.ts"
3059
+ ],
3015
3060
  "description": "Globs of files to include, relative to workspace or project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
3016
3061
  },
3017
3062
  "sourceMap": {
@@ -3413,11 +3458,6 @@
3413
3458
  "description": "Use file name for lazy loaded chunks.",
3414
3459
  "default": false
3415
3460
  },
3416
- "bundleDependencies": {
3417
- "description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
3418
- "default": true,
3419
- "type": "boolean"
3420
- },
3421
3461
  "externalDependencies": {
3422
3462
  "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
3423
3463
  "type": "array",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "15.0.0-next.2",
3
+ "version": "15.0.0-next.4",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,40 +25,39 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1500.0-next.2",
29
- "@angular-devkit/core": "15.0.0-next.2",
30
- "@angular-devkit/schematics": "15.0.0-next.2",
31
- "@schematics/angular": "15.0.0-next.2",
28
+ "@angular-devkit/architect": "0.1500.0-next.4",
29
+ "@angular-devkit/core": "15.0.0-next.4",
30
+ "@angular-devkit/schematics": "15.0.0-next.4",
31
+ "@schematics/angular": "15.0.0-next.4",
32
32
  "@yarnpkg/lockfile": "1.1.0",
33
33
  "ansi-colors": "4.1.3",
34
34
  "debug": "4.3.4",
35
35
  "ini": "3.0.1",
36
36
  "inquirer": "8.2.4",
37
37
  "jsonc-parser": "3.2.0",
38
- "npm-package-arg": "9.1.0",
38
+ "npm-package-arg": "9.1.2",
39
39
  "npm-pick-manifest": "7.0.2",
40
40
  "open": "8.4.0",
41
41
  "ora": "5.4.1",
42
42
  "pacote": "13.6.2",
43
43
  "resolve": "1.22.1",
44
- "semver": "7.3.7",
44
+ "semver": "7.3.8",
45
45
  "symbol-observable": "4.0.0",
46
- "uuid": "9.0.0",
47
- "yargs": "17.5.1"
46
+ "yargs": "17.6.0"
48
47
  },
49
48
  "ng-update": {
50
49
  "migrations": "@schematics/angular/migrations/migration-collection.json",
51
50
  "packageGroup": {
52
- "@angular/cli": "15.0.0-next.2",
53
- "@angular-devkit/architect": "0.1500.0-next.2",
54
- "@angular-devkit/build-angular": "15.0.0-next.2",
55
- "@angular-devkit/build-webpack": "0.1500.0-next.2",
56
- "@angular-devkit/core": "15.0.0-next.2",
57
- "@angular-devkit/schematics": "15.0.0-next.2"
51
+ "@angular/cli": "15.0.0-next.4",
52
+ "@angular-devkit/architect": "0.1500.0-next.4",
53
+ "@angular-devkit/build-angular": "15.0.0-next.4",
54
+ "@angular-devkit/build-webpack": "0.1500.0-next.4",
55
+ "@angular-devkit/core": "15.0.0-next.4",
56
+ "@angular-devkit/schematics": "15.0.0-next.4"
58
57
  }
59
58
  },
60
59
  "engines": {
61
- "node": "^14.15.0 || >=16.10.0",
60
+ "node": "^14.20.0 || >=16.10.0",
62
61
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
63
62
  "yarn": ">= 1.13.0"
64
63
  }
@@ -35,8 +35,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.getAnalyticsInfoString = exports.createAnalytics = exports.getSharedAnalytics = exports.getAnalytics = exports.promptAnalytics = exports.setAnalyticsConfig = exports.isPackageNameSafeForAnalytics = exports.analyticsPackageSafelist = exports.AnalyticsProperties = void 0;
37
37
  const core_1 = require("@angular-devkit/core");
38
+ const crypto_1 = require("crypto");
38
39
  const debug_1 = __importDefault(require("debug"));
39
- const uuid_1 = require("uuid");
40
40
  const color_1 = require("../utilities/color");
41
41
  const config_1 = require("../utilities/config");
42
42
  const environment_options_1 = require("../utilities/environment-options");
@@ -101,7 +101,7 @@ async function setAnalyticsConfig(global, value) {
101
101
  if (!workspace || !core_1.json.isJsonObject(cli)) {
102
102
  throw new Error(`Invalid config found at ${workspace.filePath}. CLI should be an object.`);
103
103
  }
104
- cli.analytics = value === true ? (0, uuid_1.v4)() : value;
104
+ cli.analytics = value === true ? (0, crypto_1.randomUUID)() : value;
105
105
  await workspace.save();
106
106
  analyticsDebug('done');
107
107
  }
@@ -39,7 +39,7 @@ class ArchitectBaseCommandModule extends command_module_1.CommandModule {
39
39
  await this.reportAnalytics({
40
40
  ...(await architectHost.getOptionsForTarget(target)),
41
41
  ...options,
42
- });
42
+ }, undefined /** paths */, undefined /** dimensions */, builderName);
43
43
  const { logger } = this.context;
44
44
  const run = await this.getArchitect().scheduleTarget(target, options, {
45
45
  logger,
@@ -74,7 +74,7 @@ export declare abstract class CommandModule<T extends {} = {}> implements Comman
74
74
  abstract builder(argv: Argv): Promise<Argv<T>> | Argv<T>;
75
75
  abstract run(options: Options<T> & OtherOptions): Promise<number | void> | number | void;
76
76
  handler(args: ArgumentsCamelCase<T> & OtherOptions): Promise<void>;
77
- reportAnalytics(options: (Options<T> & OtherOptions) | OtherOptions, paths?: string[], dimensions?: (boolean | number | string)[]): Promise<void>;
77
+ reportAnalytics(options: (Options<T> & OtherOptions) | OtherOptions, paths?: string[], dimensions?: (boolean | number | string)[], title?: string): Promise<void>;
78
78
  protected getAnalytics(): Promise<analytics.Analytics>;
79
79
  /**
80
80
  * Adds schema options to a command also this keeps track of options that are required for analytics.
@@ -82,6 +82,13 @@ export declare abstract class CommandModule<T extends {} = {}> implements Comman
82
82
  */
83
83
  protected addSchemaOptionsToCommand<T>(localYargs: Argv<T>, options: Option[]): Argv<T>;
84
84
  protected getWorkspaceOrThrow(): AngularWorkspace;
85
+ /**
86
+ * Flush on an interval (if the event loop is waiting).
87
+ *
88
+ * @returns a method that when called will terminate the periodic
89
+ * flush and call flush one last time.
90
+ */
91
+ private periodicAnalyticsFlush;
85
92
  }
86
93
  /**
87
94
  * Creates an known command module error.
@@ -99,8 +99,10 @@ class CommandModule {
99
99
  }
100
100
  // Gather and report analytics.
101
101
  const analytics = await this.getAnalytics();
102
+ let stopPeriodicFlushes;
102
103
  if (this.shouldReportAnalytics) {
103
104
  await this.reportAnalytics(camelCasedOptions);
105
+ stopPeriodicFlushes = this.periodicAnalyticsFlush(analytics);
104
106
  }
105
107
  let exitCode;
106
108
  try {
@@ -109,7 +111,6 @@ class CommandModule {
109
111
  exitCode = await this.run(camelCasedOptions);
110
112
  const endTime = Date.now();
111
113
  analytics.timing(this.commandName, 'duration', endTime - startTime);
112
- await analytics.flush();
113
114
  }
114
115
  catch (e) {
115
116
  if (e instanceof core_1.schema.SchemaValidationException) {
@@ -121,12 +122,13 @@ class CommandModule {
121
122
  }
122
123
  }
123
124
  finally {
125
+ await (stopPeriodicFlushes === null || stopPeriodicFlushes === void 0 ? void 0 : stopPeriodicFlushes());
124
126
  if (typeof exitCode === 'number' && exitCode > 0) {
125
127
  process.exitCode = exitCode;
126
128
  }
127
129
  }
128
130
  }
129
- async reportAnalytics(options, paths = [], dimensions = []) {
131
+ async reportAnalytics(options, paths = [], dimensions = [], title) {
130
132
  for (const [name, ua] of this.optionsWithAnalytics) {
131
133
  const value = options[name];
132
134
  if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
@@ -137,6 +139,7 @@ class CommandModule {
137
139
  analytics.pageview('/command/' + [this.commandName, ...paths].join('/'), {
138
140
  dimensions,
139
141
  metrics: [],
142
+ title,
140
143
  });
141
144
  }
142
145
  getAnalytics() {
@@ -204,6 +207,23 @@ class CommandModule {
204
207
  }
205
208
  return workspace;
206
209
  }
210
+ /**
211
+ * Flush on an interval (if the event loop is waiting).
212
+ *
213
+ * @returns a method that when called will terminate the periodic
214
+ * flush and call flush one last time.
215
+ */
216
+ periodicAnalyticsFlush(analytics) {
217
+ let analyticsFlushPromise = Promise.resolve();
218
+ const analyticsFlushInterval = setInterval(() => {
219
+ analyticsFlushPromise = analyticsFlushPromise.then(() => analytics.flush());
220
+ }, 2000);
221
+ return () => {
222
+ clearInterval(analyticsFlushInterval);
223
+ // Flush one last time.
224
+ return analyticsFlushPromise.then(() => analytics.flush());
225
+ };
226
+ }
207
227
  }
208
228
  __decorate([
209
229
  memoize_1.memoize
@@ -128,16 +128,9 @@ class SchematicsCommandModule extends command_module_1.CommandModule {
128
128
  workflow.registry.addSmartDefaultProvider('workingDirectory', () => workingDir === '' ? undefined : workingDir);
129
129
  let shouldReportAnalytics = true;
130
130
  workflow.engineHost.registerOptionsTransform(async (schematic, options) => {
131
- var _a;
132
131
  if (shouldReportAnalytics) {
133
132
  shouldReportAnalytics = false;
134
- // ng generate lib -> ng generate
135
- const commandName = (_a = this.command) === null || _a === void 0 ? void 0 : _a.split(' ', 1)[0];
136
- await this.reportAnalytics(options, [
137
- commandName,
138
- schematic.collection.name.replace(/\//g, '_'),
139
- schematic.name.replace(/\//g, '_'),
140
- ]);
133
+ await this.reportAnalytics(options, undefined /** paths */, undefined /** dimensions */, schematic.collection.name + ':' + schematic.name);
141
134
  }
142
135
  // TODO: The below should be removed in version 15 when we change 1P schematics to use the `workingDirectory smart default`.
143
136
  // Handle `"format": "path"` options.
@@ -51,11 +51,8 @@ flexibility in their environments when desired.
51
51
  ## Platform support
52
52
 
53
53
  Angular CLI supports autocompletion for the Bash and Zsh shells on MacOS and Linux operating
54
- systems.
55
-
56
- Windows does not support autocompletion in native shells, such as Cmd and Powershell. However,
57
- the Angular CLI supports Git Bash and
58
- [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/) using Bash or Zsh.
54
+ systems. On Windows, Git Bash and [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/)
55
+ using Bash or Zsh are supported.
59
56
 
60
57
  ## Global install
61
58
 
@@ -8,8 +8,8 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ConfigCommandModule = void 0;
11
+ const crypto_1 = require("crypto");
11
12
  const path_1 = require("path");
12
- const uuid_1 = require("uuid");
13
13
  const command_module_1 = require("../../command-builder/command-module");
14
14
  const config_1 = require("../../utilities/config");
15
15
  const json_file_1 = require("../../utilities/json-file");
@@ -80,7 +80,7 @@ class ConfigCommandModule extends command_module_1.CommandModule {
80
80
  if (!config || !configPath) {
81
81
  throw new command_module_1.CommandModuleError('Confguration file cannot be found.');
82
82
  }
83
- const normalizeUUIDValue = (v) => (v === '' ? (0, uuid_1.v4)() : `${v}`);
83
+ const normalizeUUIDValue = (v) => (v === '' ? (0, crypto_1.randomUUID)() : `${v}`);
84
84
  const value = options.jsonPath === 'cli.analyticsSharing.uuid'
85
85
  ? normalizeUUIDValue(options.value)
86
86
  : options.value;