@angular/cli 13.0.0-next.7 → 13.0.0-rc.1

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
@@ -24,8 +24,8 @@ try {
24
24
  // These may not support ES2015 features such as const/let/async/await/etc.
25
25
  // These would then crash with a hard to diagnose error message.
26
26
  var version = process.versions.node.split('.').map((part) => Number(part));
27
- if (version[0] % 2 === 1 && version[0] > 14) {
28
- // Allow new odd numbered releases with a warning (currently v15+)
27
+ if (version[0] % 2 === 1 && version[0] > 16) {
28
+ // Allow new odd numbered releases with a warning (currently v17+)
29
29
  console.warn(
30
30
  'Node.js version ' +
31
31
  process.version +
@@ -38,15 +38,17 @@ if (version[0] % 2 === 1 && version[0] > 14) {
38
38
  } else if (
39
39
  version[0] < 12 ||
40
40
  version[0] === 13 ||
41
+ version[0] === 15 ||
41
42
  (version[0] === 12 && version[1] < 20) ||
42
- (version[0] === 14 && version[1] < 15)
43
+ (version[0] === 14 && version[1] < 15) ||
44
+ (version[0] === 16 && version[1] < 10)
43
45
  ) {
44
- // Error and exit if less than 12.20 or 13.x or less than 14.15
46
+ // Error and exit if less than 12.20 or 13.x or less than 14.15 or 15.x or less than 16.10
45
47
  console.error(
46
48
  'Node.js version ' +
47
49
  process.version +
48
50
  ' detected.\n' +
49
- 'The Angular CLI requires a minimum Node.js version of either v12.20 or v14.15.\n\n' +
51
+ 'The Angular CLI requires a minimum Node.js version of either v12.20, v14.15, or v16.10.\n\n' +
50
52
  'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
51
53
  );
52
54
 
@@ -20,7 +20,10 @@ const validCliPaths = new Map([
20
20
  ['cli.packageManager', undefined],
21
21
  ['cli.analytics', undefined],
22
22
  ['cli.analyticsSharing.tracking', undefined],
23
- ['cli.analyticsSharing.uuid', (v) => (v ? `${v}` : (0, uuid_1.v4)())],
23
+ ['cli.analyticsSharing.uuid', (v) => (v === '' ? (0, uuid_1.v4)() : `${v}`)],
24
+ ['cli.cache.enabled', undefined],
25
+ ['cli.cache.environment', undefined],
26
+ ['cli.cache.path', undefined],
24
27
  ]);
25
28
  /**
26
29
  * Splits a JSON path string into fragments. Fragments can be used to get the value referenced
@@ -54,7 +57,6 @@ function parseJsonPath(path) {
54
57
  return result.filter((fragment) => fragment != null);
55
58
  }
56
59
  function normalizeValue(value) {
57
- var _a, _b;
58
60
  const valueString = `${value}`.trim();
59
61
  switch (valueString) {
60
62
  case 'true':
@@ -69,7 +71,16 @@ function normalizeValue(value) {
69
71
  if (isFinite(+valueString)) {
70
72
  return +valueString;
71
73
  }
72
- return (_b = (_a = (0, json_file_1.parseJson)(valueString)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : undefined;
74
+ try {
75
+ // We use `JSON.parse` instead of `parseJson` because the latter will parse UUIDs
76
+ // and convert them into a numberic entities.
77
+ // Example: 73b61974-182c-48e4-b4c6-30ddf08c5c98 -> 73.
78
+ // These values should never contain comments, therefore using `JSON.parse` is safe.
79
+ return JSON.parse(valueString);
80
+ }
81
+ catch {
82
+ return value;
83
+ }
73
84
  }
74
85
  class ConfigCommand extends command_1.Command {
75
86
  async run(options) {
@@ -163,7 +163,7 @@ class UpdateCommand extends command_1.Command {
163
163
  */
164
164
  async executeMigrations(packageName, collectionPath, from, to, commit) {
165
165
  const collection = this.workflow.engine.createCollection(collectionPath);
166
- const migrationRange = new semver.Range('>' + (semver.prerelease(from) ? from.split('-')[0] + '-0' : from) + ' <=' + to);
166
+ const migrationRange = new semver.Range('>' + (semver.prerelease(from) ? from.split('-')[0] + '-0' : from) + ' <=' + to.split('-')[0]);
167
167
  const migrations = [];
168
168
  for (const name of collection.listSchematicNames()) {
169
169
  const schematic = this.workflow.engine.createSchematic(name, collection);
@@ -503,10 +503,21 @@ class UpdateCommand extends command_1.Command {
503
503
  try {
504
504
  // Remove existing node modules directory to provide a stronger guarantee that packages
505
505
  // will be hoisted into the correct locations.
506
- await fs.promises.rmdir(path.join(this.context.root, 'node_modules'), {
507
- recursive: true,
508
- maxRetries: 3,
509
- });
506
+ // The below should be removed and replaced with just `rm` when support for Node.Js 12 is removed.
507
+ const { rm, rmdir } = fs.promises;
508
+ if (rm) {
509
+ await rm(path.join(this.context.root, 'node_modules'), {
510
+ force: true,
511
+ recursive: true,
512
+ maxRetries: 3,
513
+ });
514
+ }
515
+ else {
516
+ await rmdir(path.join(this.context.root, 'node_modules'), {
517
+ recursive: true,
518
+ maxRetries: 3,
519
+ });
520
+ }
510
521
  }
511
522
  catch { }
512
523
  const result = await (0, install_package_1.installAllPackages)(this.packageManager, options.force ? ['--force'] : [], this.context.root);
@@ -19,7 +19,7 @@ const package_manager_1 = require("../utilities/package-manager");
19
19
  /**
20
20
  * Major versions of Node.js that are officially supported by Angular.
21
21
  */
22
- const SUPPORTED_NODE_MAJORS = [12, 14];
22
+ const SUPPORTED_NODE_MAJORS = [12, 14, 16];
23
23
  class VersionCommand extends command_1.Command {
24
24
  constructor() {
25
25
  super(...arguments);
package/lib/cli/index.js CHANGED
@@ -24,9 +24,9 @@ const isDebug = debugEnv !== undefined && debugEnv !== '0' && debugEnv.toLowerCa
24
24
  async function default_1(options) {
25
25
  // This node version check ensures that the requirements of the project instance of the CLI are met
26
26
  const version = process.versions.node.split('.').map((part) => Number(part));
27
- if (version[0] < 12 || (version[0] === 12 && version[1] < 14)) {
27
+ if (version[0] < 12 || (version[0] === 12 && version[1] < 20)) {
28
28
  process.stderr.write(`Node.js version ${process.version} detected.\n` +
29
- 'The Angular CLI requires a minimum v12.14.\n\n' +
29
+ 'The Angular CLI requires a minimum v12.20.\n\n' +
30
30
  'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n');
31
31
  return 3;
32
32
  }
@@ -79,10 +79,34 @@
79
79
  "tracking": {
80
80
  "description": "Analytics sharing info tracking ID.",
81
81
  "type": "string",
82
- "pattern": "^GA-\\d+-\\d+$"
82
+ "pattern": "^(GA|UA)?-\\d+-\\d+$"
83
83
  },
84
84
  "uuid": {
85
85
  "description": "Analytics sharing info universally unique identifier.",
86
+ "type": "string",
87
+ "format": "uuid"
88
+ }
89
+ }
90
+ },
91
+ "cache": {
92
+ "description": "Control disk cache.",
93
+ "type": "object",
94
+ "properties": {
95
+ "environment": {
96
+ "description": "Configure in which environment disk cache is enabled.",
97
+ "type": "string",
98
+ "enum": [
99
+ "local",
100
+ "ci",
101
+ "all"
102
+ ]
103
+ },
104
+ "enabled": {
105
+ "description": "Configure whether disk caching is enabled.",
106
+ "type": "boolean"
107
+ },
108
+ "path": {
109
+ "description": "Cache base path.",
86
110
  "type": "string"
87
111
  }
88
112
  }
@@ -1624,7 +1648,7 @@
1624
1648
  "inlineCritical": {
1625
1649
  "type": "boolean",
1626
1650
  "description": "Extract and inline critical CSS definitions to improve first paint time.",
1627
- "default": true
1651
+ "default": false
1628
1652
  }
1629
1653
  },
1630
1654
  "additionalProperties": false
@@ -2148,98 +2172,6 @@
2148
2172
  "description": "Rebuild on change.",
2149
2173
  "default": true
2150
2174
  },
2151
- "optimization": {
2152
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
2153
- "x-user-analytics": 16,
2154
- "oneOf": [
2155
- {
2156
- "type": "object",
2157
- "properties": {
2158
- "scripts": {
2159
- "type": "boolean",
2160
- "description": "Enables optimization of the scripts output.",
2161
- "default": true
2162
- },
2163
- "styles": {
2164
- "type": "boolean",
2165
- "description": "Enables optimization of the styles output.",
2166
- "default": true
2167
- }
2168
- },
2169
- "additionalProperties": false
2170
- },
2171
- {
2172
- "type": "boolean"
2173
- }
2174
- ],
2175
- "x-deprecated": "Use the \"optimization\" option in the browser builder instead."
2176
- },
2177
- "aot": {
2178
- "type": "boolean",
2179
- "description": "Build using Ahead of Time compilation.",
2180
- "x-user-analytics": 13,
2181
- "x-deprecated": "Use the \"aot\" option in the browser builder instead."
2182
- },
2183
- "sourceMap": {
2184
- "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
2185
- "oneOf": [
2186
- {
2187
- "type": "object",
2188
- "properties": {
2189
- "scripts": {
2190
- "type": "boolean",
2191
- "description": "Output source maps for all scripts.",
2192
- "default": true
2193
- },
2194
- "styles": {
2195
- "type": "boolean",
2196
- "description": "Output source maps for all styles.",
2197
- "default": true
2198
- },
2199
- "hidden": {
2200
- "type": "boolean",
2201
- "description": "Output source maps used for error reporting tools.",
2202
- "default": false
2203
- },
2204
- "vendor": {
2205
- "type": "boolean",
2206
- "description": "Resolve vendor packages source maps.",
2207
- "default": false
2208
- }
2209
- },
2210
- "additionalProperties": false
2211
- },
2212
- {
2213
- "type": "boolean"
2214
- }
2215
- ],
2216
- "x-deprecated": "Use the \"sourceMap\" option in the browser builder instead."
2217
- },
2218
- "vendorChunk": {
2219
- "type": "boolean",
2220
- "description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
2221
- "x-deprecated": "Use the \"vendorChunk\" option in the browser builder instead."
2222
- },
2223
- "commonChunk": {
2224
- "type": "boolean",
2225
- "description": "Generate a seperate bundle containing code used across multiple bundles.",
2226
- "x-deprecated": "Use the \"commonChunk\" option in the browser builder instead."
2227
- },
2228
- "baseHref": {
2229
- "type": "string",
2230
- "description": "Base url for the application being built.",
2231
- "x-deprecated": "Use the \"baseHref\" option in the browser builder instead."
2232
- },
2233
- "deployUrl": {
2234
- "type": "string",
2235
- "description": "URL where files will be deployed.",
2236
- "x-deprecated": "Use the \"deployUrl\" option in the browser builder instead."
2237
- },
2238
- "progress": {
2239
- "type": "boolean",
2240
- "description": "Log progress to the console while building.",
2241
- "x-deprecated": "Use the \"progress\" option in the browser builder instead."
2242
- },
2243
2175
  "poll": {
2244
2176
  "type": "number",
2245
2177
  "description": "Enable and define the file watching poll time period in milliseconds."
@@ -19,6 +19,10 @@ export interface CliOptions {
19
19
  */
20
20
  analytics?: Analytics;
21
21
  analyticsSharing?: AnalyticsSharing;
22
+ /**
23
+ * Control disk cache.
24
+ */
25
+ cache?: Cache;
22
26
  /**
23
27
  * The default schematics collection to use.
24
28
  */
@@ -46,6 +50,31 @@ export interface AnalyticsSharing {
46
50
  */
47
51
  uuid?: string;
48
52
  }
53
+ /**
54
+ * Control disk cache.
55
+ */
56
+ export interface Cache {
57
+ /**
58
+ * Configure whether disk caching is enabled.
59
+ */
60
+ enabled?: boolean;
61
+ /**
62
+ * Configure in which environment disk cache is enabled.
63
+ */
64
+ environment?: Environment;
65
+ /**
66
+ * Cache base path.
67
+ */
68
+ path?: string;
69
+ }
70
+ /**
71
+ * Configure in which environment disk cache is enabled.
72
+ */
73
+ export declare enum Environment {
74
+ All = "all",
75
+ Ci = "ci",
76
+ Local = "local"
77
+ }
49
78
  /**
50
79
  * Specify which package manager tool to use.
51
80
  *
@@ -2,7 +2,16 @@
2
2
  // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
3
  // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.PackageManager = void 0;
5
+ exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.PackageManager = exports.Environment = void 0;
6
+ /**
7
+ * Configure in which environment disk cache is enabled.
8
+ */
9
+ var Environment;
10
+ (function (Environment) {
11
+ Environment["All"] = "all";
12
+ Environment["Ci"] = "ci";
13
+ Environment["Local"] = "local";
14
+ })(Environment = exports.Environment || (exports.Environment = {}));
6
15
  /**
7
16
  * Specify which package manager tool to use.
8
17
  *
@@ -182,7 +182,7 @@ async function promptProjectAnalytics(force = false) {
182
182
  if (answers.analytics) {
183
183
  console.log('');
184
184
  console.log(core_1.tags.stripIndent `
185
- Thank you for sharing anonymous usage data. Would you change your mind, the following
185
+ Thank you for sharing anonymous usage data. Should you change your mind, the following
186
186
  command will disable this feature entirely:
187
187
 
188
188
  ${color_1.colors.yellow('ng analytics project off')}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "13.0.0-next.7",
3
+ "version": "13.0.0-rc.1",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -28,21 +28,21 @@
28
28
  },
29
29
  "homepage": "https://github.com/angular/angular-cli",
30
30
  "dependencies": {
31
- "@angular-devkit/architect": "0.1300.0-next.7",
32
- "@angular-devkit/core": "13.0.0-next.7",
33
- "@angular-devkit/schematics": "13.0.0-next.7",
34
- "@schematics/angular": "13.0.0-next.7",
31
+ "@angular-devkit/architect": "0.1300.0-rc.1",
32
+ "@angular-devkit/core": "13.0.0-rc.1",
33
+ "@angular-devkit/schematics": "13.0.0-rc.1",
34
+ "@schematics/angular": "13.0.0-rc.1",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
36
  "ansi-colors": "4.1.1",
37
37
  "debug": "4.3.2",
38
38
  "ini": "2.0.0",
39
- "inquirer": "8.1.5",
39
+ "inquirer": "8.2.0",
40
40
  "jsonc-parser": "3.0.0",
41
41
  "npm-package-arg": "8.1.5",
42
42
  "npm-pick-manifest": "6.1.1",
43
- "open": "8.2.1",
43
+ "open": "8.3.0",
44
44
  "ora": "5.4.1",
45
- "pacote": "11.3.5",
45
+ "pacote": "12.0.2",
46
46
  "resolve": "1.20.0",
47
47
  "semver": "7.3.5",
48
48
  "symbol-observable": "4.0.0",
@@ -51,17 +51,17 @@
51
51
  "ng-update": {
52
52
  "migrations": "@schematics/angular/migrations/migration-collection.json",
53
53
  "packageGroup": {
54
- "@angular/cli": "13.0.0-next.7",
55
- "@angular-devkit/architect": "0.1300.0-next.7",
56
- "@angular-devkit/build-angular": "13.0.0-next.7",
57
- "@angular-devkit/build-webpack": "0.1300.0-next.7",
58
- "@angular-devkit/core": "13.0.0-next.7",
59
- "@angular-devkit/schematics": "13.0.0-next.7"
54
+ "@angular/cli": "13.0.0-rc.1",
55
+ "@angular-devkit/architect": "0.1300.0-rc.1",
56
+ "@angular-devkit/build-angular": "13.0.0-rc.1",
57
+ "@angular-devkit/build-webpack": "0.1300.0-rc.1",
58
+ "@angular-devkit/core": "13.0.0-rc.1",
59
+ "@angular-devkit/schematics": "13.0.0-rc.1"
60
60
  }
61
61
  },
62
62
  "engines": {
63
- "node": "^12.20.0 || >=14.0.0",
64
- "npm": "^6.11.0 || ^7.5.6",
63
+ "node": "^12.20.0 || ^14.15.0 || >=16.10.0",
64
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
65
65
  "yarn": ">= 1.13.0"
66
66
  }
67
67
  }
@@ -247,11 +247,9 @@ function _performUpdate(tree, context, infoMap, logger, migrateOnly) {
247
247
  if (!target.updateMetadata.migrations) {
248
248
  return;
249
249
  }
250
- const collection = (target.updateMetadata.migrations.match(/^[./]/) ? name + '/' : '') +
251
- target.updateMetadata.migrations;
252
250
  externalMigrations.push({
253
251
  package: name,
254
- collection,
252
+ collection: target.updateMetadata.migrations,
255
253
  from: installed.version,
256
254
  to: target.version,
257
255
  });