@angular/cli 12.0.0-rc.0 → 12.0.0

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.
Files changed (134) hide show
  1. package/README.md +34 -30
  2. package/bin/ng +3 -3
  3. package/bin/postinstall/analytics-prompt.js +1 -1
  4. package/commands/add-impl.d.ts +7 -0
  5. package/commands/add-impl.js +18 -20
  6. package/commands/add.json +1 -2
  7. package/commands/add.md +1 -0
  8. package/commands/analytics-impl.d.ts +8 -1
  9. package/commands/analytics-impl.js +7 -7
  10. package/commands/analytics-long.md +8 -7
  11. package/commands/analytics.json +3 -15
  12. package/commands/build-impl.d.ts +1 -1
  13. package/commands/build-impl.js +3 -3
  14. package/commands/build.json +1 -1
  15. package/commands/config-impl.d.ts +2 -2
  16. package/commands/config-impl.js +16 -11
  17. package/commands/config-long.md +1 -1
  18. package/commands/config.json +1 -2
  19. package/commands/definitions.json +3 -5
  20. package/commands/deploy-impl.d.ts +1 -1
  21. package/commands/deploy-impl.js +3 -3
  22. package/commands/deploy-long.md +1 -1
  23. package/commands/deploy.json +1 -3
  24. package/commands/doc-impl.d.ts +1 -1
  25. package/commands/doc-impl.js +2 -2
  26. package/commands/doc.json +3 -4
  27. package/commands/e2e-impl.d.ts +1 -1
  28. package/commands/e2e-impl.js +1 -1
  29. package/commands/e2e-long.md +1 -1
  30. package/commands/e2e.json +1 -1
  31. package/commands/easter-egg-impl.d.ts +1 -1
  32. package/commands/easter-egg-impl.js +3 -3
  33. package/commands/easter-egg.json +1 -3
  34. package/commands/extract-i18n-impl.d.ts +1 -1
  35. package/commands/extract-i18n-impl.js +5 -4
  36. package/commands/generate-impl.d.ts +1 -1
  37. package/commands/generate-impl.js +9 -2
  38. package/commands/generate.json +2 -3
  39. package/commands/help-impl.d.ts +1 -1
  40. package/commands/help-impl.js +3 -3
  41. package/commands/help-long.md +5 -5
  42. package/commands/help.json +1 -3
  43. package/commands/lint-impl.d.ts +1 -1
  44. package/commands/lint-impl.js +3 -3
  45. package/commands/lint-long.md +1 -1
  46. package/commands/lint.json +1 -3
  47. package/commands/new-impl.d.ts +1 -1
  48. package/commands/new-impl.js +8 -1
  49. package/commands/new.json +3 -3
  50. package/commands/new.md +5 -5
  51. package/commands/run-impl.d.ts +1 -1
  52. package/commands/run-impl.js +1 -1
  53. package/commands/run-long.md +1 -1
  54. package/commands/run.json +2 -3
  55. package/commands/serve-impl.d.ts +2 -2
  56. package/commands/serve-impl.js +4 -4
  57. package/commands/serve.json +1 -1
  58. package/commands/test-impl.d.ts +1 -1
  59. package/commands/test-impl.js +1 -1
  60. package/commands/test-long.md +1 -1
  61. package/commands/test.json +1 -1
  62. package/commands/update-impl.d.ts +9 -2
  63. package/commands/update-impl.js +29 -23
  64. package/commands/update.d.ts +2 -1
  65. package/commands/update.json +1 -1
  66. package/commands/version-impl.d.ts +8 -0
  67. package/commands/version-impl.js +19 -6
  68. package/commands/version.json +2 -4
  69. package/lib/cli/index.d.ts +7 -0
  70. package/lib/cli/index.js +14 -16
  71. package/lib/config/schema.json +20 -12
  72. package/lib/config/workspace-schema.d.ts +4 -0
  73. package/lib/init.d.ts +1 -1
  74. package/lib/init.js +11 -10
  75. package/models/analytics-collector.d.ts +1 -2
  76. package/models/analytics-collector.js +7 -8
  77. package/models/analytics.d.ts +7 -0
  78. package/models/analytics.js +6 -8
  79. package/models/architect-command.d.ts +2 -2
  80. package/models/architect-command.js +10 -11
  81. package/models/command-runner.d.ts +1 -1
  82. package/models/command-runner.js +8 -7
  83. package/models/command.d.ts +3 -4
  84. package/models/command.js +17 -21
  85. package/models/error.d.ts +1 -1
  86. package/models/error.js +1 -1
  87. package/models/interface.d.ts +2 -2
  88. package/models/interface.js +7 -0
  89. package/models/parser.d.ts +1 -2
  90. package/models/parser.js +12 -15
  91. package/models/schematic-command.d.ts +1 -1
  92. package/models/schematic-command.js +48 -49
  93. package/models/schematic-engine-host.d.ts +1 -1
  94. package/models/schematic-engine-host.js +4 -4
  95. package/models/version.d.ts +1 -1
  96. package/models/version.js +1 -1
  97. package/package.json +14 -14
  98. package/src/commands/update/schematic/index.d.ts +7 -0
  99. package/src/commands/update/schematic/index.js +59 -56
  100. package/src/commands/update/schematic/npm-package-json.d.ts +1 -1
  101. package/src/commands/update/schematic/npm-package-json.js +7 -0
  102. package/src/commands/update/schematic/npm.d.ts +1 -1
  103. package/src/commands/update/schematic/npm.js +9 -4
  104. package/src/commands/update/schematic/package-json.d.ts +1 -1
  105. package/src/commands/update/schematic/package-json.js +1 -7
  106. package/src/commands/update/schematic/schema.json +2 -8
  107. package/utilities/color.d.ts +1 -1
  108. package/utilities/color.js +3 -3
  109. package/utilities/config.d.ts +1 -1
  110. package/utilities/config.js +24 -7
  111. package/utilities/find-up.d.ts +1 -1
  112. package/utilities/find-up.js +1 -1
  113. package/utilities/install-package.d.ts +7 -5
  114. package/utilities/install-package.js +37 -23
  115. package/utilities/json-file.d.ts +1 -1
  116. package/utilities/json-file.js +4 -4
  117. package/utilities/json-schema.d.ts +1 -1
  118. package/utilities/json-schema.js +30 -27
  119. package/utilities/log-file.d.ts +1 -1
  120. package/utilities/log-file.js +1 -1
  121. package/utilities/package-manager.d.ts +7 -0
  122. package/utilities/package-manager.js +5 -5
  123. package/utilities/package-metadata.d.ts +1 -1
  124. package/utilities/package-metadata.js +8 -1
  125. package/utilities/package-tree.d.ts +1 -1
  126. package/utilities/package-tree.js +1 -1
  127. package/utilities/project.d.ts +7 -0
  128. package/utilities/project.js +3 -3
  129. package/utilities/prompt.d.ts +7 -0
  130. package/utilities/prompt.js +3 -3
  131. package/utilities/spinner.d.ts +1 -1
  132. package/utilities/spinner.js +1 -1
  133. package/utilities/tty.d.ts +1 -1
  134. package/utilities/tty.js +1 -1
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ## Angular CLI
2
2
 
3
3
  <!-- Badges section here. -->
4
+
4
5
  [![Dependency Status][david-badge]][david-badge-url]
5
6
  [![devDependency Status][david-dev-badge]][david-dev-badge-url]
6
7
 
@@ -14,7 +15,6 @@
14
15
  [![GitHub forks](https://img.shields.io/github/forks/angular/angular-cli.svg?style=social&label=Fork)](https://github.com/angular/angular-cli/fork)
15
16
  [![GitHub stars](https://img.shields.io/github/stars/angular/angular-cli.svg?style=social&label=Star)](https://github.com/angular/angular-cli)
16
17
 
17
-
18
18
  ## Note
19
19
 
20
20
  If you are updating from a beta or RC version, check out our [1.0 Update Guide](https://github.com/angular/angular-cli/wiki/stories-1.0-update).
@@ -30,25 +30,27 @@ with NPM 5.5.1 or higher.
30
30
 
31
31
  ## Table of Contents
32
32
 
33
- * [Installation](#installation)
34
- * [Usage](#usage)
35
- * [Generating a New Project](#generating-and-serving-an-angular-project-via-a-development-server)
36
- * [Generating Components, Directives, Pipes and Services](#generating-components-directives-pipes-and-services)
37
- * [Updating Angular CLI](#updating-angular-cli)
38
- * [Development Hints for working on Angular CLI](#development-hints-for-working-on-angular-cli)
39
- * [Documentation](#documentation)
40
- * [License](#license)
33
+ - [Installation](#installation)
34
+ - [Usage](#usage)
35
+ - [Generating a New Project](#generating-and-serving-an-angular-project-via-a-development-server)
36
+ - [Generating Components, Directives, Pipes and Services](#generating-components-directives-pipes-and-services)
37
+ - [Updating Angular CLI](#updating-angular-cli)
38
+ - [Development Hints for working on Angular CLI](#development-hints-for-working-on-angular-cli)
39
+ - [Documentation](#documentation)
40
+ - [License](#license)
41
41
 
42
42
  ## Installation
43
43
 
44
44
  **BEFORE YOU INSTALL:** please read the [prerequisites](#prerequisites)
45
45
 
46
46
  ### Install Globally
47
+
47
48
  ```bash
48
49
  npm install -g @angular/cli
49
50
  ```
50
51
 
51
52
  ### Install Locally
53
+
52
54
  ```bash
53
55
  npm install @angular/cli
54
56
  ```
@@ -58,6 +60,7 @@ To run a locally installed version of the angular-cli, you can call `ng` command
58
60
  Alternatively, you can install [npx](https://www.npmjs.com/package/npx) and run `npx ng <command>` within the local directory where `npm install @angular/cli` was run, which will use the locally installed angular-cli.
59
61
 
60
62
  ### Install Specific Version (Example: 6.1.1)
63
+
61
64
  ```bash
62
65
  npm install -g @angular/cli@6.1.1
63
66
  ```
@@ -75,6 +78,7 @@ ng new PROJECT-NAME
75
78
  cd PROJECT-NAME
76
79
  ng serve
77
80
  ```
81
+
78
82
  Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
79
83
 
80
84
  You can configure the default HTTP host and port used by the development server with two command-line options :
@@ -102,33 +106,32 @@ ng g component ./newer-cmp
102
106
  ng g component feature/new-cmp
103
107
  # and your component will be generated in src/app/feature/new-cmp
104
108
  ```
105
- You can find all possible blueprints in the table below:
106
-
107
- Scaffold | Usage
108
- --- | ---
109
- [Component](https://angular.io/cli/generate#component) | `ng g component my-new-component`
110
- [Directive](https://angular.io/cli/generate#directive) | `ng g directive my-new-directive`
111
- [Pipe](https://angular.io/cli/generate#pipe) | `ng g pipe my-new-pipe`
112
- [Service](https://angular.io/cli/generate#service) | `ng g service my-new-service`
113
- [Class](https://angular.io/cli/generate#class) | `ng g class my-new-class`
114
- [Guard](https://angular.io/cli/generate#guard) | `ng g guard my-new-guard`
115
- [Interface](https://angular.io/cli/generate#interface) | `ng g interface my-new-interface`
116
- [Enum](https://angular.io/cli/generate#enum) | `ng g enum my-new-enum`
117
- [Module](https://angular.io/cli/generate#module) | `ng g module my-module`
118
-
119
109
 
110
+ You can find all possible blueprints in the table below:
120
111
 
112
+ | Scaffold | Usage |
113
+ | ------------------------------------------------------ | --------------------------------- |
114
+ | [Component](https://angular.io/cli/generate#component) | `ng g component my-new-component` |
115
+ | [Directive](https://angular.io/cli/generate#directive) | `ng g directive my-new-directive` |
116
+ | [Pipe](https://angular.io/cli/generate#pipe) | `ng g pipe my-new-pipe` |
117
+ | [Service](https://angular.io/cli/generate#service) | `ng g service my-new-service` |
118
+ | [Class](https://angular.io/cli/generate#class) | `ng g class my-new-class` |
119
+ | [Guard](https://angular.io/cli/generate#guard) | `ng g guard my-new-guard` |
120
+ | [Interface](https://angular.io/cli/generate#interface) | `ng g interface my-new-interface` |
121
+ | [Enum](https://angular.io/cli/generate#enum) | `ng g enum my-new-enum` |
122
+ | [Module](https://angular.io/cli/generate#module) | `ng g module my-module` |
121
123
 
122
124
  angular-cli will add reference to `components`, `directives` and `pipes` automatically in the `app.module.ts`. If you need to add this references to another custom module, follow these steps:
123
125
 
124
- 1. `ng g module new-module` to create a new module
125
- 2. call `ng g component new-module/new-component`
126
+ 1. `ng g module new-module` to create a new module
127
+ 2. call `ng g component new-module/new-component`
126
128
 
127
129
  This should add the new `component`, `directive` or `pipe` reference to the `new-module` you've created.
128
130
 
129
131
  ### Updating Angular CLI
130
132
 
131
133
  If you're using Angular CLI `1.0.0-beta.28` or less, you need to uninstall `angular-cli` package. It should be done due to changing of package's name and scope from `angular-cli` to `@angular/cli`:
134
+
132
135
  ```bash
133
136
  npm uninstall -g angular-cli
134
137
  npm uninstall --save-dev angular-cli
@@ -137,6 +140,7 @@ npm uninstall --save-dev angular-cli
137
140
  To update Angular CLI to a new version, you must update both the global package and your project's local package.
138
141
 
139
142
  Global package:
143
+
140
144
  ```bash
141
145
  npm uninstall -g @angular/cli
142
146
  npm cache verify
@@ -145,6 +149,7 @@ npm install -g @angular/cli@latest
145
149
  ```
146
150
 
147
151
  Local project package:
152
+
148
153
  ```bash
149
154
  rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
150
155
  npm install --save-dev @angular/cli@latest
@@ -155,7 +160,6 @@ If you are updating to 1.0 from a beta or RC version, check out our [1.0 Update
155
160
 
156
161
  You can find more details about changes between versions in [the Releases tab on GitHub](https://github.com/angular/angular-cli/releases).
157
162
 
158
-
159
163
  ## Development Hints for working on Angular CLI
160
164
 
161
165
  ### Working with master
@@ -231,15 +235,17 @@ For more informations about Node.js debugging in VS Code, see the related [VS Co
231
235
  In order to investigate performance issues, CPU profiling is often useful.
232
236
 
233
237
  To capture a CPU profiling, you can:
238
+
234
239
  1. install the v8-profiler-node8 dependency: `npm install v8-profiler-node8 --no-save`
235
240
  1. set the NG_CLI_PROFILING Environment variable to the file name you want:
236
- * on Unix systems (Linux & Mac OS X): ̀`export NG_CLI_PROFILING=my-profile`
237
- * on Windows: ̀̀`setx NG_CLI_PROFILING my-profile`
241
+ - on Unix systems (Linux & Mac OS X): ̀`export NG_CLI_PROFILING=my-profile`
242
+ - on Windows: ̀̀`setx NG_CLI_PROFILING my-profile`
238
243
 
239
244
  Then, just run the ng command on which you want to capture a CPU profile.
240
245
  You will then obtain a `my-profile.cpuprofile` file in the folder from which you ran the ng command.
241
246
 
242
247
  You can use the Chrome Devtools to process it. To do so:
248
+
243
249
  1. open `chrome://inspect/#devices` in Chrome
244
250
  1. click on "Open dedicated DevTools for Node"
245
251
  1. go to the "profiler" tab
@@ -256,7 +262,6 @@ The documentation for the Angular CLI is located on our [documentation website](
256
262
 
257
263
  [MIT](https://github.com/angular/angular-cli/blob/master/LICENSE)
258
264
 
259
-
260
265
  [travis-badge]: https://travis-ci.org/angular/angular-cli.svg?branch=master
261
266
  [travis-badge-url]: https://travis-ci.org/angular/angular-cli
262
267
  [david-badge]: https://david-dm.org/angular/angular-cli.svg
@@ -266,4 +271,3 @@ The documentation for the Angular CLI is located on our [documentation website](
266
271
  [npm-badge]: https://img.shields.io/npm/v/@angular/cli.svg
267
272
  [npm-badge-url]: https://www.npmjs.com/package/@angular/cli
268
273
  [license-url]: https://github.com/angular/angular-cli/blob/master/LICENSE
269
-
package/bin/ng CHANGED
@@ -29,15 +29,15 @@ if (version[0] % 2 === 1 && version[0] > 14) {
29
29
  } else if (
30
30
  version[0] < 12 ||
31
31
  version[0] === 13 ||
32
- (version[0] === 12 && version[1] < 13) ||
32
+ (version[0] === 12 && version[1] < 14) ||
33
33
  (version[0] === 14 && version[1] < 15)
34
34
  ) {
35
- // Error and exit if less than 12.13 or 13.x or less than 14.15
35
+ // Error and exit if less than 12.14 or 13.x or less than 14.15
36
36
  console.error(
37
37
  'Node.js version ' +
38
38
  process.version +
39
39
  ' detected.\n' +
40
- 'The Angular CLI requires a minimum Node.js version of either v12.13 or v14.15.\n\n' +
40
+ 'The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.\n\n' +
41
41
  'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
42
42
  );
43
43
 
@@ -10,7 +10,7 @@ try {
10
10
 
11
11
  analytics
12
12
  .hasGlobalAnalyticsConfiguration()
13
- .then(hasGlobalConfig => {
13
+ .then((hasGlobalConfig) => {
14
14
  if (!hasGlobalConfig) {
15
15
  return analytics.promptGlobalAnalytics();
16
16
  }
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { Arguments } from '../models/interface';
2
9
  import { SchematicCommand } from '../models/schematic-command';
3
10
  import { Schema as AddCommandSchema } from './add';
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AddCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AddCommand = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const tools_1 = require("@angular-devkit/schematics/tools");
13
13
  const path_1 = require("path");
@@ -170,25 +170,23 @@ class AddCommand extends schematic_command_1.SchematicCommand {
170
170
  return 1;
171
171
  }
172
172
  }
173
- try {
174
- spinner.start('Installing package...');
175
- if (savePackage === false) {
176
- // Temporary packages are located in a different directory
177
- // Hence we need to resolve them using the temp path
178
- const tempPath = install_package_1.installTempPackage(packageIdentifier.raw, undefined, packageManager, options.registry ? [`--registry="${options.registry}"`] : undefined);
179
- const resolvedCollectionPath = require.resolve(path_1.join(collectionName, 'package.json'), {
180
- paths: [tempPath],
181
- });
182
- collectionName = path_1.dirname(resolvedCollectionPath);
183
- }
184
- else {
185
- install_package_1.installPackage(packageIdentifier.raw, undefined, packageManager, savePackage, options.registry ? [`--registry="${options.registry}"`] : undefined);
173
+ if (savePackage === false) {
174
+ // Temporary packages are located in a different directory
175
+ // Hence we need to resolve them using the temp path
176
+ const { status, tempPath } = await install_package_1.installTempPackage(packageIdentifier.raw, packageManager, options.registry ? [`--registry="${options.registry}"`] : undefined);
177
+ const resolvedCollectionPath = require.resolve(path_1.join(collectionName, 'package.json'), {
178
+ paths: [tempPath],
179
+ });
180
+ if (status !== 0) {
181
+ return status;
186
182
  }
187
- spinner.succeed('Package successfully installed.');
183
+ collectionName = path_1.dirname(resolvedCollectionPath);
188
184
  }
189
- catch (error) {
190
- spinner.fail(`Package installation failed: ${error.message}`);
191
- return 1;
185
+ else {
186
+ const status = await install_package_1.installPackage(packageIdentifier.raw, packageManager, savePackage, options.registry ? [`--registry="${options.registry}"`] : undefined);
187
+ if (status !== 0) {
188
+ return status;
189
+ }
192
190
  }
193
191
  return this.executeSchematic(collectionName, options['--']);
194
192
  }
package/commands/add.json CHANGED
@@ -42,8 +42,7 @@
42
42
  "default": false
43
43
  }
44
44
  },
45
- "required": [
46
- ]
45
+ "required": []
47
46
  },
48
47
  {
49
48
  "$ref": "./definitions.json#/definitions/interactive"
package/commands/add.md CHANGED
@@ -2,6 +2,7 @@ Adds the npm package for a published library to your workspace, and configures
2
2
  the project in the current working directory (or the default project if you are
3
3
  not in a project directory) to use that library, as specified by the library's schematic.
4
4
  For example, adding `@angular/pwa` configures your project for PWA support:
5
+
5
6
  ```bash
6
7
  ng add @angular/pwa
7
8
  ```
@@ -1,6 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { Command } from '../models/command';
2
9
  import { Arguments } from '../models/interface';
3
10
  import { Schema as AnalyticsCommandSchema } from './analytics';
4
11
  export declare class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
5
- run(options: AnalyticsCommandSchema & Arguments): Promise<0 | 1 | 2 | 3 | 4>;
12
+ run(options: AnalyticsCommandSchema & Arguments): Promise<1 | 0 | 2 | 3 | 4>;
6
13
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyticsCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AnalyticsCommand = void 0;
11
11
  const analytics_1 = require("../models/analytics");
12
12
  const command_1 = require("../models/command");
13
13
  const analytics_2 = require("./analytics");
@@ -29,10 +29,10 @@ class AnalyticsCommand extends command_1.Command {
29
29
  return 2;
30
30
  }
31
31
  }
32
- else if (options.settingOrProject == analytics_2.SettingOrProject.Project
33
- && options.projectSetting === undefined) {
34
- this.logger.error(`Argument ${JSON.stringify(options.settingOrProject)} requires a second `
35
- + `argument of one of the following value: on, off.`);
32
+ else if (options.settingOrProject == analytics_2.SettingOrProject.Project &&
33
+ options.projectSetting === undefined) {
34
+ this.logger.error(`Argument ${JSON.stringify(options.settingOrProject)} requires a second ` +
35
+ `argument of one of the following value: on, off.`);
36
36
  return 2;
37
37
  }
38
38
  try {
@@ -1,7 +1,8 @@
1
- The value of *settingOrProject* is one of the following.
2
- * "on" : Enables analytics gathering and reporting for the user.
3
- * "off" : Disables analytics gathering and reporting for the user.
4
- * "ci" : Enables analytics and configures reporting for use with Continuous Integration,
5
- which uses a common CI user.
6
- * "prompt" : Prompts the user to set the status interactively.
7
- * "project" : Sets the default status for the project to the *projectSetting* value, which can be any of the other values. The *projectSetting* argument is ignored for all other values of *settingOrProject*.
1
+ The value of _settingOrProject_ is one of the following.
2
+
3
+ - "on" : Enables analytics gathering and reporting for the user.
4
+ - "off" : Disables analytics gathering and reporting for the user.
5
+ - "ci" : Enables analytics and configures reporting for use with Continuous Integration,
6
+ which uses a common CI user.
7
+ - "prompt" : Prompts the user to set the status interactively.
8
+ - "project" : Sets the default status for the project to the _projectSetting_ value, which can be any of the other values. The _projectSetting_ argument is ignored for all other values of _settingOrProject_.
@@ -14,13 +14,7 @@
14
14
  {
15
15
  "properties": {
16
16
  "settingOrProject": {
17
- "enum": [
18
- "on",
19
- "off",
20
- "ci",
21
- "project",
22
- "prompt"
23
- ],
17
+ "enum": ["on", "off", "ci", "project", "prompt"],
24
18
  "description": "Directly enables or disables all usage analytics for the user, or prompts the user to set the status interactively, or sets the default status for the project.",
25
19
  "$default": {
26
20
  "$source": "argv",
@@ -28,11 +22,7 @@
28
22
  }
29
23
  },
30
24
  "projectSetting": {
31
- "enum": [
32
- "on",
33
- "off",
34
- "prompt"
35
- ],
25
+ "enum": ["on", "off", "prompt"],
36
26
  "description": "Sets the default analytics enablement status for the project.",
37
27
  "$default": {
38
28
  "$source": "argv",
@@ -40,9 +30,7 @@
40
30
  }
41
31
  }
42
32
  },
43
- "required": [
44
- "settingOrProject"
45
- ]
33
+ "required": ["settingOrProject"]
46
34
  },
47
35
  { "$ref": "./definitions.json#/definitions/base" }
48
36
  ]
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BuildCommand = void 0;
11
11
  const architect_command_1 = require("../models/architect-command");
12
12
  class BuildCommand extends architect_command_1.ArchitectCommand {
13
13
  constructor() {
@@ -4,7 +4,7 @@
4
4
  "description": "Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.",
5
5
  "$longDescription": "./build-long.md",
6
6
 
7
- "$aliases": [ "b" ],
7
+ "$aliases": ["b"],
8
8
  "$scope": "in",
9
9
  "$type": "architect",
10
10
  "$impl": "./build-impl#BuildCommand",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -9,7 +9,7 @@ import { Command } from '../models/command';
9
9
  import { Arguments } from '../models/interface';
10
10
  import { Schema as ConfigCommandSchema } from './config';
11
11
  export declare class ConfigCommand extends Command<ConfigCommandSchema> {
12
- run(options: ConfigCommandSchema & Arguments): Promise<0 | 1>;
12
+ run(options: ConfigCommandSchema & Arguments): Promise<1 | 0>;
13
13
  private get;
14
14
  private set;
15
15
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -20,7 +20,7 @@ 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}` : uuid_1.v4()],
23
+ ['cli.analyticsSharing.uuid', (v) => (v ? `${v}` : uuid_1.v4())],
24
24
  ]);
25
25
  /**
26
26
  * Splits a JSON path string into fragments. Fragments can be used to get the value referenced
@@ -47,24 +47,29 @@ function parseJsonPath(path) {
47
47
  const indices = match[2]
48
48
  .slice(1, -1)
49
49
  .split('][')
50
- .map(x => (/^\d$/.test(x) ? +x : x.replace(/\"|\'/g, '')));
50
+ .map((x) => (/^\d$/.test(x) ? +x : x.replace(/\"|\'/g, '')));
51
51
  result.push(...indices);
52
52
  }
53
53
  }
54
- return result.filter(fragment => fragment != null);
54
+ return result.filter((fragment) => fragment != null);
55
55
  }
56
56
  function normalizeValue(value) {
57
+ var _a, _b;
57
58
  const valueString = `${value}`.trim();
58
- if (valueString === 'true') {
59
- return true;
59
+ switch (valueString) {
60
+ case 'true':
61
+ return true;
62
+ case 'false':
63
+ return false;
64
+ case 'null':
65
+ return null;
66
+ case 'undefined':
67
+ return undefined;
60
68
  }
61
- else if (valueString === 'false') {
62
- return false;
63
- }
64
- else if (isFinite(+valueString)) {
69
+ if (isFinite(+valueString)) {
65
70
  return +valueString;
66
71
  }
67
- return value || undefined;
72
+ return (_b = (_a = json_file_1.parseJson(valueString)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : undefined;
68
73
  }
69
74
  class ConfigCommand extends command_1.Command {
70
75
  async run(options) {
@@ -10,4 +10,4 @@ while on the command line options can be given in either camelCase or dash-case.
10
10
 
11
11
  For further details, see [Workspace Configuration](guide/workspace-config).
12
12
 
13
- For configuration of CLI usage analytics, see [Gathering an Viewing CLI Usage Analytics](./usage-analytics-gathering).
13
+ For configuration of CLI usage analytics, see [Gathering an Viewing CLI Usage Analytics](./usage-analytics-gathering).
@@ -36,8 +36,7 @@
36
36
  "aliases": ["g"]
37
37
  }
38
38
  },
39
- "required": [
40
- ]
39
+ "required": []
41
40
  },
42
41
  { "$ref": "./definitions.json#/definitions/base" }
43
42
  ]
@@ -16,9 +16,7 @@
16
16
  "configuration": {
17
17
  "description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.\nSetting this explicitly overrides the \"--prod\" flag.",
18
18
  "type": "string",
19
- "aliases": [
20
- "c"
21
- ]
19
+ "aliases": ["c"]
22
20
  },
23
21
  "prod": {
24
22
  "description": "Shorthand for \"--configuration=production\".\nSet the build configuration to the production target.\nBy default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.",
@@ -43,13 +41,13 @@
43
41
  "dryRun": {
44
42
  "type": "boolean",
45
43
  "default": false,
46
- "aliases": [ "d" ],
44
+ "aliases": ["d"],
47
45
  "description": "Run through and reports activity without writing out results."
48
46
  },
49
47
  "force": {
50
48
  "type": "boolean",
51
49
  "default": false,
52
- "aliases": [ "f" ],
50
+ "aliases": ["f"],
53
51
  "description": "Force overwriting of existing files."
54
52
  }
55
53
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeployCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DeployCommand = void 0;
11
11
  const architect_command_1 = require("../models/architect-command");
12
12
  const BuilderMissing = `
13
13
  Cannot find "deploy" target for the specified project.
@@ -19,4 +19,4 @@ For example:
19
19
  }
20
20
  }
21
21
  }
22
- ```
22
+ ```
@@ -22,9 +22,7 @@
22
22
  "configuration": {
23
23
  "description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.",
24
24
  "type": "string",
25
- "aliases": [
26
- "c"
27
- ]
25
+ "aliases": ["c"]
28
26
  }
29
27
  },
30
28
  "required": []
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -35,7 +35,7 @@ class DocCommand extends command_1.Command {
35
35
  // we try to get the current Angular version of the project
36
36
  // and use it if we can find it
37
37
  try {
38
- /* tslint:disable-next-line:no-implicit-dependencies */
38
+ /* eslint-disable-next-line import/no-extraneous-dependencies */
39
39
  const currentNgVersion = (await Promise.resolve().then(() => require('@angular/core'))).VERSION.major;
40
40
  domain = `v${currentNgVersion}.angular.io`;
41
41
  }