@angular/cli 13.3.3 → 14.0.0-next.10

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 (240) hide show
  1. package/bin/ng.js +3 -5
  2. package/lib/cli/index.d.ts +1 -2
  3. package/lib/cli/index.js +16 -45
  4. package/lib/config/schema.json +136 -77
  5. package/lib/config/workspace-schema.d.ts +5 -0
  6. package/lib/init.js +5 -8
  7. package/package.json +21 -23
  8. package/{models → src/analytics}/analytics-collector.d.ts +0 -0
  9. package/{models → src/analytics}/analytics-collector.js +1 -1
  10. package/src/analytics/analytics.d.ts +47 -0
  11. package/src/analytics/analytics.js +306 -0
  12. package/src/command-builder/architect-base-command-module.d.ts +30 -0
  13. package/src/command-builder/architect-base-command-module.js +165 -0
  14. package/src/command-builder/architect-command-module.d.ts +25 -0
  15. package/src/command-builder/architect-command-module.js +134 -0
  16. package/src/command-builder/command-module.d.ts +89 -0
  17. package/src/command-builder/command-module.js +198 -0
  18. package/{utilities/package-json.js → src/command-builder/command-runner.d.ts} +2 -2
  19. package/src/command-builder/command-runner.js +168 -0
  20. package/src/command-builder/schematics-command-module.d.ts +43 -0
  21. package/src/command-builder/schematics-command-module.js +333 -0
  22. package/src/command-builder/utilities/command.d.ts +13 -0
  23. package/src/command-builder/utilities/command.js +27 -0
  24. package/src/command-builder/utilities/json-help.d.ts +36 -0
  25. package/src/command-builder/utilities/json-help.js +94 -0
  26. package/src/command-builder/utilities/json-schema.d.ts +40 -0
  27. package/{utilities → src/command-builder/utilities}/json-schema.js +20 -121
  28. package/src/command-builder/utilities/normalize-options-middleware.d.ts +18 -0
  29. package/src/command-builder/utilities/normalize-options-middleware.js +59 -0
  30. package/{models → src/command-builder/utilities}/schematic-engine-host.d.ts +2 -2
  31. package/{models → src/command-builder/utilities}/schematic-engine-host.js +30 -17
  32. package/src/command-builder/utilities/schematic-workflow.d.ts +14 -0
  33. package/src/command-builder/utilities/schematic-workflow.js +68 -0
  34. package/src/commands/add/cli.d.ts +33 -0
  35. package/{commands/add-impl.js → src/commands/add/cli.js} +108 -80
  36. package/src/commands/add/long-description.md +7 -0
  37. package/src/commands/analytics/cli.d.ts +16 -0
  38. package/src/commands/analytics/cli.js +35 -0
  39. package/src/commands/analytics/info/cli.d.ts +16 -0
  40. package/src/commands/analytics/info/cli.js +26 -0
  41. package/src/commands/analytics/settings/cli.d.ts +35 -0
  42. package/src/commands/analytics/settings/cli.js +61 -0
  43. package/src/commands/build/cli.d.ts +16 -0
  44. package/src/commands/build/cli.js +23 -0
  45. package/{commands/build-long.md → src/commands/build/long-description.md} +0 -0
  46. package/src/commands/cache/clean/cli.d.ts +17 -0
  47. package/src/commands/cache/clean/cli.js +32 -0
  48. package/src/commands/cache/cli.d.ts +17 -0
  49. package/src/commands/cache/cli.js +38 -0
  50. package/src/commands/cache/info/cli.d.ts +20 -0
  51. package/src/commands/cache/info/cli.js +82 -0
  52. package/src/commands/cache/long-description.md +53 -0
  53. package/src/commands/cache/settings/cli.d.ts +27 -0
  54. package/src/commands/cache/settings/cli.js +42 -0
  55. package/src/commands/cache/utilities.d.ts +11 -0
  56. package/src/commands/cache/utilities.js +49 -0
  57. package/src/commands/completion/cli.d.ts +16 -0
  58. package/src/commands/completion/cli.js +31 -0
  59. package/src/commands/completion/long-description.md +1 -0
  60. package/src/commands/config/cli.d.ts +24 -0
  61. package/src/commands/config/cli.js +168 -0
  62. package/{commands/config-long.md → src/commands/config/long-description.md} +2 -2
  63. package/src/commands/deploy/cli.d.ts +17 -0
  64. package/src/commands/deploy/cli.js +49 -0
  65. package/{commands/deploy-long.md → src/commands/deploy/long-description.md} +0 -0
  66. package/src/commands/doc/cli.d.ts +23 -0
  67. package/{commands/doc-impl.js → src/commands/doc/cli.js} +36 -11
  68. package/src/commands/e2e/cli.d.ts +18 -0
  69. package/src/commands/e2e/cli.js +35 -0
  70. package/src/commands/extract-i18n/cli.d.ts +15 -0
  71. package/src/commands/extract-i18n/cli.js +20 -0
  72. package/src/commands/generate/cli.d.ts +39 -0
  73. package/src/commands/generate/cli.js +145 -0
  74. package/src/commands/lint/cli.d.ts +17 -0
  75. package/src/commands/lint/cli.js +28 -0
  76. package/{commands/lint-long.md → src/commands/lint/long-description.md} +0 -0
  77. package/src/commands/make-this-awesome/cli.d.ts +17 -0
  78. package/{commands/easter-egg-impl.js → src/commands/make-this-awesome/cli.js} +17 -10
  79. package/src/commands/new/cli.d.ts +27 -0
  80. package/src/commands/new/cli.js +82 -0
  81. package/src/commands/run/cli.d.ts +25 -0
  82. package/src/commands/run/cli.js +83 -0
  83. package/{commands/run-long.md → src/commands/run/long-description.md} +0 -0
  84. package/src/commands/serve/cli.d.ts +16 -0
  85. package/src/commands/serve/cli.js +21 -0
  86. package/src/commands/test/cli.d.ts +16 -0
  87. package/src/commands/test/cli.js +23 -0
  88. package/{commands/test-long.md → src/commands/test/long-description.md} +0 -0
  89. package/{commands/update-impl.d.ts → src/commands/update/cli.d.ts} +26 -9
  90. package/{commands/update-impl.js → src/commands/update/cli.js} +357 -325
  91. package/{commands/update-long.md → src/commands/update/long-description.md} +0 -0
  92. package/src/commands/update/schematic/index.js +29 -22
  93. package/src/commands/version/cli.d.ts +18 -0
  94. package/{commands/version-impl.js → src/commands/version/cli.js} +56 -74
  95. package/src/typings-bazel.d.ts +14 -0
  96. package/src/typings.d.ts +1 -14
  97. package/{utilities → src/utilities}/color.d.ts +0 -0
  98. package/{utilities → src/utilities}/color.js +0 -0
  99. package/{utilities → src/utilities}/config.d.ts +7 -6
  100. package/{utilities → src/utilities}/config.js +34 -92
  101. package/src/utilities/environment-options.d.ts +12 -0
  102. package/src/utilities/environment-options.js +24 -0
  103. package/{utilities → src/utilities}/find-up.d.ts +0 -0
  104. package/{utilities → src/utilities}/find-up.js +0 -0
  105. package/{utilities → src/utilities}/json-file.d.ts +0 -0
  106. package/{utilities → src/utilities}/json-file.js +1 -0
  107. package/{utilities → src/utilities}/log-file.d.ts +0 -0
  108. package/{utilities → src/utilities}/log-file.js +0 -0
  109. package/src/utilities/memoize.d.ts +15 -0
  110. package/src/utilities/memoize.js +69 -0
  111. package/src/utilities/package-manager.d.ts +41 -0
  112. package/src/utilities/package-manager.js +287 -0
  113. package/{utilities → src/utilities}/package-metadata.d.ts +15 -37
  114. package/{utilities → src/utilities}/package-metadata.js +10 -26
  115. package/{utilities → src/utilities}/package-tree.d.ts +2 -2
  116. package/{utilities → src/utilities}/package-tree.js +0 -0
  117. package/{utilities → src/utilities}/project.d.ts +0 -0
  118. package/{utilities → src/utilities}/project.js +1 -6
  119. package/{utilities → src/utilities}/prompt.d.ts +2 -0
  120. package/{utilities → src/utilities}/prompt.js +20 -3
  121. package/{utilities → src/utilities}/spinner.d.ts +0 -0
  122. package/{utilities → src/utilities}/spinner.js +0 -0
  123. package/{utilities → src/utilities}/tty.d.ts +0 -0
  124. package/{utilities → src/utilities}/tty.js +0 -0
  125. package/{models → src/utilities}/version.d.ts +2 -1
  126. package/{models → src/utilities}/version.js +6 -6
  127. package/bin/postinstall/analytics-prompt.js +0 -27
  128. package/bin/postinstall/script.js +0 -16
  129. package/commands/add-impl.d.ts +0 -21
  130. package/commands/add.d.ts +0 -42
  131. package/commands/add.js +0 -10
  132. package/commands/add.json +0 -54
  133. package/commands/add.md +0 -10
  134. package/commands/analytics-impl.d.ts +0 -13
  135. package/commands/analytics-impl.js +0 -80
  136. package/commands/analytics-long.md +0 -8
  137. package/commands/analytics.d.ts +0 -46
  138. package/commands/analytics.js +0 -31
  139. package/commands/analytics.json +0 -37
  140. package/commands/build-impl.d.ts +0 -14
  141. package/commands/build-impl.js +0 -21
  142. package/commands/build.d.ts +0 -38
  143. package/commands/build.js +0 -10
  144. package/commands/build.json +0 -16
  145. package/commands/config-impl.d.ts +0 -15
  146. package/commands/config-impl.js +0 -167
  147. package/commands/config.d.ts +0 -34
  148. package/commands/config.js +0 -10
  149. package/commands/config.json +0 -43
  150. package/commands/definitions.json +0 -71
  151. package/commands/deploy-impl.d.ts +0 -15
  152. package/commands/deploy-impl.js +0 -36
  153. package/commands/deploy.d.ts +0 -30
  154. package/commands/deploy.js +0 -10
  155. package/commands/deploy.json +0 -34
  156. package/commands/doc-impl.d.ts +0 -13
  157. package/commands/doc.d.ts +0 -39
  158. package/commands/doc.js +0 -14
  159. package/commands/doc.json +0 -46
  160. package/commands/e2e-impl.d.ts +0 -16
  161. package/commands/e2e-impl.js +0 -36
  162. package/commands/e2e-long.md +0 -4
  163. package/commands/e2e.d.ts +0 -37
  164. package/commands/e2e.js +0 -10
  165. package/commands/e2e.json +0 -17
  166. package/commands/easter-egg-impl.d.ts +0 -12
  167. package/commands/easter-egg.d.ts +0 -14
  168. package/commands/easter-egg.js +0 -10
  169. package/commands/easter-egg.json +0 -12
  170. package/commands/extract-i18n-impl.d.ts +0 -14
  171. package/commands/extract-i18n-impl.js +0 -32
  172. package/commands/extract-i18n.d.ts +0 -37
  173. package/commands/extract-i18n.js +0 -10
  174. package/commands/extract-i18n.json +0 -17
  175. package/commands/generate-impl.d.ts +0 -18
  176. package/commands/generate-impl.js +0 -89
  177. package/commands/generate.d.ts +0 -37
  178. package/commands/generate.js +0 -10
  179. package/commands/generate.json +0 -31
  180. package/commands/help-impl.d.ts +0 -12
  181. package/commands/help-impl.js +0 -26
  182. package/commands/help-long.md +0 -7
  183. package/commands/help.d.ts +0 -17
  184. package/commands/help.js +0 -10
  185. package/commands/help.json +0 -13
  186. package/commands/lint-impl.d.ts +0 -16
  187. package/commands/lint-impl.js +0 -74
  188. package/commands/lint.d.ts +0 -29
  189. package/commands/lint.js +0 -10
  190. package/commands/lint.json +0 -36
  191. package/commands/new-impl.d.ts +0 -16
  192. package/commands/new-impl.js +0 -37
  193. package/commands/new.d.ts +0 -41
  194. package/commands/new.js +0 -10
  195. package/commands/new.json +0 -34
  196. package/commands/new.md +0 -16
  197. package/commands/run-impl.d.ts +0 -13
  198. package/commands/run-impl.js +0 -22
  199. package/commands/run.d.ts +0 -30
  200. package/commands/run.js +0 -10
  201. package/commands/run.json +0 -36
  202. package/commands/serve-impl.d.ts +0 -15
  203. package/commands/serve-impl.js +0 -24
  204. package/commands/serve.d.ts +0 -37
  205. package/commands/serve.js +0 -10
  206. package/commands/serve.json +0 -17
  207. package/commands/test-impl.d.ts +0 -15
  208. package/commands/test-impl.js +0 -22
  209. package/commands/test.d.ts +0 -37
  210. package/commands/test.js +0 -10
  211. package/commands/test.json +0 -17
  212. package/commands/update.d.ts +0 -65
  213. package/commands/update.js +0 -10
  214. package/commands/update.json +0 -84
  215. package/commands/version-impl.d.ts +0 -17
  216. package/commands/version.d.ts +0 -17
  217. package/commands/version.js +0 -10
  218. package/commands/version.json +0 -13
  219. package/commands.json +0 -20
  220. package/models/analytics.d.ts +0 -58
  221. package/models/analytics.js +0 -362
  222. package/models/architect-command.d.ts +0 -35
  223. package/models/architect-command.js +0 -392
  224. package/models/command-runner.d.ts +0 -24
  225. package/models/command-runner.js +0 -245
  226. package/models/command.d.ts +0 -34
  227. package/models/command.js +0 -143
  228. package/models/interface.d.ts +0 -196
  229. package/models/interface.js +0 -31
  230. package/models/parser.d.ts +0 -39
  231. package/models/parser.js +0 -349
  232. package/models/schematic-command.d.ts +0 -55
  233. package/models/schematic-command.js +0 -489
  234. package/utilities/INITIAL_COMMIT_MESSAGE.txt +0 -8
  235. package/utilities/install-package.d.ts +0 -16
  236. package/utilities/install-package.js +0 -193
  237. package/utilities/json-schema.d.ts +0 -17
  238. package/utilities/package-json.d.ts +0 -249
  239. package/utilities/package-manager.d.ts +0 -15
  240. package/utilities/package-manager.js +0 -83
@@ -30,8 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
30
30
  return result;
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.askConfirmation = void 0;
34
- const inquirer = __importStar(require("inquirer"));
33
+ exports.askQuestion = exports.askConfirmation = void 0;
35
34
  const tty_1 = require("./tty");
36
35
  async function askConfirmation(message, defaultResponse, noTTYResponse) {
37
36
  if (!(0, tty_1.isTTY)()) {
@@ -44,7 +43,25 @@ async function askConfirmation(message, defaultResponse, noTTYResponse) {
44
43
  message,
45
44
  default: defaultResponse,
46
45
  };
47
- const answers = await inquirer.prompt([question]);
46
+ const { prompt } = await Promise.resolve().then(() => __importStar(require('inquirer')));
47
+ const answers = await prompt([question]);
48
48
  return answers['confirmation'];
49
49
  }
50
50
  exports.askConfirmation = askConfirmation;
51
+ async function askQuestion(message, choices, defaultResponseIndex, noTTYResponse) {
52
+ if (!(0, tty_1.isTTY)()) {
53
+ return noTTYResponse;
54
+ }
55
+ const question = {
56
+ type: 'list',
57
+ name: 'answer',
58
+ prefix: '',
59
+ message,
60
+ choices,
61
+ default: defaultResponseIndex,
62
+ };
63
+ const { prompt } = await Promise.resolve().then(() => __importStar(require('inquirer')));
64
+ const answers = await prompt([question]);
65
+ return answers['answer'];
66
+ }
67
+ exports.askQuestion = askQuestion;
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@
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
7
7
  */
8
- export declare class Version {
8
+ declare class Version {
9
9
  readonly full: string;
10
10
  readonly major: string;
11
11
  readonly minor: string;
@@ -13,3 +13,4 @@ export declare class Version {
13
13
  constructor(full: string);
14
14
  }
15
15
  export declare const VERSION: Version;
16
+ export {};
@@ -7,19 +7,19 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.VERSION = exports.Version = void 0;
10
+ exports.VERSION = void 0;
11
11
  const fs_1 = require("fs");
12
12
  const path_1 = require("path");
13
13
  // Same structure as used in framework packages
14
14
  class Version {
15
15
  constructor(full) {
16
16
  this.full = full;
17
- this.major = full.split('.')[0];
18
- this.minor = full.split('.')[1];
19
- this.patch = full.split('.').slice(2).join('.');
17
+ const [major, minor, patch] = full.split('-', 1)[0].split('.', 3);
18
+ this.major = major;
19
+ this.minor = minor;
20
+ this.patch = patch;
20
21
  }
21
22
  }
22
- exports.Version = Version;
23
23
  // TODO: Convert this to use build-time version stamping after flipping the build script to use bazel
24
24
  // export const VERSION = new Version('0.0.0-PLACEHOLDER');
25
- exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../package.json'), 'utf-8')).version);
25
+ exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);
@@ -1,27 +0,0 @@
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
- */
8
-
9
- 'use strict';
10
- // This file is ES5 because it needs to be executed as is.
11
-
12
- if ('NG_CLI_ANALYTICS' in process.env) {
13
- return;
14
- }
15
-
16
- try {
17
- var analytics = require('../../models/analytics');
18
-
19
- analytics
20
- .hasGlobalAnalyticsConfiguration()
21
- .then((hasGlobalConfig) => {
22
- if (!hasGlobalConfig) {
23
- return analytics.promptGlobalAnalytics();
24
- }
25
- })
26
- .catch(() => {});
27
- } catch (_) {}
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
-
10
- 'use strict';
11
-
12
- // These should not fail but if they do they should not block installation of the package
13
- try {
14
- // eslint-disable-next-line import/no-unassigned-import
15
- require('./analytics-prompt');
16
- } catch (_) {}
@@ -1,21 +0,0 @@
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
- */
8
- import { Arguments } from '../models/interface';
9
- import { SchematicCommand } from '../models/schematic-command';
10
- import { Schema as AddCommandSchema } from './add';
11
- export declare class AddCommand extends SchematicCommand<AddCommandSchema> {
12
- readonly allowPrivateSchematics = true;
13
- initialize(options: AddCommandSchema & Arguments): Promise<void>;
14
- run(options: AddCommandSchema & Arguments): Promise<number | void>;
15
- private isProjectVersionValid;
16
- reportAnalytics(paths: string[], options: AddCommandSchema & Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
17
- private isPackageInstalled;
18
- private executeSchematic;
19
- private findProjectVersion;
20
- private hasMismatchedPeer;
21
- }
package/commands/add.d.ts DELETED
@@ -1,42 +0,0 @@
1
- /**
2
- * Adds support for an external library to your project.
3
- */
4
- export interface Schema {
5
- /**
6
- * The package to be added.
7
- */
8
- collection?: string;
9
- /**
10
- * Disable interactive input prompts for options with a default.
11
- */
12
- defaults?: boolean;
13
- /**
14
- * Shows a help message for this command in the console.
15
- */
16
- help?: HelpUnion;
17
- /**
18
- * Enable interactive input prompts.
19
- */
20
- interactive?: boolean;
21
- /**
22
- * The NPM registry to use.
23
- */
24
- registry?: string;
25
- /**
26
- * Skip asking a confirmation prompt before installing and executing the package. Ensure
27
- * package name is correct prior to using this option.
28
- */
29
- skipConfirmation?: boolean;
30
- /**
31
- * Display additional details about internal operations during execution.
32
- */
33
- verbose?: boolean;
34
- }
35
- /**
36
- * Shows a help message for this command in the console.
37
- */
38
- export declare type HelpUnion = boolean | HelpEnum;
39
- export declare enum HelpEnum {
40
- HelpJson = "JSON",
41
- Json = "json"
42
- }
package/commands/add.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
- // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.HelpEnum = void 0;
6
- var HelpEnum;
7
- (function (HelpEnum) {
8
- HelpEnum["HelpJson"] = "JSON";
9
- HelpEnum["Json"] = "json";
10
- })(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
package/commands/add.json DELETED
@@ -1,54 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/add.json",
4
- "description": "Adds support for an external library to your project.",
5
- "$longDescription": "./add.md",
6
-
7
- "$scope": "in",
8
- "$impl": "./add-impl#AddCommand",
9
-
10
- "type": "object",
11
- "allOf": [
12
- {
13
- "properties": {
14
- "collection": {
15
- "type": "string",
16
- "description": "The package to be added.",
17
- "$default": {
18
- "$source": "argv",
19
- "index": 0
20
- }
21
- },
22
- "registry": {
23
- "description": "The NPM registry to use.",
24
- "type": "string",
25
- "oneOf": [
26
- {
27
- "format": "uri"
28
- },
29
- {
30
- "format": "hostname"
31
- }
32
- ]
33
- },
34
- "verbose": {
35
- "description": "Display additional details about internal operations during execution.",
36
- "type": "boolean",
37
- "default": false
38
- },
39
- "skipConfirmation": {
40
- "description": "Skip asking a confirmation prompt before installing and executing the package. Ensure package name is correct prior to using this option.",
41
- "type": "boolean",
42
- "default": false
43
- }
44
- },
45
- "required": []
46
- },
47
- {
48
- "$ref": "./definitions.json#/definitions/interactive"
49
- },
50
- {
51
- "$ref": "./definitions.json#/definitions/base"
52
- }
53
- ]
54
- }
package/commands/add.md DELETED
@@ -1,10 +0,0 @@
1
- Adds the npm package for a published library to your workspace, and configures
2
- the project in the current working directory (or the default project if you are
3
- not in a project directory) to use that library, as specified by the library's schematic.
4
- For example, adding `@angular/pwa` configures your project for PWA support:
5
-
6
- ```bash
7
- ng add @angular/pwa
8
- ```
9
-
10
- The default project is the value of `defaultProject` in `angular.json`.
@@ -1,13 +0,0 @@
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
- */
8
- import { Command } from '../models/command';
9
- import { Arguments } from '../models/interface';
10
- import { Schema as AnalyticsCommandSchema } from './analytics';
11
- export declare class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
12
- run(options: AnalyticsCommandSchema & Arguments): Promise<0 | 1 | 2 | 3 | 4>;
13
- }
@@ -1,80 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.AnalyticsCommand = void 0;
11
- const analytics_1 = require("../models/analytics");
12
- const command_1 = require("../models/command");
13
- const analytics_2 = require("./analytics");
14
- class AnalyticsCommand extends command_1.Command {
15
- async run(options) {
16
- // Our parser does not support positional enums (won't report invalid parameters). Do the
17
- // validation manually.
18
- // TODO(hansl): fix parser to better support positionals. This would be a breaking change.
19
- if (options.settingOrProject === undefined) {
20
- if (options['--']) {
21
- // The user passed positional arguments but they didn't validate.
22
- this.logger.error(`Argument ${JSON.stringify(options['--'][0])} is invalid.`);
23
- this.logger.error(`Please provide one of the following value: on, off, ci or project.`);
24
- return 1;
25
- }
26
- else {
27
- // No argument were passed.
28
- await this.printHelp();
29
- return 2;
30
- }
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.`);
36
- return 2;
37
- }
38
- try {
39
- switch (options.settingOrProject) {
40
- case analytics_2.SettingOrProject.Off:
41
- (0, analytics_1.setAnalyticsConfig)('global', false);
42
- break;
43
- case analytics_2.SettingOrProject.On:
44
- (0, analytics_1.setAnalyticsConfig)('global', true);
45
- break;
46
- case analytics_2.SettingOrProject.Ci:
47
- (0, analytics_1.setAnalyticsConfig)('global', 'ci');
48
- break;
49
- case analytics_2.SettingOrProject.Project:
50
- switch (options.projectSetting) {
51
- case analytics_2.ProjectSetting.Off:
52
- (0, analytics_1.setAnalyticsConfig)('local', false);
53
- break;
54
- case analytics_2.ProjectSetting.On:
55
- (0, analytics_1.setAnalyticsConfig)('local', true);
56
- break;
57
- case analytics_2.ProjectSetting.Prompt:
58
- await (0, analytics_1.promptProjectAnalytics)(true);
59
- break;
60
- default:
61
- await this.printHelp();
62
- return 3;
63
- }
64
- break;
65
- case analytics_2.SettingOrProject.Prompt:
66
- await (0, analytics_1.promptGlobalAnalytics)(true);
67
- break;
68
- default:
69
- await this.printHelp();
70
- return 4;
71
- }
72
- }
73
- catch (err) {
74
- this.logger.fatal(err.message);
75
- return 1;
76
- }
77
- return 0;
78
- }
79
- }
80
- exports.AnalyticsCommand = AnalyticsCommand;
@@ -1,8 +0,0 @@
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_.
@@ -1,46 +0,0 @@
1
- /**
2
- * Configures the gathering of Angular CLI usage metrics. See
3
- * https://angular.io/cli/usage-analytics-gathering.
4
- */
5
- export interface Schema {
6
- /**
7
- * Shows a help message for this command in the console.
8
- */
9
- help?: HelpUnion;
10
- /**
11
- * Sets the default analytics enablement status for the project.
12
- */
13
- projectSetting?: ProjectSetting;
14
- /**
15
- * Directly enables or disables all usage analytics for the user, or prompts the user to set
16
- * the status interactively, or sets the default status for the project.
17
- */
18
- settingOrProject: SettingOrProject;
19
- }
20
- /**
21
- * Shows a help message for this command in the console.
22
- */
23
- export declare type HelpUnion = boolean | HelpEnum;
24
- export declare enum HelpEnum {
25
- HelpJson = "JSON",
26
- Json = "json"
27
- }
28
- /**
29
- * Sets the default analytics enablement status for the project.
30
- */
31
- export declare enum ProjectSetting {
32
- Off = "off",
33
- On = "on",
34
- Prompt = "prompt"
35
- }
36
- /**
37
- * Directly enables or disables all usage analytics for the user, or prompts the user to set
38
- * the status interactively, or sets the default status for the project.
39
- */
40
- export declare enum SettingOrProject {
41
- Ci = "ci",
42
- Off = "off",
43
- On = "on",
44
- Project = "project",
45
- Prompt = "prompt"
46
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
- // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.SettingOrProject = exports.ProjectSetting = exports.HelpEnum = void 0;
6
- var HelpEnum;
7
- (function (HelpEnum) {
8
- HelpEnum["HelpJson"] = "JSON";
9
- HelpEnum["Json"] = "json";
10
- })(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
11
- /**
12
- * Sets the default analytics enablement status for the project.
13
- */
14
- var ProjectSetting;
15
- (function (ProjectSetting) {
16
- ProjectSetting["Off"] = "off";
17
- ProjectSetting["On"] = "on";
18
- ProjectSetting["Prompt"] = "prompt";
19
- })(ProjectSetting = exports.ProjectSetting || (exports.ProjectSetting = {}));
20
- /**
21
- * Directly enables or disables all usage analytics for the user, or prompts the user to set
22
- * the status interactively, or sets the default status for the project.
23
- */
24
- var SettingOrProject;
25
- (function (SettingOrProject) {
26
- SettingOrProject["Ci"] = "ci";
27
- SettingOrProject["Off"] = "off";
28
- SettingOrProject["On"] = "on";
29
- SettingOrProject["Project"] = "project";
30
- SettingOrProject["Prompt"] = "prompt";
31
- })(SettingOrProject = exports.SettingOrProject || (exports.SettingOrProject = {}));
@@ -1,37 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/analytics.json",
4
- "description": "Configures the gathering of Angular CLI usage metrics. See https://angular.io/cli/usage-analytics-gathering.",
5
- "$longDescription": "./analytics-long.md",
6
-
7
- "$aliases": [],
8
- "$scope": "all",
9
- "$type": "native",
10
- "$impl": "./analytics-impl#AnalyticsCommand",
11
-
12
- "type": "object",
13
- "allOf": [
14
- {
15
- "properties": {
16
- "settingOrProject": {
17
- "enum": ["on", "off", "ci", "project", "prompt"],
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.",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 0
22
- }
23
- },
24
- "projectSetting": {
25
- "enum": ["on", "off", "prompt"],
26
- "description": "Sets the default analytics enablement status for the project.",
27
- "$default": {
28
- "$source": "argv",
29
- "index": 1
30
- }
31
- }
32
- },
33
- "required": ["settingOrProject"]
34
- },
35
- { "$ref": "./definitions.json#/definitions/base" }
36
- ]
37
- }
@@ -1,14 +0,0 @@
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
- */
8
- import { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
9
- import { Arguments } from '../models/interface';
10
- import { Schema as BuildCommandSchema } from './build';
11
- export declare class BuildCommand extends ArchitectCommand<BuildCommandSchema> {
12
- readonly target = "build";
13
- run(options: ArchitectCommandOptions & Arguments): Promise<number>;
14
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.BuildCommand = void 0;
11
- const architect_command_1 = require("../models/architect-command");
12
- class BuildCommand extends architect_command_1.ArchitectCommand {
13
- constructor() {
14
- super(...arguments);
15
- this.target = 'build';
16
- }
17
- async run(options) {
18
- return this.runArchitectTarget(options);
19
- }
20
- }
21
- exports.BuildCommand = BuildCommand;
@@ -1,38 +0,0 @@
1
- /**
2
- * Compiles an Angular app into an output directory named dist/ at the given output path.
3
- * Must be executed from within a workspace directory.
4
- */
5
- export interface Schema {
6
- /**
7
- * One or more named builder configurations as a comma-separated list as specified in the
8
- * "configurations" section of angular.json.
9
- * The builder uses the named configurations to run the given target.
10
- * For more information, see
11
- * https://angular.io/guide/workspace-config#alternate-build-configurations.
12
- * Setting this explicitly overrides the "--prod" flag.
13
- */
14
- configuration?: string;
15
- /**
16
- * Shows a help message for this command in the console.
17
- */
18
- help?: HelpUnion;
19
- /**
20
- * Shorthand for "--configuration=production".
21
- * Set the build configuration to the production target.
22
- * By default, the production target is set up in the workspace configuration such that all
23
- * builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
24
- */
25
- prod?: boolean;
26
- /**
27
- * The name of the project to build. Can be an application or a library.
28
- */
29
- project?: string;
30
- }
31
- /**
32
- * Shows a help message for this command in the console.
33
- */
34
- export declare type HelpUnion = boolean | HelpEnum;
35
- export declare enum HelpEnum {
36
- HelpJson = "JSON",
37
- Json = "json"
38
- }
package/commands/build.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
- // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.HelpEnum = void 0;
6
- var HelpEnum;
7
- (function (HelpEnum) {
8
- HelpEnum["HelpJson"] = "JSON";
9
- HelpEnum["Json"] = "json";
10
- })(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
@@ -1,16 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/build.json",
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
- "$longDescription": "./build-long.md",
6
-
7
- "$aliases": ["b"],
8
- "$scope": "in",
9
- "$type": "architect",
10
- "$impl": "./build-impl#BuildCommand",
11
-
12
- "allOf": [
13
- { "$ref": "./definitions.json#/definitions/architect" },
14
- { "$ref": "./definitions.json#/definitions/base" }
15
- ]
16
- }
@@ -1,15 +0,0 @@
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
- */
8
- import { Command } from '../models/command';
9
- import { Arguments } from '../models/interface';
10
- import { Schema as ConfigCommandSchema } from './config';
11
- export declare class ConfigCommand extends Command<ConfigCommandSchema> {
12
- run(options: ConfigCommandSchema & Arguments): Promise<0 | 1>;
13
- private get;
14
- private set;
15
- }