@angular/cli 14.0.0-next.1 → 14.0.0-next.12

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 (239) 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 +48 -15
  5. package/lib/config/workspace-schema.d.ts +18 -1
  6. package/lib/init.js +10 -9
  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 +8 -2
  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 +33 -18
  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/{commands/config-impl.js → src/commands/config/cli.js} +102 -89
  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} +41 -12
  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} +363 -316
  91. package/{commands/update-long.md → src/commands/update/long-description.md} +0 -0
  92. package/src/commands/update/schematic/index.js +33 -20
  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 +5 -1
  99. package/{utilities → src/utilities}/config.d.ts +6 -5
  100. package/{utilities → src/utilities}/config.js +33 -19
  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 +5 -1
  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 +15 -27
  115. package/{utilities → src/utilities}/package-tree.d.ts +2 -2
  116. package/{utilities → src/utilities}/package-tree.js +5 -1
  117. package/{utilities → src/utilities}/project.d.ts +0 -0
  118. package/{utilities → src/utilities}/project.js +5 -1
  119. package/{utilities → src/utilities}/prompt.d.ts +2 -0
  120. package/{utilities → src/utilities}/prompt.js +25 -4
  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 -30
  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.d.ts +0 -34
  147. package/commands/config.js +0 -10
  148. package/commands/config.json +0 -43
  149. package/commands/definitions.json +0 -66
  150. package/commands/deploy-impl.d.ts +0 -15
  151. package/commands/deploy-impl.js +0 -36
  152. package/commands/deploy.d.ts +0 -30
  153. package/commands/deploy.js +0 -10
  154. package/commands/deploy.json +0 -34
  155. package/commands/doc-impl.d.ts +0 -13
  156. package/commands/doc.d.ts +0 -39
  157. package/commands/doc.js +0 -14
  158. package/commands/doc.json +0 -46
  159. package/commands/e2e-impl.d.ts +0 -16
  160. package/commands/e2e-impl.js +0 -36
  161. package/commands/e2e-long.md +0 -4
  162. package/commands/e2e.d.ts +0 -29
  163. package/commands/e2e.js +0 -10
  164. package/commands/e2e.json +0 -17
  165. package/commands/easter-egg-impl.d.ts +0 -12
  166. package/commands/easter-egg.d.ts +0 -14
  167. package/commands/easter-egg.js +0 -10
  168. package/commands/easter-egg.json +0 -12
  169. package/commands/extract-i18n-impl.d.ts +0 -14
  170. package/commands/extract-i18n-impl.js +0 -32
  171. package/commands/extract-i18n.d.ts +0 -29
  172. package/commands/extract-i18n.js +0 -10
  173. package/commands/extract-i18n.json +0 -17
  174. package/commands/generate-impl.d.ts +0 -18
  175. package/commands/generate-impl.js +0 -89
  176. package/commands/generate.d.ts +0 -37
  177. package/commands/generate.js +0 -10
  178. package/commands/generate.json +0 -31
  179. package/commands/help-impl.d.ts +0 -12
  180. package/commands/help-impl.js +0 -26
  181. package/commands/help-long.md +0 -7
  182. package/commands/help.d.ts +0 -17
  183. package/commands/help.js +0 -10
  184. package/commands/help.json +0 -13
  185. package/commands/lint-impl.d.ts +0 -16
  186. package/commands/lint-impl.js +0 -69
  187. package/commands/lint.d.ts +0 -29
  188. package/commands/lint.js +0 -10
  189. package/commands/lint.json +0 -36
  190. package/commands/new-impl.d.ts +0 -16
  191. package/commands/new-impl.js +0 -37
  192. package/commands/new.d.ts +0 -41
  193. package/commands/new.js +0 -10
  194. package/commands/new.json +0 -34
  195. package/commands/new.md +0 -16
  196. package/commands/run-impl.d.ts +0 -13
  197. package/commands/run-impl.js +0 -22
  198. package/commands/run.d.ts +0 -30
  199. package/commands/run.js +0 -10
  200. package/commands/run.json +0 -36
  201. package/commands/serve-impl.d.ts +0 -15
  202. package/commands/serve-impl.js +0 -24
  203. package/commands/serve.d.ts +0 -29
  204. package/commands/serve.js +0 -10
  205. package/commands/serve.json +0 -17
  206. package/commands/test-impl.d.ts +0 -15
  207. package/commands/test-impl.js +0 -22
  208. package/commands/test.d.ts +0 -29
  209. package/commands/test.js +0 -10
  210. package/commands/test.json +0 -17
  211. package/commands/update.d.ts +0 -61
  212. package/commands/update.js +0 -10
  213. package/commands/update.json +0 -78
  214. package/commands/version-impl.d.ts +0 -17
  215. package/commands/version.d.ts +0 -17
  216. package/commands/version.js +0 -10
  217. package/commands/version.json +0 -13
  218. package/commands.json +0 -20
  219. package/models/analytics.d.ts +0 -58
  220. package/models/analytics.js +0 -358
  221. package/models/architect-command.d.ts +0 -35
  222. package/models/architect-command.js +0 -364
  223. package/models/command-runner.d.ts +0 -24
  224. package/models/command-runner.js +0 -241
  225. package/models/command.d.ts +0 -34
  226. package/models/command.js +0 -143
  227. package/models/interface.d.ts +0 -196
  228. package/models/interface.js +0 -31
  229. package/models/parser.d.ts +0 -39
  230. package/models/parser.js +0 -349
  231. package/models/schematic-command.d.ts +0 -55
  232. package/models/schematic-command.js +0 -485
  233. package/utilities/INITIAL_COMMIT_MESSAGE.txt +0 -8
  234. package/utilities/install-package.d.ts +0 -16
  235. package/utilities/install-package.js +0 -193
  236. package/utilities/json-schema.d.ts +0 -17
  237. package/utilities/package-json.d.ts +0 -249
  238. package/utilities/package-manager.d.ts +0 -13
  239. package/utilities/package-manager.js +0 -106
@@ -1,89 +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.GenerateCommand = void 0;
11
- const schematic_command_1 = require("../models/schematic-command");
12
- const color_1 = require("../utilities/color");
13
- const json_schema_1 = require("../utilities/json-schema");
14
- class GenerateCommand extends schematic_command_1.SchematicCommand {
15
- async initialize(options) {
16
- // Fill up the schematics property of the command description.
17
- const [collectionName, schematicName] = await this.parseSchematicInfo(options);
18
- this.collectionName = collectionName;
19
- this.schematicName = schematicName;
20
- await super.initialize(options);
21
- const collection = this.getCollection(collectionName);
22
- const subcommands = {};
23
- const schematicNames = schematicName ? [schematicName] : collection.listSchematicNames();
24
- // Sort as a courtesy for the user.
25
- schematicNames.sort();
26
- for (const name of schematicNames) {
27
- const schematic = this.getSchematic(collection, name, true);
28
- this.longSchematicName = schematic.description.name;
29
- let subcommand;
30
- if (schematic.description.schemaJson) {
31
- subcommand = await (0, json_schema_1.parseJsonSchemaToSubCommandDescription)(name, schematic.description.path, this._workflow.registry, schematic.description.schemaJson);
32
- }
33
- else {
34
- continue;
35
- }
36
- if ((await this.getDefaultSchematicCollection()) == collectionName) {
37
- subcommands[name] = subcommand;
38
- }
39
- else {
40
- subcommands[`${collectionName}:${name}`] = subcommand;
41
- }
42
- }
43
- this.description.options.forEach((option) => {
44
- if (option.name == 'schematic') {
45
- option.subcommands = subcommands;
46
- }
47
- });
48
- }
49
- async run(options) {
50
- if (!this.schematicName || !this.collectionName) {
51
- return this.printHelp();
52
- }
53
- return this.runSchematic({
54
- collectionName: this.collectionName,
55
- schematicName: this.schematicName,
56
- schematicOptions: options['--'] || [],
57
- debug: !!options.debug || false,
58
- dryRun: !!options.dryRun || false,
59
- force: !!options.force || false,
60
- });
61
- }
62
- async reportAnalytics(paths, options) {
63
- if (!this.collectionName || !this.schematicName) {
64
- return;
65
- }
66
- const escapedSchematicName = (this.longSchematicName || this.schematicName).replace(/\//g, '_');
67
- return super.reportAnalytics(['generate', this.collectionName.replace(/\//g, '_'), escapedSchematicName], options);
68
- }
69
- async parseSchematicInfo(options) {
70
- let collectionName = await this.getDefaultSchematicCollection();
71
- let schematicName = options.schematic;
72
- if (schematicName && schematicName.includes(':')) {
73
- [collectionName, schematicName] = schematicName.split(':', 2);
74
- }
75
- return [collectionName, schematicName];
76
- }
77
- async printHelp() {
78
- await super.printHelp();
79
- this.logger.info('');
80
- // Find the generate subcommand.
81
- const subcommand = this.description.options.filter((x) => x.subcommands)[0];
82
- if (Object.keys((subcommand && subcommand.subcommands) || {}).length == 1) {
83
- this.logger.info(`\nTo see help for a schematic run:`);
84
- this.logger.info(color_1.colors.cyan(` ng generate <schematic> --help`));
85
- }
86
- return 0;
87
- }
88
- }
89
- exports.GenerateCommand = GenerateCommand;
@@ -1,37 +0,0 @@
1
- /**
2
- * Generates and/or modifies files based on a schematic.
3
- */
4
- export interface Schema {
5
- /**
6
- * Disable interactive input prompts for options with a default.
7
- */
8
- defaults?: boolean;
9
- /**
10
- * Run through and reports activity without writing out results.
11
- */
12
- dryRun?: boolean;
13
- /**
14
- * Force overwriting of existing files.
15
- */
16
- force?: boolean;
17
- /**
18
- * Shows a help message for this command in the console.
19
- */
20
- help?: HelpUnion;
21
- /**
22
- * Enable interactive input prompts.
23
- */
24
- interactive?: boolean;
25
- /**
26
- * The schematic or collection:schematic to generate.
27
- */
28
- schematic?: string;
29
- }
30
- /**
31
- * Shows a help message for this command in the console.
32
- */
33
- export declare type HelpUnion = boolean | HelpEnum;
34
- export declare enum HelpEnum {
35
- HelpJson = "JSON",
36
- Json = "json"
37
- }
@@ -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,31 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/generate.json",
4
- "description": "Generates and/or modifies files based on a schematic.",
5
- "$longDescription": "",
6
-
7
- "$aliases": ["g"],
8
- "$scope": "in",
9
- "$type": "schematics",
10
- "$impl": "./generate-impl#GenerateCommand",
11
-
12
- "allOf": [
13
- {
14
- "type": "object",
15
- "properties": {
16
- "schematic": {
17
- "type": "string",
18
- "description": "The schematic or collection:schematic to generate.",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 0
22
- }
23
- }
24
- },
25
- "required": []
26
- },
27
- { "$ref": "./definitions.json#/definitions/base" },
28
- { "$ref": "./definitions.json#/definitions/schematic" },
29
- { "$ref": "./definitions.json#/definitions/interactive" }
30
- ]
31
- }
@@ -1,12 +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 { Schema as HelpCommandSchema } from './help';
10
- export declare class HelpCommand extends Command<HelpCommandSchema> {
11
- run(): Promise<void>;
12
- }
@@ -1,26 +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.HelpCommand = void 0;
11
- const command_1 = require("../models/command");
12
- const color_1 = require("../utilities/color");
13
- class HelpCommand extends command_1.Command {
14
- async run() {
15
- this.logger.info(`Available Commands:`);
16
- for (const cmd of Object.values(await command_1.Command.commandMap())) {
17
- if (cmd.hidden) {
18
- continue;
19
- }
20
- const aliasInfo = cmd.aliases.length > 0 ? ` (${cmd.aliases.join(', ')})` : '';
21
- this.logger.info(` ${color_1.colors.cyan(cmd.name)}${aliasInfo} ${cmd.description}`);
22
- }
23
- this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
24
- }
25
- }
26
- exports.HelpCommand = HelpCommand;
@@ -1,7 +0,0 @@
1
- For help with individual commands, use the `--help` or `-h` option with the command.
2
-
3
- For example,
4
-
5
- ```sh
6
- ng help serve
7
- ```
@@ -1,17 +0,0 @@
1
- /**
2
- * Lists available commands and their short descriptions.
3
- */
4
- export interface Schema {
5
- /**
6
- * Shows a help message for this command in the console.
7
- */
8
- help?: HelpUnion;
9
- }
10
- /**
11
- * Shows a help message for this command in the console.
12
- */
13
- export declare type HelpUnion = boolean | HelpEnum;
14
- export declare enum HelpEnum {
15
- HelpJson = "JSON",
16
- Json = "json"
17
- }
package/commands/help.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,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/help.json",
4
- "description": "Lists available commands and their short descriptions.",
5
- "$longDescription": "./help-long.md",
6
-
7
- "$scope": "all",
8
- "$aliases": [],
9
- "$impl": "./help-impl#HelpCommand",
10
-
11
- "type": "object",
12
- "allOf": [{ "$ref": "./definitions.json#/definitions/base" }]
13
- }
@@ -1,16 +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 } from '../models/architect-command';
9
- import { Arguments } from '../models/interface';
10
- import { Schema as LintCommandSchema } from './lint';
11
- export declare class LintCommand extends ArchitectCommand<LintCommandSchema> {
12
- readonly target = "lint";
13
- readonly multiTarget = true;
14
- initialize(options: LintCommandSchema & Arguments): Promise<number | void>;
15
- onMissingTarget(): Promise<void | number>;
16
- }
@@ -1,69 +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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.LintCommand = void 0;
30
- const child_process_1 = require("child_process");
31
- const path = __importStar(require("path"));
32
- const architect_command_1 = require("../models/architect-command");
33
- const prompt_1 = require("../utilities/prompt");
34
- const MissingBuilder = `
35
- Cannot find "lint" target for the specified project.
36
-
37
- You should add a package that implements linting capabilities.
38
-
39
- For example:
40
- ng add @angular-eslint/schematics
41
- `;
42
- class LintCommand extends architect_command_1.ArchitectCommand {
43
- constructor() {
44
- super(...arguments);
45
- this.target = 'lint';
46
- this.multiTarget = true;
47
- }
48
- async initialize(options) {
49
- if (!options.help) {
50
- return super.initialize(options);
51
- }
52
- }
53
- async onMissingTarget() {
54
- this.logger.warn(MissingBuilder);
55
- const shouldAdd = await (0, prompt_1.askConfirmation)('Would you like to add ESLint now?', true, false);
56
- if (shouldAdd) {
57
- // Run `ng add @angular-eslint/schematics`
58
- const binPath = path.resolve(__dirname, '../bin/ng.js');
59
- const { status, error } = (0, child_process_1.spawnSync)(process.execPath, [binPath, 'add', '@angular-eslint/schematics'], {
60
- stdio: 'inherit',
61
- });
62
- if (error) {
63
- throw error;
64
- }
65
- return status !== null && status !== void 0 ? status : 0;
66
- }
67
- }
68
- }
69
- exports.LintCommand = LintCommand;
@@ -1,29 +0,0 @@
1
- /**
2
- * Runs linting tools on Angular app code in a given project folder.
3
- */
4
- export interface Schema {
5
- /**
6
- * One or more named builder configurations as a comma-separated list as specified in the
7
- * "configurations" section of angular.json.
8
- * The builder uses the named configurations to run the given target.
9
- * For more information, see
10
- * https://angular.io/guide/workspace-config#alternate-build-configurations.
11
- */
12
- configuration?: string;
13
- /**
14
- * Shows a help message for this command in the console.
15
- */
16
- help?: HelpUnion;
17
- /**
18
- * The name of the project to lint.
19
- */
20
- project?: string;
21
- }
22
- /**
23
- * Shows a help message for this command in the console.
24
- */
25
- export declare type HelpUnion = boolean | HelpEnum;
26
- export declare enum HelpEnum {
27
- HelpJson = "JSON",
28
- Json = "json"
29
- }
package/commands/lint.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,36 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/lint.json",
4
- "description": "Runs linting tools on Angular app code in a given project folder.",
5
- "$longDescription": "./lint-long.md",
6
-
7
- "$aliases": ["l"],
8
- "$scope": "in",
9
- "$type": "architect",
10
- "$impl": "./lint-impl#LintCommand",
11
-
12
- "type": "object",
13
- "allOf": [
14
- {
15
- "properties": {
16
- "project": {
17
- "type": "string",
18
- "description": "The name of the project to lint.",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 0
22
- }
23
- },
24
- "configuration": {
25
- "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.",
26
- "type": "string",
27
- "aliases": ["c"]
28
- }
29
- },
30
- "required": []
31
- },
32
- {
33
- "$ref": "./definitions.json#/definitions/base"
34
- }
35
- ]
36
- }
@@ -1,16 +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 NewCommandSchema } from './new';
11
- export declare class NewCommand extends SchematicCommand<NewCommandSchema> {
12
- readonly allowMissingWorkspace = true;
13
- schematicName: string;
14
- initialize(options: NewCommandSchema & Arguments): Promise<void>;
15
- run(options: NewCommandSchema & Arguments): Promise<number | void>;
16
- }
@@ -1,37 +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.NewCommand = void 0;
11
- const schematic_command_1 = require("../models/schematic-command");
12
- const version_1 = require("../models/version");
13
- class NewCommand extends schematic_command_1.SchematicCommand {
14
- constructor() {
15
- super(...arguments);
16
- this.allowMissingWorkspace = true;
17
- this.schematicName = 'ng-new';
18
- }
19
- async initialize(options) {
20
- this.collectionName = options.collection || (await this.getDefaultSchematicCollection());
21
- return super.initialize(options);
22
- }
23
- async run(options) {
24
- // Register the version of the CLI in the registry.
25
- const version = version_1.VERSION.full;
26
- this._workflow.registry.addSmartDefaultProvider('ng-cli-version', () => version);
27
- return this.runSchematic({
28
- collectionName: this.collectionName,
29
- schematicName: this.schematicName,
30
- schematicOptions: options['--'] || [],
31
- debug: !!options.debug,
32
- dryRun: !!options.dryRun,
33
- force: !!options.force,
34
- });
35
- }
36
- }
37
- exports.NewCommand = NewCommand;
package/commands/new.d.ts DELETED
@@ -1,41 +0,0 @@
1
- /**
2
- * Creates a new workspace and an initial Angular application.
3
- */
4
- export interface Schema {
5
- /**
6
- * A collection of schematics to use in generating the initial application.
7
- */
8
- collection?: string;
9
- /**
10
- * Disable interactive input prompts for options with a default.
11
- */
12
- defaults?: boolean;
13
- /**
14
- * Run through and reports activity without writing out results.
15
- */
16
- dryRun?: boolean;
17
- /**
18
- * Force overwriting of existing files.
19
- */
20
- force?: boolean;
21
- /**
22
- * Shows a help message for this command in the console.
23
- */
24
- help?: HelpUnion;
25
- /**
26
- * Enable interactive input prompts.
27
- */
28
- interactive?: boolean;
29
- /**
30
- * Add more details to output logging.
31
- */
32
- verbose?: boolean;
33
- }
34
- /**
35
- * Shows a help message for this command in the console.
36
- */
37
- export declare type HelpUnion = boolean | HelpEnum;
38
- export declare enum HelpEnum {
39
- HelpJson = "JSON",
40
- Json = "json"
41
- }
package/commands/new.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/new.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ng-cli://commands/new.json",
4
- "description": "Creates a new workspace and an initial Angular application.",
5
- "$longDescription": "./new.md",
6
-
7
- "$aliases": ["n"],
8
- "$scope": "out",
9
- "$type": "schematic",
10
- "$impl": "./new-impl#NewCommand",
11
-
12
- "type": "object",
13
- "allOf": [
14
- {
15
- "properties": {
16
- "collection": {
17
- "type": "string",
18
- "aliases": ["c"],
19
- "description": "A collection of schematics to use in generating the initial application."
20
- },
21
- "verbose": {
22
- "type": "boolean",
23
- "default": false,
24
- "aliases": ["v"],
25
- "description": "Add more details to output logging."
26
- }
27
- },
28
- "required": []
29
- },
30
- { "$ref": "./definitions.json#/definitions/base" },
31
- { "$ref": "./definitions.json#/definitions/schematic" },
32
- { "$ref": "./definitions.json#/definitions/interactive" }
33
- ]
34
- }
package/commands/new.md DELETED
@@ -1,16 +0,0 @@
1
- Creates and initializes a new Angular application that is the default project for a new workspace.
2
-
3
- Provides interactive prompts for optional configuration, such as adding routing support.
4
- All prompts can safely be allowed to default.
5
-
6
- - The new workspace folder is given the specified project name, and contains configuration files at the top level.
7
-
8
- - By default, the files for a new initial application (with the same name as the workspace) are placed in the `src/` subfolder.
9
-
10
- - The new application's configuration appears in the `projects` section of the `angular.json` workspace configuration file, under its project name.
11
-
12
- - Subsequent applications that you generate in the workspace reside in the `projects/` subfolder.
13
-
14
- If you plan to have multiple applications in the workspace, you can create an empty workspace by setting the `--create-application` option to false.
15
- You can then use `ng generate application` to create an initial application.
16
- This allows a workspace name different from the initial app name, and ensures that all applications reside in the `/projects` subfolder, matching the structure of the configuration file.
@@ -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 { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command';
9
- import { Arguments } from '../models/interface';
10
- import { Schema as RunCommandSchema } from './run';
11
- export declare class RunCommand extends ArchitectCommand<RunCommandSchema> {
12
- run(options: ArchitectCommandOptions & Arguments): Promise<number>;
13
- }
@@ -1,22 +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.RunCommand = void 0;
11
- const architect_command_1 = require("../models/architect-command");
12
- class RunCommand extends architect_command_1.ArchitectCommand {
13
- async run(options) {
14
- if (options.target) {
15
- return this.runArchitectTarget(options);
16
- }
17
- else {
18
- throw new Error('Invalid architect target.');
19
- }
20
- }
21
- }
22
- exports.RunCommand = RunCommand;
package/commands/run.d.ts DELETED
@@ -1,30 +0,0 @@
1
- /**
2
- * Runs an Architect target with an optional custom builder configuration defined in your
3
- * project.
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
- */
13
- configuration?: string;
14
- /**
15
- * Shows a help message for this command in the console.
16
- */
17
- help?: HelpUnion;
18
- /**
19
- * The Architect target to run.
20
- */
21
- target?: string;
22
- }
23
- /**
24
- * Shows a help message for this command in the console.
25
- */
26
- export declare type HelpUnion = boolean | HelpEnum;
27
- export declare enum HelpEnum {
28
- HelpJson = "JSON",
29
- Json = "json"
30
- }