@angular/cli 12.1.0-next.3 → 12.1.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 (37) hide show
  1. package/commands/analytics-impl.d.ts +1 -1
  2. package/commands/config-impl.d.ts +1 -1
  3. package/commands/doc-impl.js +25 -3
  4. package/commands/e2e-impl.d.ts +1 -1
  5. package/commands/e2e-impl.js +1 -0
  6. package/commands/new-impl.js +2 -2
  7. package/commands/update-impl.js +24 -4
  8. package/commands/version-impl.js +20 -1
  9. package/lib/config/schema.json +8 -6
  10. package/lib/config/workspace-schema.d.ts +18 -5
  11. package/lib/config/workspace-schema.js +20 -8
  12. package/lib/init.js +29 -33
  13. package/models/analytics-collector.js +27 -5
  14. package/models/analytics.js +27 -4
  15. package/models/architect-command.d.ts +1 -1
  16. package/models/architect-command.js +2 -1
  17. package/models/command-runner.js +20 -1
  18. package/models/schematic-command.js +21 -2
  19. package/models/schematic-engine-host.js +10 -6
  20. package/package.json +17 -18
  21. package/src/commands/update/schematic/index.js +24 -5
  22. package/utilities/color.js +20 -1
  23. package/utilities/config.js +22 -3
  24. package/utilities/find-up.js +20 -1
  25. package/utilities/install-package.js +2 -5
  26. package/{src/commands/update/schematic → utilities}/package-json.d.ts +0 -0
  27. package/{src/commands/update/schematic → utilities}/package-json.js +0 -0
  28. package/utilities/package-metadata.d.ts +26 -9
  29. package/utilities/package-metadata.js +88 -30
  30. package/utilities/package-tree.js +21 -2
  31. package/utilities/project.js +22 -3
  32. package/utilities/prompt.js +20 -1
  33. package/utilities/spinner.js +5 -2
  34. package/src/commands/update/schematic/npm-package-json.d.ts +0 -24
  35. package/src/commands/update/schematic/npm-package-json.js +0 -9
  36. package/src/commands/update/schematic/npm.d.ts +0 -22
  37. package/src/commands/update/schematic/npm.js +0 -140
@@ -9,5 +9,5 @@ import { Command } from '../models/command';
9
9
  import { Arguments } from '../models/interface';
10
10
  import { Schema as AnalyticsCommandSchema } from './analytics';
11
11
  export declare class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
12
- run(options: AnalyticsCommandSchema & Arguments): Promise<1 | 0 | 2 | 3 | 4>;
12
+ run(options: AnalyticsCommandSchema & Arguments): Promise<0 | 1 | 2 | 3 | 4>;
13
13
  }
@@ -9,7 +9,7 @@ import { Command } from '../models/command';
9
9
  import { Arguments } from '../models/interface';
10
10
  import { Schema as ConfigCommandSchema } from './config';
11
11
  export declare class ConfigCommand extends Command<ConfigCommandSchema> {
12
- run(options: ConfigCommandSchema & Arguments): Promise<1 | 0>;
12
+ run(options: ConfigCommandSchema & Arguments): Promise<0 | 1>;
13
13
  private get;
14
14
  private set;
15
15
  }
@@ -6,9 +6,31 @@
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
8
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
32
  exports.DocCommand = void 0;
11
- const open = require("open");
33
+ const open_1 = __importDefault(require("open"));
12
34
  const command_1 = require("../models/command");
13
35
  class DocCommand extends command_1.Command {
14
36
  async run(options) {
@@ -36,7 +58,7 @@ class DocCommand extends command_1.Command {
36
58
  // and use it if we can find it
37
59
  try {
38
60
  /* eslint-disable-next-line import/no-extraneous-dependencies */
39
- const currentNgVersion = (await Promise.resolve().then(() => require('@angular/core'))).VERSION.major;
61
+ const currentNgVersion = (await Promise.resolve().then(() => __importStar(require('@angular/core')))).VERSION.major;
40
62
  domain = `v${currentNgVersion}.angular.io`;
41
63
  }
42
64
  catch (e) { }
@@ -45,7 +67,7 @@ class DocCommand extends command_1.Command {
45
67
  if (options.search) {
46
68
  searchUrl = `https://${domain}/docs?search=${options.keyword}`;
47
69
  }
48
- await open(searchUrl, {
70
+ await open_1.default(searchUrl, {
49
71
  wait: false,
50
72
  });
51
73
  }
@@ -11,6 +11,6 @@ import { Schema as E2eCommandSchema } from './e2e';
11
11
  export declare class E2eCommand extends ArchitectCommand<E2eCommandSchema> {
12
12
  readonly target = "e2e";
13
13
  readonly multiTarget = true;
14
- readonly missingTargetError = "\nCannot find \"e2e\" target for the specified project.\n\nYou should add a package that implements end-to-end testing capabilities.\n\nFor example:\n Cypress: ng add @cypress/schematic\n WebdriverIO: ng add @wdio/schematics\n\nMore options will be added to the list as they become available.\n";
14
+ readonly missingTargetError = "\nCannot find \"e2e\" target for the specified project.\n\nYou should add a package that implements end-to-end testing capabilities.\n\nFor example:\n Cypress: ng add @cypress/schematic\n Nightwatch: ng add @nightwatch/schematics\n WebdriverIO: ng add @wdio/schematics\n\nMore options will be added to the list as they become available.\n";
15
15
  initialize(options: E2eCommandSchema & Arguments): Promise<number | void>;
16
16
  }
@@ -21,6 +21,7 @@ You should add a package that implements end-to-end testing capabilities.
21
21
 
22
22
  For example:
23
23
  Cypress: ng add @cypress/schematic
24
+ Nightwatch: ng add @nightwatch/schematics
24
25
  WebdriverIO: ng add @wdio/schematics
25
26
 
26
27
  More options will be added to the list as they become available.
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.NewCommand = void 0;
11
11
  const schematic_command_1 = require("../models/schematic-command");
12
+ const version_1 = require("../models/version");
12
13
  class NewCommand extends schematic_command_1.SchematicCommand {
13
14
  constructor() {
14
15
  super(...arguments);
@@ -21,8 +22,7 @@ class NewCommand extends schematic_command_1.SchematicCommand {
21
22
  }
22
23
  async run(options) {
23
24
  // Register the version of the CLI in the registry.
24
- const packageJson = require('../package.json');
25
- const version = packageJson.version;
25
+ const version = version_1.VERSION.full;
26
26
  this._workflow.registry.addSmartDefaultProvider('ng-cli-version', () => version);
27
27
  return this.runSchematic({
28
28
  collectionName: this.collectionName,
@@ -6,17 +6,37 @@
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
8
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
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.UpdateCommand = void 0;
11
30
  const schematics_1 = require("@angular-devkit/schematics");
12
31
  const tools_1 = require("@angular-devkit/schematics/tools");
13
32
  const child_process_1 = require("child_process");
14
- const fs = require("fs");
15
- const path = require("path");
16
- const semver = require("semver");
33
+ const fs = __importStar(require("fs"));
34
+ const path = __importStar(require("path"));
35
+ const semver = __importStar(require("semver"));
17
36
  const workspace_schema_1 = require("../lib/config/workspace-schema");
18
37
  const command_1 = require("../models/command");
19
38
  const schematic_engine_host_1 = require("../models/schematic-engine-host");
39
+ const version_1 = require("../models/version");
20
40
  const color_1 = require("../utilities/color");
21
41
  const install_package_1 = require("../utilities/install-package");
22
42
  const log_file_1 = require("../utilities/log-file");
@@ -634,7 +654,7 @@ class UpdateCommand extends command_1.Command {
634
654
  * @returns `true` when the installed version is older.
635
655
  */
636
656
  async checkCLILatestVersion(verbose = false, next = false) {
637
- const { version: installedCLIVersion } = require('../package.json');
657
+ const installedCLIVersion = version_1.VERSION.full;
638
658
  const LatestCLIManifest = await package_metadata_1.fetchPackageManifest(`@angular/cli@${next ? 'next' : 'latest'}`, this.logger, {
639
659
  verbose,
640
660
  usingYarn: this.packageManager === workspace_schema_1.PackageManager.Yarn,
@@ -6,10 +6,29 @@
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
8
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
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.VersionCommand = void 0;
11
30
  const child_process_1 = require("child_process");
12
- const path = require("path");
31
+ const path = __importStar(require("path"));
13
32
  const command_1 = require("../models/command");
14
33
  const color_1 = require("../utilities/color");
15
34
  const package_manager_1 = require("../utilities/package-manager");
@@ -844,14 +844,15 @@
844
844
  ]
845
845
  },
846
846
  "style": {
847
- "description": "The file extension or preprocessor to use for style files.",
847
+ "description": "The file extension or preprocessor to use for style files, or 'none' to skip generating the style file.",
848
848
  "type": "string",
849
849
  "default": "css",
850
850
  "enum": [
851
851
  "css",
852
852
  "scss",
853
853
  "sass",
854
- "less"
854
+ "less",
855
+ "none"
855
856
  ],
856
857
  "x-user-analytics": 5
857
858
  },
@@ -1580,7 +1581,8 @@
1580
1581
  "target": {
1581
1582
  "type": "string",
1582
1583
  "description": "The target to apply web worker to.",
1583
- "default": "build"
1584
+ "default": "build",
1585
+ "x-deprecated": "No longer has an effect."
1584
1586
  },
1585
1587
  "name": {
1586
1588
  "type": "string",
@@ -1690,7 +1692,7 @@
1690
1692
  "type": "object",
1691
1693
  "properties": {
1692
1694
  "includePaths": {
1693
- "description": "Paths to include. Paths will be resolved to project root.",
1695
+ "description": "Paths to include. Paths will be resolved to workspace root.",
1694
1696
  "type": "array",
1695
1697
  "items": {
1696
1698
  "type": "string"
@@ -2471,7 +2473,7 @@
2471
2473
  "type": "object",
2472
2474
  "properties": {
2473
2475
  "includePaths": {
2474
- "description": "Paths to include. Paths will be resolved to project root.",
2476
+ "description": "Paths to include. Paths will be resolved to workspace root.",
2475
2477
  "type": "array",
2476
2478
  "items": {
2477
2479
  "type": "string"
@@ -2746,7 +2748,7 @@
2746
2748
  "type": "object",
2747
2749
  "properties": {
2748
2750
  "includePaths": {
2749
- "description": "Paths to include. Paths will be resolved to project root.",
2751
+ "description": "Paths to include. Paths will be resolved to workspace root.",
2750
2752
  "type": "array",
2751
2753
  "items": {
2752
2754
  "type": "string"
@@ -150,7 +150,7 @@ export interface AngularApplicationOptionsSchema {
150
150
  /**
151
151
  * The file extension or preprocessor to use for style files.
152
152
  */
153
- style?: Style;
153
+ style?: SchematicsAngularApplicationStyle;
154
154
  /**
155
155
  * The view encapsulation strategy to use in the new app.
156
156
  */
@@ -159,7 +159,7 @@ export interface AngularApplicationOptionsSchema {
159
159
  /**
160
160
  * The file extension or preprocessor to use for style files.
161
161
  */
162
- export declare enum Style {
162
+ export declare enum SchematicsAngularApplicationStyle {
163
163
  Css = "css",
164
164
  Less = "less",
165
165
  Sass = "sass",
@@ -280,9 +280,10 @@ export interface AngularComponentOptionsSchema {
280
280
  */
281
281
  skipTests?: boolean;
282
282
  /**
283
- * The file extension or preprocessor to use for style files.
283
+ * The file extension or preprocessor to use for style files, or 'none' to skip generating
284
+ * the style file.
284
285
  */
285
- style?: Style;
286
+ style?: SchematicsAngularComponentStyle;
286
287
  /**
287
288
  * Adds a developer-defined type to the filename, in the format "name.type.ts".
288
289
  */
@@ -299,6 +300,17 @@ export declare enum ChangeDetection {
299
300
  Default = "Default",
300
301
  OnPush = "OnPush"
301
302
  }
303
+ /**
304
+ * The file extension or preprocessor to use for style files, or 'none' to skip generating
305
+ * the style file.
306
+ */
307
+ export declare enum SchematicsAngularComponentStyle {
308
+ Css = "css",
309
+ Less = "less",
310
+ None = "none",
311
+ Sass = "sass",
312
+ Scss = "scss"
313
+ }
302
314
  /**
303
315
  * Creates a new, generic directive definition in the given or default project.
304
316
  */
@@ -596,7 +608,7 @@ export interface AngularNgNewOptionsSchema {
596
608
  /**
597
609
  * The file extension or preprocessor to use for style files.
598
610
  */
599
- style?: Style;
611
+ style?: SchematicsAngularApplicationStyle;
600
612
  /**
601
613
  * The version of the Angular CLI to use.
602
614
  */
@@ -735,6 +747,7 @@ export interface AngularWebWorkerOptionsSchema {
735
747
  snippet?: boolean;
736
748
  /**
737
749
  * The target to apply web worker to.
750
+ * @deprecated No longer has an effect.
738
751
  */
739
752
  target?: string;
740
753
  }
@@ -2,7 +2,7 @@
2
2
  // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
3
  // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Implement = exports.ChangeDetection = exports.ViewEncapsulation = exports.Style = exports.PackageManager = void 0;
5
+ exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.PackageManager = void 0;
6
6
  /**
7
7
  * Specify which package manager tool to use.
8
8
  *
@@ -18,13 +18,13 @@ var PackageManager;
18
18
  /**
19
19
  * The file extension or preprocessor to use for style files.
20
20
  */
21
- var Style;
22
- (function (Style) {
23
- Style["Css"] = "css";
24
- Style["Less"] = "less";
25
- Style["Sass"] = "sass";
26
- Style["Scss"] = "scss";
27
- })(Style = exports.Style || (exports.Style = {}));
21
+ var SchematicsAngularApplicationStyle;
22
+ (function (SchematicsAngularApplicationStyle) {
23
+ SchematicsAngularApplicationStyle["Css"] = "css";
24
+ SchematicsAngularApplicationStyle["Less"] = "less";
25
+ SchematicsAngularApplicationStyle["Sass"] = "sass";
26
+ SchematicsAngularApplicationStyle["Scss"] = "scss";
27
+ })(SchematicsAngularApplicationStyle = exports.SchematicsAngularApplicationStyle || (exports.SchematicsAngularApplicationStyle = {}));
28
28
  /**
29
29
  * The view encapsulation strategy to use in the new app.
30
30
  *
@@ -46,6 +46,18 @@ var ChangeDetection;
46
46
  ChangeDetection["Default"] = "Default";
47
47
  ChangeDetection["OnPush"] = "OnPush";
48
48
  })(ChangeDetection = exports.ChangeDetection || (exports.ChangeDetection = {}));
49
+ /**
50
+ * The file extension or preprocessor to use for style files, or 'none' to skip generating
51
+ * the style file.
52
+ */
53
+ var SchematicsAngularComponentStyle;
54
+ (function (SchematicsAngularComponentStyle) {
55
+ SchematicsAngularComponentStyle["Css"] = "css";
56
+ SchematicsAngularComponentStyle["Less"] = "less";
57
+ SchematicsAngularComponentStyle["None"] = "none";
58
+ SchematicsAngularComponentStyle["Sass"] = "sass";
59
+ SchematicsAngularComponentStyle["Scss"] = "scss";
60
+ })(SchematicsAngularComponentStyle = exports.SchematicsAngularComponentStyle || (exports.SchematicsAngularComponentStyle = {}));
49
61
  var Implement;
50
62
  (function (Implement) {
51
63
  Implement["CanActivate"] = "CanActivate";
package/lib/init.js CHANGED
@@ -6,38 +6,34 @@
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
8
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
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  require("symbol-observable");
11
30
  // symbol polyfill must go first
12
- const fs = require("fs");
13
- const path = require("path");
31
+ const fs_1 = require("fs");
32
+ const path = __importStar(require("path"));
14
33
  const semver_1 = require("semver");
34
+ const version_1 = require("../models/version");
15
35
  const color_1 = require("../utilities/color");
16
36
  const config_1 = require("../utilities/config");
17
- // Check if we need to profile this CLI run.
18
- if (process.env['NG_CLI_PROFILING']) {
19
- let profiler;
20
- try {
21
- profiler = require('v8-profiler-node8'); // eslint-disable-line import/no-extraneous-dependencies
22
- }
23
- catch (err) {
24
- throw new Error(`Could not require 'v8-profiler-node8'. You must install it separetely with ` +
25
- `'npm install v8-profiler-node8 --no-save'.\n\nOriginal error:\n\n${err}`);
26
- }
27
- profiler.startProfiling();
28
- const exitHandler = (options) => {
29
- if (options.cleanup) {
30
- const cpuProfile = profiler.stopProfiling();
31
- fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING || '') + '.cpuprofile', JSON.stringify(cpuProfile));
32
- }
33
- if (options.exit) {
34
- process.exit();
35
- }
36
- };
37
- process.on('exit', () => exitHandler({ cleanup: true }));
38
- process.on('SIGINT', () => exitHandler({ exit: true }));
39
- process.on('uncaughtException', () => exitHandler({ exit: true }));
40
- }
41
37
  (async () => {
42
38
  var _a;
43
39
  /**
@@ -56,21 +52,21 @@ if (process.env['NG_CLI_PROFILING']) {
56
52
  disableVersionCheckEnv !== '0' &&
57
53
  disableVersionCheckEnv.toLowerCase() !== 'false';
58
54
  if (disableVersionCheck) {
59
- return (await Promise.resolve().then(() => require('./cli'))).default;
55
+ return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
60
56
  }
61
57
  let cli;
62
58
  try {
63
59
  // No error implies a projectLocalCli, which will load whatever
64
60
  // version of ng-cli you have installed in a local package.json
65
61
  const projectLocalCli = require.resolve('@angular/cli', { paths: [process.cwd()] });
66
- cli = await Promise.resolve().then(() => require(projectLocalCli));
67
- const globalVersion = new semver_1.SemVer(require('../package.json').version);
62
+ cli = await Promise.resolve().then(() => __importStar(require(projectLocalCli)));
63
+ const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
68
64
  // Older versions might not have the VERSION export
69
65
  let localVersion = (_a = cli.VERSION) === null || _a === void 0 ? void 0 : _a.full;
70
66
  if (!localVersion) {
71
67
  try {
72
- localVersion = require(path.join(path.dirname(projectLocalCli), '../../package.json'))
73
- .version;
68
+ const localPackageJson = await fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
69
+ localVersion = JSON.parse(localPackageJson).version;
74
70
  }
75
71
  catch (error) {
76
72
  // eslint-disable-next-line no-console
@@ -89,7 +85,7 @@ if (process.env['NG_CLI_PROFILING']) {
89
85
  // If using the update command and the global version is greater, use the newer update command
90
86
  // This allows improvements in update to be used in older versions that do not have bootstrapping
91
87
  if (process.argv[2] === 'update') {
92
- cli = await Promise.resolve().then(() => require('./cli'));
88
+ cli = await Promise.resolve().then(() => __importStar(require('./cli')));
93
89
  }
94
90
  else if (await config_1.isWarningEnabled('versionMismatch')) {
95
91
  // Otherwise, use local version and warn if global is newer than local
@@ -106,7 +102,7 @@ if (process.env['NG_CLI_PROFILING']) {
106
102
  // library from a package.json. Instead, include it from a relative
107
103
  // path to this script file (which is likely a globally installed
108
104
  // npm package). Most common cause for hitting this is `ng new`
109
- cli = await Promise.resolve().then(() => require('./cli'));
105
+ cli = await Promise.resolve().then(() => __importStar(require('./cli')));
110
106
  }
111
107
  if ('default' in cli) {
112
108
  cli = cli['default'];
@@ -6,14 +6,36 @@
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
8
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
32
  exports.AnalyticsCollector = void 0;
11
33
  const core_1 = require("@angular-devkit/core");
12
34
  const child_process_1 = require("child_process");
13
- const debug = require("debug");
14
- const https = require("https");
15
- const os = require("os");
16
- const querystring = require("querystring");
35
+ const debug_1 = __importDefault(require("debug"));
36
+ const https = __importStar(require("https"));
37
+ const os = __importStar(require("os"));
38
+ const querystring = __importStar(require("querystring"));
17
39
  const version_1 = require("./version");
18
40
  /**
19
41
  * See: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
@@ -22,7 +44,7 @@ class AnalyticsCollector {
22
44
  constructor(trackingId, userId) {
23
45
  this.trackingEventsQueue = [];
24
46
  this.parameters = {};
25
- this.analyticsLogDebug = debug('ng:analytics:log');
47
+ this.analyticsLogDebug = debug_1.default('ng:analytics:log');
26
48
  // API Version
27
49
  this.parameters['v'] = '1';
28
50
  // User ID
@@ -6,18 +6,41 @@
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
8
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
32
  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
33
  const core_1 = require("@angular-devkit/core");
12
- const debug = require("debug");
13
- const inquirer = require("inquirer");
34
+ const debug_1 = __importDefault(require("debug"));
35
+ const inquirer = __importStar(require("inquirer"));
14
36
  const uuid_1 = require("uuid");
37
+ const version_1 = require("../models/version");
15
38
  const color_1 = require("../utilities/color");
16
39
  const config_1 = require("../utilities/config");
17
40
  const tty_1 = require("../utilities/tty");
18
41
  const analytics_collector_1 = require("./analytics-collector");
19
42
  /* eslint-disable no-console */
20
- const analyticsDebug = debug('ng:analytics'); // Generate analytics, including settings and users.
43
+ const analyticsDebug = debug_1.default('ng:analytics'); // Generate analytics, including settings and users.
21
44
  let _defaultAngularCliPropertyCache;
22
45
  exports.AnalyticsProperties = {
23
46
  AngularCliProd: 'UA-8594346-29',
@@ -26,7 +49,7 @@ exports.AnalyticsProperties = {
26
49
  if (_defaultAngularCliPropertyCache) {
27
50
  return _defaultAngularCliPropertyCache;
28
51
  }
29
- const v = require('../package.json').version;
52
+ const v = version_1.VERSION.full;
30
53
  // The logic is if it's a full version then we should use the prod GA property.
31
54
  if (/^\d+\.\d+\.\d+$/.test(v) && v !== '0.0.0') {
32
55
  _defaultAngularCliPropertyCache = exports.AnalyticsProperties.AngularCliProd;
@@ -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<1 | 0>;
29
+ protected runSingleTarget(target: Target, targetOptions: string[]): Promise<0 | 1>;
30
30
  protected runArchitectTarget(options: ArchitectCommandOptions & Arguments): Promise<number>;
31
31
  private getProjectNamesByTarget;
32
32
  private _makeTargetSpecifier;
@@ -185,6 +185,7 @@ class ArchitectCommand extends command_1.Command {
185
185
  return success ? 0 : 1;
186
186
  }
187
187
  async runArchitectTarget(options) {
188
+ var _a;
188
189
  const extra = options['--'] || [];
189
190
  try {
190
191
  const targetSpec = this._makeTargetSpecifier(options);
@@ -206,7 +207,7 @@ class ArchitectCommand extends command_1.Command {
206
207
  const newErrors = [];
207
208
  for (const schemaError of e.errors) {
208
209
  if (schemaError.keyword === 'additionalProperties') {
209
- const unknownProperty = schemaError.params.additionalProperty;
210
+ const unknownProperty = (_a = schemaError.params) === null || _a === void 0 ? void 0 : _a.additionalProperty;
210
211
  if (unknownProperty in options) {
211
212
  const dashes = unknownProperty.length === 1 ? '-' : '--';
212
213
  this.logger.fatal(`Unknown option: '${dashes}${unknownProperty}'`);
@@ -6,6 +6,25 @@
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
8
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
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.runCommand = void 0;
11
30
  const core_1 = require("@angular-devkit/core");
@@ -15,7 +34,7 @@ const json_file_1 = require("../utilities/json-file");
15
34
  const json_schema_1 = require("../utilities/json-schema");
16
35
  const analytics_1 = require("./analytics");
17
36
  const command_1 = require("./command");
18
- const parser = require("./parser");
37
+ const parser = __importStar(require("./parser"));
19
38
  // NOTE: Update commands.json if changing this. It's still deep imported in one CI validation
20
39
  const standardCommands = {
21
40
  'add': '../commands/add.json',