@angular/cli 12.0.0-rc.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +34 -30
  2. package/bin/ng +3 -3
  3. package/bin/postinstall/analytics-prompt.js +1 -1
  4. package/commands/add-impl.d.ts +7 -0
  5. package/commands/add-impl.js +18 -20
  6. package/commands/add.json +1 -2
  7. package/commands/add.md +1 -0
  8. package/commands/analytics-impl.d.ts +8 -1
  9. package/commands/analytics-impl.js +7 -7
  10. package/commands/analytics-long.md +8 -7
  11. package/commands/analytics.json +3 -15
  12. package/commands/build-impl.d.ts +1 -1
  13. package/commands/build-impl.js +3 -3
  14. package/commands/build.json +1 -1
  15. package/commands/config-impl.d.ts +2 -2
  16. package/commands/config-impl.js +16 -11
  17. package/commands/config-long.md +1 -1
  18. package/commands/config.json +1 -2
  19. package/commands/definitions.json +3 -5
  20. package/commands/deploy-impl.d.ts +1 -1
  21. package/commands/deploy-impl.js +3 -3
  22. package/commands/deploy-long.md +1 -1
  23. package/commands/deploy.json +1 -3
  24. package/commands/doc-impl.d.ts +1 -1
  25. package/commands/doc-impl.js +2 -2
  26. package/commands/doc.json +3 -4
  27. package/commands/e2e-impl.d.ts +1 -1
  28. package/commands/e2e-impl.js +1 -1
  29. package/commands/e2e-long.md +1 -1
  30. package/commands/e2e.json +1 -1
  31. package/commands/easter-egg-impl.d.ts +1 -1
  32. package/commands/easter-egg-impl.js +3 -3
  33. package/commands/easter-egg.json +1 -3
  34. package/commands/extract-i18n-impl.d.ts +1 -1
  35. package/commands/extract-i18n-impl.js +5 -4
  36. package/commands/generate-impl.d.ts +1 -1
  37. package/commands/generate-impl.js +9 -2
  38. package/commands/generate.json +2 -3
  39. package/commands/help-impl.d.ts +1 -1
  40. package/commands/help-impl.js +3 -3
  41. package/commands/help-long.md +5 -5
  42. package/commands/help.json +1 -3
  43. package/commands/lint-impl.d.ts +1 -1
  44. package/commands/lint-impl.js +3 -3
  45. package/commands/lint-long.md +1 -1
  46. package/commands/lint.json +1 -3
  47. package/commands/new-impl.d.ts +1 -1
  48. package/commands/new-impl.js +8 -1
  49. package/commands/new.json +3 -3
  50. package/commands/new.md +5 -5
  51. package/commands/run-impl.d.ts +1 -1
  52. package/commands/run-impl.js +1 -1
  53. package/commands/run-long.md +1 -1
  54. package/commands/run.json +2 -3
  55. package/commands/serve-impl.d.ts +2 -2
  56. package/commands/serve-impl.js +4 -4
  57. package/commands/serve.json +1 -1
  58. package/commands/test-impl.d.ts +1 -1
  59. package/commands/test-impl.js +1 -1
  60. package/commands/test-long.md +1 -1
  61. package/commands/test.json +1 -1
  62. package/commands/update-impl.d.ts +9 -2
  63. package/commands/update-impl.js +29 -23
  64. package/commands/update.d.ts +2 -1
  65. package/commands/update.json +1 -1
  66. package/commands/version-impl.d.ts +8 -0
  67. package/commands/version-impl.js +19 -6
  68. package/commands/version.json +2 -4
  69. package/lib/cli/index.d.ts +7 -0
  70. package/lib/cli/index.js +14 -16
  71. package/lib/config/schema.json +20 -12
  72. package/lib/config/workspace-schema.d.ts +4 -0
  73. package/lib/init.d.ts +1 -1
  74. package/lib/init.js +11 -10
  75. package/models/analytics-collector.d.ts +1 -2
  76. package/models/analytics-collector.js +7 -8
  77. package/models/analytics.d.ts +7 -0
  78. package/models/analytics.js +6 -8
  79. package/models/architect-command.d.ts +2 -2
  80. package/models/architect-command.js +10 -11
  81. package/models/command-runner.d.ts +1 -1
  82. package/models/command-runner.js +8 -7
  83. package/models/command.d.ts +3 -4
  84. package/models/command.js +17 -21
  85. package/models/error.d.ts +1 -1
  86. package/models/error.js +1 -1
  87. package/models/interface.d.ts +2 -2
  88. package/models/interface.js +7 -0
  89. package/models/parser.d.ts +1 -2
  90. package/models/parser.js +12 -15
  91. package/models/schematic-command.d.ts +1 -1
  92. package/models/schematic-command.js +48 -49
  93. package/models/schematic-engine-host.d.ts +1 -1
  94. package/models/schematic-engine-host.js +4 -4
  95. package/models/version.d.ts +1 -1
  96. package/models/version.js +1 -1
  97. package/package.json +14 -14
  98. package/src/commands/update/schematic/index.d.ts +7 -0
  99. package/src/commands/update/schematic/index.js +59 -56
  100. package/src/commands/update/schematic/npm-package-json.d.ts +1 -1
  101. package/src/commands/update/schematic/npm-package-json.js +7 -0
  102. package/src/commands/update/schematic/npm.d.ts +1 -1
  103. package/src/commands/update/schematic/npm.js +9 -4
  104. package/src/commands/update/schematic/package-json.d.ts +1 -1
  105. package/src/commands/update/schematic/package-json.js +1 -7
  106. package/src/commands/update/schematic/schema.json +2 -8
  107. package/utilities/color.d.ts +1 -1
  108. package/utilities/color.js +3 -3
  109. package/utilities/config.d.ts +1 -1
  110. package/utilities/config.js +24 -7
  111. package/utilities/find-up.d.ts +1 -1
  112. package/utilities/find-up.js +1 -1
  113. package/utilities/install-package.d.ts +7 -5
  114. package/utilities/install-package.js +37 -23
  115. package/utilities/json-file.d.ts +1 -1
  116. package/utilities/json-file.js +4 -4
  117. package/utilities/json-schema.d.ts +1 -1
  118. package/utilities/json-schema.js +30 -27
  119. package/utilities/log-file.d.ts +1 -1
  120. package/utilities/log-file.js +1 -1
  121. package/utilities/package-manager.d.ts +7 -0
  122. package/utilities/package-manager.js +5 -5
  123. package/utilities/package-metadata.d.ts +1 -1
  124. package/utilities/package-metadata.js +8 -1
  125. package/utilities/package-tree.d.ts +1 -1
  126. package/utilities/package-tree.js +1 -1
  127. package/utilities/project.d.ts +7 -0
  128. package/utilities/project.js +3 -3
  129. package/utilities/prompt.d.ts +7 -0
  130. package/utilities/prompt.js +3 -3
  131. package/utilities/spinner.d.ts +1 -1
  132. package/utilities/spinner.js +1 -1
  133. package/utilities/tty.d.ts +1 -1
  134. package/utilities/tty.js +1 -1
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSharedAnalytics = exports.getWorkspaceAnalytics = exports.hasWorkspaceAnalyticsConfiguration = exports.getGlobalAnalytics = exports.hasGlobalAnalyticsConfiguration = exports.promptProjectAnalytics = exports.promptGlobalAnalytics = exports.setAnalyticsConfig = exports.isPackageNameSafeForAnalytics = exports.analyticsPackageSafelist = exports.AnalyticsProperties = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getSharedAnalytics = exports.getWorkspaceAnalytics = exports.hasWorkspaceAnalyticsConfiguration = exports.getGlobalAnalytics = exports.hasGlobalAnalyticsConfiguration = exports.promptProjectAnalytics = exports.promptGlobalAnalytics = exports.setAnalyticsConfig = exports.isPackageNameSafeForAnalytics = exports.analyticsPackageSafelist = exports.AnalyticsProperties = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const debug = require("debug");
13
13
  const inquirer = require("inquirer");
@@ -16,7 +16,7 @@ const color_1 = require("../utilities/color");
16
16
  const config_1 = require("../utilities/config");
17
17
  const tty_1 = require("../utilities/tty");
18
18
  const analytics_collector_1 = require("./analytics-collector");
19
- // tslint:disable: no-console
19
+ /* eslint-disable no-console */
20
20
  const analyticsDebug = debug('ng:analytics'); // Generate analytics, including settings and users.
21
21
  let _defaultAngularCliPropertyCache;
22
22
  exports.AnalyticsProperties = {
@@ -47,7 +47,7 @@ exports.analyticsPackageSafelist = [
47
47
  '@schematics/angular',
48
48
  ];
49
49
  function isPackageNameSafeForAnalytics(name) {
50
- return exports.analyticsPackageSafelist.some(pattern => {
50
+ return exports.analyticsPackageSafelist.some((pattern) => {
51
51
  if (typeof pattern == 'string') {
52
52
  return pattern === name;
53
53
  }
@@ -252,9 +252,7 @@ exports.getGlobalAnalytics = getGlobalAnalytics;
252
252
  async function hasWorkspaceAnalyticsConfiguration() {
253
253
  try {
254
254
  const globalWorkspace = await config_1.getWorkspace('local');
255
- const analyticsConfig = globalWorkspace
256
- && globalWorkspace.getCli()
257
- && globalWorkspace.getCli()['analytics'];
255
+ const analyticsConfig = globalWorkspace && globalWorkspace.getCli() && globalWorkspace.getCli()['analytics'];
258
256
  if (analyticsConfig !== undefined) {
259
257
  return true;
260
258
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -26,7 +26,7 @@ export declare abstract class ArchitectCommand<T extends ArchitectCommandOptions
26
26
  missingTargetError: string | undefined;
27
27
  initialize(options: T & Arguments): Promise<number | void>;
28
28
  run(options: ArchitectCommandOptions & Arguments): Promise<number>;
29
- protected runSingleTarget(target: Target, targetOptions: string[]): Promise<0 | 1>;
29
+ protected runSingleTarget(target: Target, targetOptions: string[]): Promise<1 | 0>;
30
30
  protected runArchitectTarget(options: ArchitectCommandOptions & Arguments): Promise<number>;
31
31
  private getProjectNamesByTarget;
32
32
  private _makeTargetSpecifier;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArchitectCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ArchitectCommand = void 0;
11
11
  const architect_1 = require("@angular-devkit/architect");
12
12
  const node_1 = require("@angular-devkit/architect/node");
13
13
  const core_1 = require("@angular-devkit/core");
@@ -25,7 +25,7 @@ class ArchitectCommand extends command_1.Command {
25
25
  async initialize(options) {
26
26
  this._registry = new core_1.json.schema.CoreSchemaRegistry();
27
27
  this._registry.addPostTransform(core_1.json.schema.transforms.addUndefinedDefaults);
28
- this._registry.useXDeprecatedProvider(msg => this.logger.warn(msg));
28
+ this._registry.useXDeprecatedProvider((msg) => this.logger.warn(msg));
29
29
  if (!this.workspace) {
30
30
  this.logger.fatal('A workspace is required for this command.');
31
31
  return 1;
@@ -82,7 +82,7 @@ class ArchitectCommand extends command_1.Command {
82
82
  const parsedOptions = parser_1.parseArguments([...commandLeftovers], optionDefs);
83
83
  const builderLeftovers = parsedOptions['--'] || [];
84
84
  leftoverMap.set(name, { optionDefs, parsedOptions });
85
- potentialProjectNames = new Set(builderLeftovers.filter(x => potentialProjectNames.has(x)));
85
+ potentialProjectNames = new Set(builderLeftovers.filter((x) => potentialProjectNames.has(x)));
86
86
  }
87
87
  if (potentialProjectNames.size === 1) {
88
88
  projectName = [...potentialProjectNames][0];
@@ -164,13 +164,13 @@ class ArchitectCommand extends command_1.Command {
164
164
  const overrides = parser_1.parseArguments(targetOptions, targetOptionArray, this.logger);
165
165
  const allowAdditionalProperties = typeof builderDesc.optionSchema === 'object' && builderDesc.optionSchema.additionalProperties;
166
166
  if (overrides['--'] && !allowAdditionalProperties) {
167
- (overrides['--'] || []).forEach(additional => {
167
+ (overrides['--'] || []).forEach((additional) => {
168
168
  this.logger.fatal(`Unknown option: '${additional.split(/=/)[0]}'`);
169
169
  });
170
170
  return 1;
171
171
  }
172
172
  await this.reportAnalytics([this.description.name], {
173
- ...await this._architectHost.getOptionsForTarget(target),
173
+ ...(await this._architectHost.getOptionsForTarget(target)),
174
174
  ...overrides,
175
175
  });
176
176
  const run = await this._architect.scheduleTarget(target, overrides, {
@@ -227,7 +227,7 @@ class ArchitectCommand extends command_1.Command {
227
227
  }
228
228
  getProjectNamesByTarget(targetName) {
229
229
  const allProjectsForTargetName = [];
230
- // tslint:disable-next-line: no-non-null-assertion
230
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
231
231
  for (const [name, project] of this.workspace.projects) {
232
232
  if (project.targets.has(targetName)) {
233
233
  allProjectsForTargetName.push(name);
@@ -240,7 +240,7 @@ class ArchitectCommand extends command_1.Command {
240
240
  else {
241
241
  // For single target commands, we try the default project first,
242
242
  // then the full list if it has a single project, then error out.
243
- // tslint:disable-next-line: no-non-null-assertion
243
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
244
244
  const maybeDefaultProject = this.workspace.extensions['defaultProject'];
245
245
  if (maybeDefaultProject && allProjectsForTargetName.includes(maybeDefaultProject)) {
246
246
  return [maybeDefaultProject];
@@ -269,8 +269,7 @@ class ArchitectCommand extends command_1.Command {
269
269
  configuration = 'production';
270
270
  }
271
271
  if (commandOptions.configuration) {
272
- configuration =
273
- `${configuration ? `${configuration},` : ''}${commandOptions.configuration}`;
272
+ configuration = `${configuration ? `${configuration},` : ''}${commandOptions.configuration}`;
274
273
  }
275
274
  }
276
275
  if (!project) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommand = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.runCommand = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const fs_1 = require("fs");
13
13
  const path_1 = require("path");
@@ -87,7 +87,9 @@ async function loadCommandDescription(name, path, registry) {
87
87
  * @param commands The map of supported commands.
88
88
  * @param options Additional options.
89
89
  */
90
- async function runCommand(args, logger, workspace, commands = standardCommands, options = { currentDirectory: process.cwd() }) {
90
+ async function runCommand(args, logger, workspace, commands = standardCommands, options = {
91
+ currentDirectory: process.cwd(),
92
+ }) {
91
93
  var _a;
92
94
  // This registry is exclusively used for flattening schemas, and not for validating.
93
95
  const registry = new core_1.schema.CoreSchemaRegistry([]);
@@ -151,7 +153,7 @@ async function runCommand(args, logger, workspace, commands = standardCommands,
151
153
  for (const name of commandNames) {
152
154
  const aliasDesc = await loadCommandDescription(name, commands[name], registry);
153
155
  const aliases = aliasDesc.aliases;
154
- if (aliases && aliases.some(alias => alias === commandName)) {
156
+ if (aliases && aliases.some((alias) => alias === commandName)) {
155
157
  commandName = name;
156
158
  description = aliasDesc;
157
159
  break;
@@ -187,8 +189,7 @@ async function runCommand(args, logger, workspace, commands = standardCommands,
187
189
  }
188
190
  return map;
189
191
  });
190
- const analytics = options.analytics ||
191
- (await _createAnalytics(!!workspace, description.name === 'update'));
192
+ const analytics = options.analytics || (await _createAnalytics(!!workspace, description.name === 'update'));
192
193
  const context = {
193
194
  workspace,
194
195
  analytics,
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { analytics, logging } from '@angular-devkit/core';
9
9
  import { AngularWorkspace } from '../utilities/config';
10
- import { Arguments, CommandContext, CommandDescription, CommandDescriptionMap, CommandScope, Option, SubCommandDescription } from './interface';
10
+ import { Arguments, CommandContext, CommandDescription, CommandDescriptionMap, CommandScope, Option } from './interface';
11
11
  export interface BaseCommandOptions {
12
12
  help?: boolean | string;
13
13
  }
@@ -24,9 +24,8 @@ export declare abstract class Command<T extends BaseCommandOptions = BaseCommand
24
24
  constructor(context: CommandContext, description: CommandDescription, logger: logging.Logger);
25
25
  initialize(options: T & Arguments): Promise<number | void>;
26
26
  printHelp(): Promise<number>;
27
- printJsonHelp(_options: T & Arguments): Promise<number>;
27
+ printJsonHelp(): Promise<number>;
28
28
  protected printHelpUsage(): Promise<void>;
29
- protected printHelpSubcommand(subcommand: SubCommandDescription): Promise<void>;
30
29
  protected printHelpOptions(options?: Option[]): Promise<void>;
31
30
  validateScope(scope?: CommandScope): Promise<void>;
32
31
  reportAnalytics(paths: string[], options: Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
package/models/command.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Command = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Command = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const color_1 = require("../utilities/color");
13
13
  const interface_1 = require("./interface");
@@ -30,34 +30,28 @@ class Command {
30
30
  await this.printHelpOptions();
31
31
  return 0;
32
32
  }
33
- async printJsonHelp(_options) {
34
- const replacer = (key, value) => key === 'name'
35
- ? core_1.strings.dasherize(value)
36
- : value;
33
+ async printJsonHelp() {
34
+ const replacer = (key, value) => key === 'name' ? core_1.strings.dasherize(value) : value;
37
35
  this.logger.info(JSON.stringify(this.description, replacer, 2));
38
36
  return 0;
39
37
  }
40
38
  async printHelpUsage() {
41
39
  this.logger.info(this.description.description);
42
40
  const name = this.description.name;
43
- const args = this.description.options.filter(x => x.positional !== undefined);
44
- const opts = this.description.options.filter(x => x.positional === undefined);
45
- const argDisplay = args && args.length > 0 ? ' ' + args.map(a => `<${a.name}>`).join(' ') : '';
41
+ const args = this.description.options.filter((x) => x.positional !== undefined);
42
+ const opts = this.description.options.filter((x) => x.positional === undefined);
43
+ const argDisplay = args && args.length > 0 ? ' ' + args.map((a) => `<${a.name}>`).join(' ') : '';
46
44
  const optionsDisplay = opts && opts.length > 0 ? ` [options]` : ``;
47
45
  this.logger.info(`usage: ng ${name}${argDisplay}${optionsDisplay}`);
48
46
  this.logger.info('');
49
47
  }
50
- async printHelpSubcommand(subcommand) {
51
- this.logger.info(subcommand.description);
52
- await this.printHelpOptions(subcommand.options);
53
- }
54
48
  async printHelpOptions(options = this.description.options) {
55
- const args = options.filter(opt => opt.positional !== undefined);
56
- const opts = options.filter(opt => opt.positional === undefined);
49
+ const args = options.filter((opt) => opt.positional !== undefined);
50
+ const opts = options.filter((opt) => opt.positional === undefined);
57
51
  const formatDescription = (description) => ` ${description.replace(/\n/g, '\n ')}`;
58
52
  if (args.length > 0) {
59
53
  this.logger.info(`arguments:`);
60
- args.forEach(o => {
54
+ args.forEach((o) => {
61
55
  this.logger.info(` ${color_1.colors.cyan(o.name)}`);
62
56
  if (o.description) {
63
57
  this.logger.info(formatDescription(o.description));
@@ -70,11 +64,11 @@ class Command {
70
64
  }
71
65
  this.logger.info(`options:`);
72
66
  opts
73
- .filter(o => !o.hidden)
67
+ .filter((o) => !o.hidden)
74
68
  .sort((a, b) => a.name.localeCompare(b.name))
75
- .forEach(o => {
69
+ .forEach((o) => {
76
70
  const aliases = o.aliases && o.aliases.length > 0
77
- ? '(' + o.aliases.map(a => `-${a}`).join(' ') + ')'
71
+ ? '(' + o.aliases.map((a) => `-${a}`).join(' ') + ')'
78
72
  : '';
79
73
  this.logger.info(` ${color_1.colors.cyan('--' + core_1.strings.dasherize(o.name))} ${aliases}`);
80
74
  if (o.description) {
@@ -91,6 +85,7 @@ class Command {
91
85
  The ${this.description.name} command requires to be run outside of a project, but a
92
86
  project definition was found at "${this.workspace.filePath}".
93
87
  `);
88
+ // eslint-disable-next-line no-throw-literal
94
89
  throw 1;
95
90
  }
96
91
  break;
@@ -100,6 +95,7 @@ class Command {
100
95
  The ${this.description.name} command requires to be run in an Angular project, but a
101
96
  project definition could not be found.
102
97
  `);
98
+ // eslint-disable-next-line no-throw-literal
103
99
  throw 1;
104
100
  }
105
101
  break;
@@ -130,7 +126,7 @@ class Command {
130
126
  return this.printHelp();
131
127
  }
132
128
  else if (options.help === 'json' || options.help === 'JSON') {
133
- return this.printJsonHelp(options);
129
+ return this.printJsonHelp();
134
130
  }
135
131
  else {
136
132
  const startTime = +new Date();
package/models/error.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
package/models/error.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -128,7 +128,7 @@ export interface Option {
128
128
  /**
129
129
  * Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
130
130
  * or a string to show the user as a notice.
131
- */
131
+ */
132
132
  deprecated?: boolean | string;
133
133
  }
134
134
  /**
@@ -1,4 +1,11 @@
1
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
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.CommandScope = exports.OptionType = void 0;
4
11
  /**
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
- *
8
7
  */
9
8
  import { BaseException, logging } from '@angular-devkit/core';
10
9
  import { Arguments, Option } from './interface';
package/models/parser.js CHANGED
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseArguments = exports.parseFreeFormArguments = exports.ParseArgumentException = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
- *
11
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.parseArguments = exports.parseFreeFormArguments = exports.ParseArgumentException = void 0;
12
11
  const core_1 = require("@angular-devkit/core");
13
12
  const interface_1 = require("./interface");
14
13
  class ParseArgumentException extends core_1.BaseException {
@@ -85,14 +84,12 @@ function _coerce(str, o, v) {
85
84
  }
86
85
  }
87
86
  function _getOptionFromName(name, options) {
88
- const camelName = /(-|_)/.test(name)
89
- ? core_1.strings.camelize(name)
90
- : name;
87
+ const camelName = /(-|_)/.test(name) ? core_1.strings.camelize(name) : name;
91
88
  for (const option of options) {
92
89
  if (option.name === name || option.name === camelName) {
93
90
  return option;
94
91
  }
95
- if (option.aliases.some(x => x === name || x === camelName)) {
92
+ if (option.aliases.some((x) => x === name || x === camelName)) {
96
93
  return option;
97
94
  }
98
95
  }
@@ -102,7 +99,7 @@ function _removeLeadingDashes(key) {
102
99
  const from = key.startsWith('--') ? 2 : key.startsWith('-') ? 1 : 0;
103
100
  return key.substr(from);
104
101
  }
105
- function _assignOption(arg, nextArg, { options, parsedOptions, leftovers, ignored, errors, warnings }) {
102
+ function _assignOption(arg, nextArg, { options, parsedOptions, leftovers, ignored, errors, warnings, }) {
106
103
  const from = arg.startsWith('--') ? 2 : 1;
107
104
  let consumedNextArg = false;
108
105
  let key = arg.substr(from);
@@ -162,9 +159,9 @@ function _assignOption(arg, nextArg, { options, parsedOptions, leftovers, ignore
162
159
  if (v !== undefined) {
163
160
  if (parsedOptions[option.name] !== v) {
164
161
  if (parsedOptions[option.name] !== undefined && option.type !== interface_1.OptionType.Array) {
165
- warnings.push(`Option ${JSON.stringify(option.name)} was already specified with value `
166
- + `${JSON.stringify(parsedOptions[option.name])}. The new value ${JSON.stringify(v)} `
167
- + `will override it.`);
162
+ warnings.push(`Option ${JSON.stringify(option.name)} was already specified with value ` +
163
+ `${JSON.stringify(parsedOptions[option.name])}. The new value ${JSON.stringify(v)} ` +
164
+ `will override it.`);
168
165
  }
169
166
  parsedOptions[option.name] = v;
170
167
  }
@@ -172,7 +169,7 @@ function _assignOption(arg, nextArg, { options, parsedOptions, leftovers, ignore
172
169
  else {
173
170
  let error = `Argument ${key} could not be parsed using value ${JSON.stringify(value)}.`;
174
171
  if (option.enum) {
175
- error += ` Valid values are: ${option.enum.map(x => JSON.stringify(x)).join(', ')}.`;
172
+ error += ` Valid values are: ${option.enum.map((x) => JSON.stringify(x)).join(', ')}.`;
176
173
  }
177
174
  else {
178
175
  error += `Valid type(s) is: ${(option.types || [option.type]).join(', ')}`;
@@ -223,7 +220,7 @@ function parseFreeFormArguments(args) {
223
220
  }
224
221
  }
225
222
  else if (arg.startsWith('-')) {
226
- arg.split('').forEach(x => parsedOptions[x] = true);
223
+ arg.split('').forEach((x) => (parsedOptions[x] = true));
227
224
  }
228
225
  else {
229
226
  leftovers.push(arg);
@@ -342,7 +339,7 @@ function parseArguments(args, options, logger) {
342
339
  parsedOptions['--'] = [...positionals, ...leftovers];
343
340
  }
344
341
  if (warnings.length > 0 && logger) {
345
- warnings.forEach(message => logger.warn(message));
342
+ warnings.forEach((message) => logger.warn(message));
346
343
  }
347
344
  if (errors.length > 0) {
348
345
  throw new ParseArgumentException(errors, parsedOptions, ignored);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license