@angular/cli 14.0.0-next.4 → 14.0.0-next.7

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 (231) 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 +30 -15
  5. package/lib/config/workspace-schema.d.ts +6 -1
  6. package/lib/init.js +10 -9
  7. package/package.json +18 -20
  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 +304 -0
  12. package/src/command-builder/architect-base-command-module.d.ts +23 -0
  13. package/src/command-builder/architect-base-command-module.js +103 -0
  14. package/src/command-builder/architect-command-module.d.ts +22 -0
  15. package/src/command-builder/architect-command-module.js +108 -0
  16. package/src/command-builder/command-module.d.ts +89 -0
  17. package/src/command-builder/command-module.js +191 -0
  18. package/{utilities/package-json.js → src/command-builder/command-runner.d.ts} +2 -2
  19. package/src/command-builder/command-runner.js +152 -0
  20. package/src/command-builder/schematics-command-module.d.ts +46 -0
  21. package/src/command-builder/schematics-command-module.js +335 -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/{models → src/command-builder/utilities}/schematic-engine-host.d.ts +0 -0
  29. package/{models → src/command-builder/utilities}/schematic-engine-host.js +0 -0
  30. package/src/command-builder/utilities/schematic-workflow.d.ts +14 -0
  31. package/src/command-builder/utilities/schematic-workflow.js +68 -0
  32. package/src/commands/add/cli.d.ts +33 -0
  33. package/{commands/add-impl.js → src/commands/add/cli.js} +108 -80
  34. package/src/commands/add/long-description.md +7 -0
  35. package/src/commands/analytics/cli.d.ts +16 -0
  36. package/src/commands/analytics/cli.js +35 -0
  37. package/src/commands/analytics/info/cli.d.ts +16 -0
  38. package/src/commands/analytics/info/cli.js +26 -0
  39. package/src/commands/analytics/settings/cli.d.ts +35 -0
  40. package/src/commands/analytics/settings/cli.js +61 -0
  41. package/src/commands/build/cli.d.ts +16 -0
  42. package/src/commands/build/cli.js +23 -0
  43. package/{commands/build-long.md → src/commands/build/long-description.md} +0 -0
  44. package/src/commands/cache/clean/cli.d.ts +17 -0
  45. package/src/commands/cache/clean/cli.js +32 -0
  46. package/src/commands/cache/cli.d.ts +17 -0
  47. package/src/commands/cache/cli.js +38 -0
  48. package/src/commands/cache/info/cli.d.ts +20 -0
  49. package/src/commands/cache/info/cli.js +82 -0
  50. package/src/commands/cache/long-description.md +53 -0
  51. package/src/commands/cache/settings/cli.d.ts +27 -0
  52. package/src/commands/cache/settings/cli.js +42 -0
  53. package/src/commands/cache/utilities.d.ts +11 -0
  54. package/src/commands/cache/utilities.js +50 -0
  55. package/src/commands/config/cli.d.ts +24 -0
  56. package/{commands/config-impl.js → src/commands/config/cli.js} +102 -89
  57. package/{commands/config-long.md → src/commands/config/long-description.md} +2 -2
  58. package/src/commands/deploy/cli.d.ts +16 -0
  59. package/src/commands/deploy/cli.js +35 -0
  60. package/{commands/deploy-long.md → src/commands/deploy/long-description.md} +0 -0
  61. package/src/commands/doc/cli.d.ts +23 -0
  62. package/{commands/doc-impl.js → src/commands/doc/cli.js} +41 -12
  63. package/src/commands/e2e/cli.d.ts +17 -0
  64. package/src/commands/e2e/cli.js +34 -0
  65. package/src/commands/extract-i18n/cli.d.ts +15 -0
  66. package/src/commands/extract-i18n/cli.js +20 -0
  67. package/src/commands/generate/cli.d.ts +39 -0
  68. package/src/commands/generate/cli.js +145 -0
  69. package/src/commands/lint/cli.d.ts +16 -0
  70. package/src/commands/lint/cli.js +31 -0
  71. package/{commands/lint-long.md → src/commands/lint/long-description.md} +0 -0
  72. package/src/commands/make-this-awesome/cli.d.ts +17 -0
  73. package/{commands/easter-egg-impl.js → src/commands/make-this-awesome/cli.js} +17 -10
  74. package/src/commands/new/cli.d.ts +27 -0
  75. package/src/commands/new/cli.js +77 -0
  76. package/src/commands/run/cli.d.ts +23 -0
  77. package/src/commands/run/cli.js +59 -0
  78. package/{commands/run-long.md → src/commands/run/long-description.md} +0 -0
  79. package/src/commands/serve/cli.d.ts +16 -0
  80. package/src/commands/serve/cli.js +21 -0
  81. package/src/commands/test/cli.d.ts +16 -0
  82. package/src/commands/test/cli.js +23 -0
  83. package/{commands/test-long.md → src/commands/test/long-description.md} +0 -0
  84. package/{commands/update-impl.d.ts → src/commands/update/cli.d.ts} +26 -9
  85. package/{commands/update-impl.js → src/commands/update/cli.js} +362 -316
  86. package/{commands/update-long.md → src/commands/update/long-description.md} +0 -0
  87. package/src/commands/update/schematic/index.js +33 -20
  88. package/src/commands/version/cli.d.ts +18 -0
  89. package/{commands/version-impl.js → src/commands/version/cli.js} +56 -74
  90. package/src/typings-bazel.d.ts +14 -0
  91. package/src/typings.d.ts +1 -14
  92. package/{utilities → src/utilities}/color.d.ts +0 -0
  93. package/{utilities → src/utilities}/color.js +5 -1
  94. package/{utilities → src/utilities}/config.d.ts +2 -2
  95. package/{utilities → src/utilities}/config.js +24 -16
  96. package/src/utilities/environment-options.d.ts +12 -0
  97. package/src/utilities/environment-options.js +24 -0
  98. package/{utilities → src/utilities}/find-up.d.ts +0 -0
  99. package/{utilities → src/utilities}/find-up.js +5 -1
  100. package/{utilities → src/utilities}/json-file.d.ts +0 -0
  101. package/{utilities → src/utilities}/json-file.js +0 -0
  102. package/{utilities → src/utilities}/log-file.d.ts +0 -0
  103. package/{utilities → src/utilities}/log-file.js +0 -0
  104. package/src/utilities/package-manager.d.ts +41 -0
  105. package/src/utilities/package-manager.js +276 -0
  106. package/{utilities → src/utilities}/package-metadata.d.ts +15 -37
  107. package/{utilities → src/utilities}/package-metadata.js +15 -27
  108. package/{utilities → src/utilities}/package-tree.d.ts +2 -2
  109. package/{utilities → src/utilities}/package-tree.js +5 -1
  110. package/{utilities → src/utilities}/project.d.ts +0 -0
  111. package/{utilities → src/utilities}/project.js +5 -1
  112. package/{utilities → src/utilities}/prompt.d.ts +0 -0
  113. package/{utilities → src/utilities}/prompt.js +7 -3
  114. package/{utilities → src/utilities}/spinner.d.ts +0 -0
  115. package/{utilities → src/utilities}/spinner.js +0 -0
  116. package/{utilities → src/utilities}/tty.d.ts +0 -0
  117. package/{utilities → src/utilities}/tty.js +0 -0
  118. package/{models → src/utilities}/version.d.ts +2 -1
  119. package/{models → src/utilities}/version.js +6 -6
  120. package/bin/postinstall/analytics-prompt.js +0 -27
  121. package/bin/postinstall/script.js +0 -16
  122. package/commands/add-impl.d.ts +0 -21
  123. package/commands/add.d.ts +0 -42
  124. package/commands/add.js +0 -10
  125. package/commands/add.json +0 -54
  126. package/commands/add.md +0 -10
  127. package/commands/analytics-impl.d.ts +0 -13
  128. package/commands/analytics-impl.js +0 -80
  129. package/commands/analytics-long.md +0 -8
  130. package/commands/analytics.d.ts +0 -46
  131. package/commands/analytics.js +0 -31
  132. package/commands/analytics.json +0 -37
  133. package/commands/build-impl.d.ts +0 -14
  134. package/commands/build-impl.js +0 -21
  135. package/commands/build.d.ts +0 -30
  136. package/commands/build.js +0 -10
  137. package/commands/build.json +0 -16
  138. package/commands/config-impl.d.ts +0 -15
  139. package/commands/config.d.ts +0 -34
  140. package/commands/config.js +0 -10
  141. package/commands/config.json +0 -43
  142. package/commands/definitions.json +0 -66
  143. package/commands/deploy-impl.d.ts +0 -15
  144. package/commands/deploy-impl.js +0 -36
  145. package/commands/deploy.d.ts +0 -30
  146. package/commands/deploy.js +0 -10
  147. package/commands/deploy.json +0 -34
  148. package/commands/doc-impl.d.ts +0 -13
  149. package/commands/doc.d.ts +0 -39
  150. package/commands/doc.js +0 -14
  151. package/commands/doc.json +0 -46
  152. package/commands/e2e-impl.d.ts +0 -16
  153. package/commands/e2e-impl.js +0 -36
  154. package/commands/e2e-long.md +0 -4
  155. package/commands/e2e.d.ts +0 -29
  156. package/commands/e2e.js +0 -10
  157. package/commands/e2e.json +0 -17
  158. package/commands/easter-egg-impl.d.ts +0 -12
  159. package/commands/easter-egg.d.ts +0 -14
  160. package/commands/easter-egg.js +0 -10
  161. package/commands/easter-egg.json +0 -12
  162. package/commands/extract-i18n-impl.d.ts +0 -14
  163. package/commands/extract-i18n-impl.js +0 -21
  164. package/commands/extract-i18n.d.ts +0 -29
  165. package/commands/extract-i18n.js +0 -10
  166. package/commands/extract-i18n.json +0 -15
  167. package/commands/generate-impl.d.ts +0 -18
  168. package/commands/generate-impl.js +0 -89
  169. package/commands/generate.d.ts +0 -37
  170. package/commands/generate.js +0 -10
  171. package/commands/generate.json +0 -31
  172. package/commands/help-impl.d.ts +0 -12
  173. package/commands/help-impl.js +0 -26
  174. package/commands/help-long.md +0 -7
  175. package/commands/help.d.ts +0 -17
  176. package/commands/help.js +0 -10
  177. package/commands/help.json +0 -13
  178. package/commands/lint-impl.d.ts +0 -16
  179. package/commands/lint-impl.js +0 -69
  180. package/commands/lint.d.ts +0 -29
  181. package/commands/lint.js +0 -10
  182. package/commands/lint.json +0 -36
  183. package/commands/new-impl.d.ts +0 -16
  184. package/commands/new-impl.js +0 -37
  185. package/commands/new.d.ts +0 -41
  186. package/commands/new.js +0 -10
  187. package/commands/new.json +0 -34
  188. package/commands/new.md +0 -16
  189. package/commands/run-impl.d.ts +0 -13
  190. package/commands/run-impl.js +0 -22
  191. package/commands/run.d.ts +0 -30
  192. package/commands/run.js +0 -10
  193. package/commands/run.json +0 -36
  194. package/commands/serve-impl.d.ts +0 -15
  195. package/commands/serve-impl.js +0 -24
  196. package/commands/serve.d.ts +0 -29
  197. package/commands/serve.js +0 -10
  198. package/commands/serve.json +0 -17
  199. package/commands/test-impl.d.ts +0 -15
  200. package/commands/test-impl.js +0 -22
  201. package/commands/test.d.ts +0 -29
  202. package/commands/test.js +0 -10
  203. package/commands/test.json +0 -17
  204. package/commands/update.d.ts +0 -61
  205. package/commands/update.js +0 -10
  206. package/commands/update.json +0 -78
  207. package/commands/version-impl.d.ts +0 -17
  208. package/commands/version.d.ts +0 -17
  209. package/commands/version.js +0 -10
  210. package/commands/version.json +0 -13
  211. package/commands.json +0 -20
  212. package/models/analytics.d.ts +0 -58
  213. package/models/analytics.js +0 -358
  214. package/models/architect-command.d.ts +0 -35
  215. package/models/architect-command.js +0 -364
  216. package/models/command-runner.d.ts +0 -24
  217. package/models/command-runner.js +0 -241
  218. package/models/command.d.ts +0 -34
  219. package/models/command.js +0 -143
  220. package/models/interface.d.ts +0 -196
  221. package/models/interface.js +0 -31
  222. package/models/parser.d.ts +0 -39
  223. package/models/parser.js +0 -349
  224. package/models/schematic-command.d.ts +0 -55
  225. package/models/schematic-command.js +0 -485
  226. package/utilities/install-package.d.ts +0 -16
  227. package/utilities/install-package.js +0 -193
  228. package/utilities/json-schema.d.ts +0 -17
  229. package/utilities/package-json.d.ts +0 -249
  230. package/utilities/package-manager.d.ts +0 -13
  231. package/utilities/package-manager.js +0 -106
@@ -0,0 +1,24 @@
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 { Argv } from 'yargs';
9
+ import { CommandModule, CommandModuleImplementation, Options } from '../../command-builder/command-module';
10
+ interface ConfigCommandArgs {
11
+ 'json-path'?: string;
12
+ value?: string;
13
+ global?: boolean;
14
+ }
15
+ export declare class ConfigCommandModule extends CommandModule<ConfigCommandArgs> implements CommandModuleImplementation<ConfigCommandArgs> {
16
+ command: string;
17
+ describe: string;
18
+ longDescriptionPath: string;
19
+ builder(localYargs: Argv): Argv<ConfigCommandArgs>;
20
+ run(options: Options<ConfigCommandArgs>): Promise<number | void>;
21
+ private get;
22
+ private set;
23
+ }
24
+ export {};
@@ -7,23 +7,108 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ConfigCommand = void 0;
10
+ exports.ConfigCommandModule = void 0;
11
+ const path_1 = require("path");
11
12
  const uuid_1 = require("uuid");
12
- const command_1 = require("../models/command");
13
- const interface_1 = require("../models/interface");
14
- const config_1 = require("../utilities/config");
15
- const json_file_1 = require("../utilities/json-file");
16
- const validCliPaths = new Map([
17
- ['cli.warnings.versionMismatch', undefined],
18
- ['cli.defaultCollection', undefined],
19
- ['cli.packageManager', undefined],
20
- ['cli.analytics', undefined],
21
- ['cli.analyticsSharing.tracking', undefined],
22
- ['cli.analyticsSharing.uuid', (v) => (v === '' ? (0, uuid_1.v4)() : `${v}`)],
23
- ['cli.cache.enabled', undefined],
24
- ['cli.cache.environment', undefined],
25
- ['cli.cache.path', undefined],
26
- ]);
13
+ const command_module_1 = require("../../command-builder/command-module");
14
+ const config_1 = require("../../utilities/config");
15
+ const json_file_1 = require("../../utilities/json-file");
16
+ class ConfigCommandModule extends command_module_1.CommandModule {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.command = 'config [json-path] [value]';
20
+ this.describe = 'Retrieves or sets Angular configuration values in the angular.json file for the workspace.';
21
+ this.longDescriptionPath = (0, path_1.join)(__dirname, 'long-description.md');
22
+ }
23
+ builder(localYargs) {
24
+ return localYargs
25
+ .positional('json-path', {
26
+ description: `The configuration key to set or query, in JSON path format. ` +
27
+ `For example: "a[3].foo.bar[2]". If no new value is provided, returns the current value of this key.`,
28
+ type: 'string',
29
+ })
30
+ .positional('value', {
31
+ description: 'If provided, a new value for the given configuration key.',
32
+ type: 'string',
33
+ })
34
+ .option('global', {
35
+ description: `Access the global configuration in the caller's home directory.`,
36
+ alias: ['g'],
37
+ type: 'boolean',
38
+ default: false,
39
+ })
40
+ .strict();
41
+ }
42
+ async run(options) {
43
+ const level = options.global ? 'global' : 'local';
44
+ const [config] = (0, config_1.getWorkspaceRaw)(level);
45
+ if (options.value == undefined) {
46
+ if (!config) {
47
+ this.context.logger.error('No config found.');
48
+ return 1;
49
+ }
50
+ return this.get(config, options);
51
+ }
52
+ else {
53
+ return this.set(options);
54
+ }
55
+ }
56
+ get(jsonFile, options) {
57
+ const { logger } = this.context;
58
+ const value = options.jsonPath
59
+ ? jsonFile.get(parseJsonPath(options.jsonPath))
60
+ : jsonFile.content;
61
+ if (value === undefined) {
62
+ logger.error('Value cannot be found.');
63
+ return 1;
64
+ }
65
+ else if (typeof value === 'string') {
66
+ logger.info(value);
67
+ }
68
+ else {
69
+ logger.info(JSON.stringify(value, null, 2));
70
+ }
71
+ return 0;
72
+ }
73
+ async set(options) {
74
+ var _a, _b, _c;
75
+ if (!((_a = options.jsonPath) === null || _a === void 0 ? void 0 : _a.trim())) {
76
+ throw new command_module_1.CommandModuleError('Invalid Path.');
77
+ }
78
+ const validCliPaths = new Map([
79
+ ['cli.warnings.versionMismatch', undefined],
80
+ ['cli.defaultCollection', undefined],
81
+ ['cli.schematicCollections', undefined],
82
+ ['cli.packageManager', undefined],
83
+ ['cli.analytics', undefined],
84
+ ['cli.analyticsSharing.tracking', undefined],
85
+ ['cli.analyticsSharing.uuid', (v) => (v === '' ? (0, uuid_1.v4)() : `${v}`)],
86
+ ['cli.cache.enabled', undefined],
87
+ ['cli.cache.environment', undefined],
88
+ ['cli.cache.path', undefined],
89
+ ]);
90
+ if (options.global &&
91
+ !options.jsonPath.startsWith('schematics.') &&
92
+ !validCliPaths.has(options.jsonPath)) {
93
+ throw new command_module_1.CommandModuleError('Invalid Path.');
94
+ }
95
+ const [config, configPath] = (0, config_1.getWorkspaceRaw)(options.global ? 'global' : 'local');
96
+ const { logger } = this.context;
97
+ if (!config || !configPath) {
98
+ throw new command_module_1.CommandModuleError('Confguration file cannot be found.');
99
+ }
100
+ const value = (_c = (_b = validCliPaths.get(options.jsonPath)) === null || _b === void 0 ? void 0 : _b(options.value)) !== null && _c !== void 0 ? _c : options.value;
101
+ const modified = config.modify(parseJsonPath(options.jsonPath), normalizeValue(value));
102
+ if (!modified) {
103
+ logger.error('Value cannot be found.');
104
+ return 1;
105
+ }
106
+ await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content));
107
+ config.save();
108
+ return 0;
109
+ }
110
+ }
111
+ exports.ConfigCommandModule = ConfigCommandModule;
27
112
  /**
28
113
  * Splits a JSON path string into fragments. Fragments can be used to get the value referenced
29
114
  * by the path. For example, a path of "a[3].foo.bar[2]" would give you a fragment array of
@@ -42,7 +127,7 @@ function parseJsonPath(path) {
42
127
  }
43
128
  const match = fragment.match(/([^[]+)((\[.*\])*)/);
44
129
  if (!match) {
45
- throw new Error('Invalid JSON path.');
130
+ throw new command_module_1.CommandModuleError('Invalid JSON path.');
46
131
  }
47
132
  result.push(match[1]);
48
133
  if (match[2]) {
@@ -81,75 +166,3 @@ function normalizeValue(value) {
81
166
  return value;
82
167
  }
83
168
  }
84
- class ConfigCommand extends command_1.Command {
85
- async run(options) {
86
- const level = options.global ? 'global' : 'local';
87
- if (!options.global) {
88
- await this.validateScope(interface_1.CommandScope.InProject);
89
- }
90
- const [config] = (0, config_1.getWorkspaceRaw)(level);
91
- if (options.value == undefined) {
92
- if (!config) {
93
- this.logger.error('No config found.');
94
- return 1;
95
- }
96
- return this.get(config, options);
97
- }
98
- else {
99
- return this.set(options);
100
- }
101
- }
102
- get(jsonFile, options) {
103
- let value;
104
- if (options.jsonPath) {
105
- value = jsonFile.get(parseJsonPath(options.jsonPath));
106
- }
107
- else {
108
- value = jsonFile.content;
109
- }
110
- if (value === undefined) {
111
- this.logger.error('Value cannot be found.');
112
- return 1;
113
- }
114
- else if (typeof value === 'string') {
115
- this.logger.info(value);
116
- }
117
- else {
118
- this.logger.info(JSON.stringify(value, null, 2));
119
- }
120
- return 0;
121
- }
122
- async set(options) {
123
- var _a, _b, _c;
124
- if (!((_a = options.jsonPath) === null || _a === void 0 ? void 0 : _a.trim())) {
125
- throw new Error('Invalid Path.');
126
- }
127
- if (options.global &&
128
- !options.jsonPath.startsWith('schematics.') &&
129
- !validCliPaths.has(options.jsonPath)) {
130
- throw new Error('Invalid Path.');
131
- }
132
- const [config, configPath] = (0, config_1.getWorkspaceRaw)(options.global ? 'global' : 'local');
133
- if (!config || !configPath) {
134
- this.logger.error('Confguration file cannot be found.');
135
- return 1;
136
- }
137
- const jsonPath = parseJsonPath(options.jsonPath);
138
- const value = (_c = (_b = validCliPaths.get(options.jsonPath)) === null || _b === void 0 ? void 0 : _b(options.value)) !== null && _c !== void 0 ? _c : options.value;
139
- const modified = config.modify(jsonPath, normalizeValue(value));
140
- if (!modified) {
141
- this.logger.error('Value cannot be found.');
142
- return 1;
143
- }
144
- try {
145
- await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content));
146
- }
147
- catch (error) {
148
- this.logger.fatal(error.message);
149
- return 1;
150
- }
151
- config.save();
152
- return 0;
153
- }
154
- }
155
- exports.ConfigCommand = ConfigCommand;
@@ -6,8 +6,8 @@ or indirectly on the command line using this command.
6
6
 
7
7
  The configurable property names match command option names,
8
8
  except that in the configuration file, all names must use camelCase,
9
- while on the command line options can be given in either camelCase or dash-case.
9
+ while on the command line options can be given 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](cli/usage-analytics-gathering).
@@ -0,0 +1,16 @@
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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
9
+ import { CommandModuleImplementation } from '../../command-builder/command-module';
10
+ export declare class DeployCommandModule extends ArchitectCommandModule implements CommandModuleImplementation {
11
+ missingErrorTarget: string;
12
+ multiTarget: boolean;
13
+ command: string;
14
+ longDescriptionPath: string;
15
+ describe: string;
16
+ }
@@ -0,0 +1,35 @@
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.DeployCommandModule = void 0;
11
+ const core_1 = require("@angular-devkit/core");
12
+ const path_1 = require("path");
13
+ const architect_command_module_1 = require("../../command-builder/architect-command-module");
14
+ class DeployCommandModule extends architect_command_module_1.ArchitectCommandModule {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.missingErrorTarget = core_1.tags.stripIndents `
18
+ Cannot find "deploy" target for the specified project.
19
+
20
+ You should add a package that implements deployment capabilities for your
21
+ favorite platform.
22
+
23
+ For example:
24
+ ng add @angular/fire
25
+ ng add @azure/ng-deploy
26
+
27
+ Find more packages on npm https://www.npmjs.com/search?q=ng%20deploy
28
+ `;
29
+ this.multiTarget = false;
30
+ this.command = 'deploy [project]';
31
+ this.longDescriptionPath = (0, path_1.join)(__dirname, 'long-description.md');
32
+ this.describe = 'Invokes the deploy builder for a specified project or for the default project in the workspace.';
33
+ }
34
+ }
35
+ exports.DeployCommandModule = DeployCommandModule;
@@ -0,0 +1,23 @@
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 { Argv } from 'yargs';
9
+ import { CommandModule, CommandModuleImplementation, Options } from '../../command-builder/command-module';
10
+ interface DocCommandArgs {
11
+ keyword: string;
12
+ search?: boolean;
13
+ version?: string;
14
+ }
15
+ export declare class DocCommandModule extends CommandModule<DocCommandArgs> implements CommandModuleImplementation<DocCommandArgs> {
16
+ command: string;
17
+ aliases: string[];
18
+ describe: string;
19
+ longDescriptionPath?: string;
20
+ builder(localYargs: Argv): Argv<DocCommandArgs>;
21
+ run(options: Options<DocCommandArgs>): Promise<number | void>;
22
+ }
23
+ export {};
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -29,28 +33,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
34
  };
31
35
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.DocCommand = void 0;
36
+ exports.DocCommandModule = void 0;
33
37
  const open_1 = __importDefault(require("open"));
34
- const command_1 = require("../models/command");
35
- class DocCommand extends command_1.Command {
38
+ const command_module_1 = require("../../command-builder/command-module");
39
+ class DocCommandModule extends command_module_1.CommandModule {
40
+ constructor() {
41
+ super(...arguments);
42
+ this.command = 'doc <keyword>';
43
+ this.aliases = ['d'];
44
+ this.describe = 'Opens the official Angular documentation (angular.io) in a browser, and searches for a given keyword.';
45
+ }
46
+ builder(localYargs) {
47
+ return localYargs
48
+ .positional('keyword', {
49
+ description: 'The keyword to search for, as provided in the search bar in angular.io.',
50
+ type: 'string',
51
+ demandOption: true,
52
+ })
53
+ .option('search', {
54
+ description: `Search all of angular.io. Otherwise, searches only API reference documentation.`,
55
+ alias: ['s'],
56
+ type: 'boolean',
57
+ default: false,
58
+ })
59
+ .option('version', {
60
+ description: 'Contains the version of Angular to use for the documentation. ' +
61
+ 'If not provided, the command uses your current Angular core version.',
62
+ type: 'string',
63
+ })
64
+ .strict();
65
+ }
36
66
  async run(options) {
37
- if (!options.keyword) {
38
- this.logger.error('You should specify a keyword, for instance, `ng doc ActivatedRoute`.');
39
- return 0;
40
- }
41
67
  let domain = 'angular.io';
42
68
  if (options.version) {
43
69
  // version can either be a string containing "next"
44
- if (options.version == 'next') {
70
+ if (options.version === 'next') {
45
71
  domain = 'next.angular.io';
72
+ }
73
+ else if (options.version === 'rc') {
74
+ domain = 'rc.angular.io';
46
75
  // or a number where version must be a valid Angular version (i.e. not 0, 1 or 3)
47
76
  }
48
77
  else if (!isNaN(+options.version) && ![0, 1, 3].includes(+options.version)) {
49
78
  domain = `v${options.version}.angular.io`;
50
79
  }
51
80
  else {
52
- this.logger.error('Version should either be a number (2, 4, 5, 6...) or "next"');
53
- return 0;
81
+ this.context.logger.error('Version should either be a number (2, 4, 5, 6...), "rc" or "next"');
82
+ return 1;
54
83
  }
55
84
  }
56
85
  else {
@@ -68,4 +97,4 @@ class DocCommand extends command_1.Command {
68
97
  : `https://${domain}/docs?search=${options.keyword}`);
69
98
  }
70
99
  }
71
- exports.DocCommand = DocCommand;
100
+ exports.DocCommandModule = DocCommandModule;
@@ -0,0 +1,17 @@
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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
9
+ import { CommandModuleImplementation } from '../../command-builder/command-module';
10
+ export declare class E2eCommandModule extends ArchitectCommandModule implements CommandModuleImplementation {
11
+ multiTarget: boolean;
12
+ missingErrorTarget: string;
13
+ command: string;
14
+ aliases: string[];
15
+ describe: string;
16
+ longDescriptionPath?: string;
17
+ }
@@ -0,0 +1,34 @@
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.E2eCommandModule = void 0;
11
+ const core_1 = require("@angular-devkit/core");
12
+ const architect_command_module_1 = require("../../command-builder/architect-command-module");
13
+ class E2eCommandModule extends architect_command_module_1.ArchitectCommandModule {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.multiTarget = true;
17
+ this.missingErrorTarget = core_1.tags.stripIndents `
18
+ Cannot find "e2e" target for the specified project.
19
+
20
+ You should add a package that implements end-to-end testing capabilities.
21
+
22
+ For example:
23
+ Cypress: ng add @cypress/schematic
24
+ Nightwatch: ng add @nightwatch/schematics
25
+ WebdriverIO: ng add @wdio/schematics
26
+
27
+ More options will be added to the list as they become available.
28
+ `;
29
+ this.command = 'e2e [project]';
30
+ this.aliases = ['e'];
31
+ this.describe = 'Builds and serves an Angular application, then runs end-to-end tests.';
32
+ }
33
+ }
34
+ exports.E2eCommandModule = E2eCommandModule;
@@ -0,0 +1,15 @@
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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
9
+ import { CommandModuleImplementation } from '../../command-builder/command-module';
10
+ export declare class ExtractI18nCommandModule extends ArchitectCommandModule implements CommandModuleImplementation {
11
+ multiTarget: boolean;
12
+ command: string;
13
+ describe: string;
14
+ longDescriptionPath?: string | undefined;
15
+ }
@@ -0,0 +1,20 @@
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.ExtractI18nCommandModule = void 0;
11
+ const architect_command_module_1 = require("../../command-builder/architect-command-module");
12
+ class ExtractI18nCommandModule extends architect_command_module_1.ArchitectCommandModule {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.multiTarget = false;
16
+ this.command = 'extract-i18n [project]';
17
+ this.describe = 'Extracts i18n messages from source code.';
18
+ }
19
+ }
20
+ exports.ExtractI18nCommandModule = ExtractI18nCommandModule;
@@ -0,0 +1,39 @@
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 { Argv } from 'yargs';
9
+ import { CommandModuleImplementation, Options, OtherOptions } from '../../command-builder/command-module';
10
+ import { SchematicsCommandArgs, SchematicsCommandModule } from '../../command-builder/schematics-command-module';
11
+ interface GenerateCommandArgs extends SchematicsCommandArgs {
12
+ schematic?: string;
13
+ }
14
+ export declare class GenerateCommandModule extends SchematicsCommandModule implements CommandModuleImplementation<GenerateCommandArgs> {
15
+ command: string;
16
+ aliases: string;
17
+ describe: string;
18
+ longDescriptionPath?: string | undefined;
19
+ builder(argv: Argv): Promise<Argv<GenerateCommandArgs>>;
20
+ run(options: Options<GenerateCommandArgs> & OtherOptions): Promise<number | void>;
21
+ private getCollectionNames;
22
+ /**
23
+ * Generate a command string to be passed to the command builder.
24
+ *
25
+ * @example `component [name]` or `@schematics/angular:component [name]`.
26
+ */
27
+ private generateCommandString;
28
+ /**
29
+ * Get schematics that can to be registered as subcommands.
30
+ */
31
+ private getSchematics;
32
+ /**
33
+ * Get schematics that should to be registered as subcommands.
34
+ *
35
+ * @returns a sorted list of schematic that needs to be registered as subcommands.
36
+ */
37
+ private getSchematicsToRegister;
38
+ }
39
+ export {};