@angular/cli 12.1.0-next.6 → 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.
@@ -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,
@@ -36,6 +36,7 @@ const semver = __importStar(require("semver"));
36
36
  const workspace_schema_1 = require("../lib/config/workspace-schema");
37
37
  const command_1 = require("../models/command");
38
38
  const schematic_engine_host_1 = require("../models/schematic-engine-host");
39
+ const version_1 = require("../models/version");
39
40
  const color_1 = require("../utilities/color");
40
41
  const install_package_1 = require("../utilities/install-package");
41
42
  const log_file_1 = require("../utilities/log-file");
@@ -653,7 +654,7 @@ class UpdateCommand extends command_1.Command {
653
654
  * @returns `true` when the installed version is older.
654
655
  */
655
656
  async checkCLILatestVersion(verbose = false, next = false) {
656
- const { version: installedCLIVersion } = require('../package.json');
657
+ const installedCLIVersion = version_1.VERSION.full;
657
658
  const LatestCLIManifest = await package_metadata_1.fetchPackageManifest(`@angular/cli@${next ? 'next' : 'latest'}`, this.logger, {
658
659
  verbose,
659
660
  usingYarn: this.packageManager === workspace_schema_1.PackageManager.Yarn,
@@ -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
  },
@@ -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
  */
@@ -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
@@ -28,35 +28,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  require("symbol-observable");
30
30
  // symbol polyfill must go first
31
- const fs = __importStar(require("fs"));
31
+ const fs_1 = require("fs");
32
32
  const path = __importStar(require("path"));
33
33
  const semver_1 = require("semver");
34
+ const version_1 = require("../models/version");
34
35
  const color_1 = require("../utilities/color");
35
36
  const config_1 = require("../utilities/config");
36
- // Check if we need to profile this CLI run.
37
- if (process.env['NG_CLI_PROFILING']) {
38
- let profiler;
39
- try {
40
- profiler = require('v8-profiler-node8'); // eslint-disable-line import/no-extraneous-dependencies
41
- }
42
- catch (err) {
43
- throw new Error(`Could not require 'v8-profiler-node8'. You must install it separetely with ` +
44
- `'npm install v8-profiler-node8 --no-save'.\n\nOriginal error:\n\n${err}`);
45
- }
46
- profiler.startProfiling();
47
- const exitHandler = (options) => {
48
- if (options.cleanup) {
49
- const cpuProfile = profiler.stopProfiling();
50
- fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING || '') + '.cpuprofile', JSON.stringify(cpuProfile));
51
- }
52
- if (options.exit) {
53
- process.exit();
54
- }
55
- };
56
- process.on('exit', () => exitHandler({ cleanup: true }));
57
- process.on('SIGINT', () => exitHandler({ exit: true }));
58
- process.on('uncaughtException', () => exitHandler({ exit: true }));
59
- }
60
37
  (async () => {
61
38
  var _a;
62
39
  /**
@@ -83,13 +60,13 @@ if (process.env['NG_CLI_PROFILING']) {
83
60
  // version of ng-cli you have installed in a local package.json
84
61
  const projectLocalCli = require.resolve('@angular/cli', { paths: [process.cwd()] });
85
62
  cli = await Promise.resolve().then(() => __importStar(require(projectLocalCli)));
86
- const globalVersion = new semver_1.SemVer(require('../package.json').version);
63
+ const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
87
64
  // Older versions might not have the VERSION export
88
65
  let localVersion = (_a = cli.VERSION) === null || _a === void 0 ? void 0 : _a.full;
89
66
  if (!localVersion) {
90
67
  try {
91
- localVersion = require(path.join(path.dirname(projectLocalCli), '../../package.json'))
92
- .version;
68
+ const localPackageJson = await fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
69
+ localVersion = JSON.parse(localPackageJson).version;
93
70
  }
94
71
  catch (error) {
95
72
  // eslint-disable-next-line no-console
@@ -34,6 +34,7 @@ const core_1 = require("@angular-devkit/core");
34
34
  const debug_1 = __importDefault(require("debug"));
35
35
  const inquirer = __importStar(require("inquirer"));
36
36
  const uuid_1 = require("uuid");
37
+ const version_1 = require("../models/version");
37
38
  const color_1 = require("../utilities/color");
38
39
  const config_1 = require("../utilities/config");
39
40
  const tty_1 = require("../utilities/tty");
@@ -48,7 +49,7 @@ exports.AnalyticsProperties = {
48
49
  if (_defaultAngularCliPropertyCache) {
49
50
  return _defaultAngularCliPropertyCache;
50
51
  }
51
- const v = require('../package.json').version;
52
+ const v = version_1.VERSION.full;
52
53
  // The logic is if it's a full version then we should use the prod GA property.
53
54
  if (/^\d+\.\d+\.\d+$/.test(v) && v !== '0.0.0') {
54
55
  _defaultAngularCliPropertyCache = exports.AnalyticsProperties.AngularCliProd;
@@ -6,6 +6,9 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
9
12
  var _a;
10
13
  Object.defineProperty(exports, "__esModule", { value: true });
11
14
  exports.SchematicEngineHost = void 0;
@@ -13,6 +16,7 @@ const schematics_1 = require("@angular-devkit/schematics");
13
16
  const tools_1 = require("@angular-devkit/schematics/tools");
14
17
  const fs_1 = require("fs");
15
18
  const jsonc_parser_1 = require("jsonc-parser");
19
+ const module_1 = __importDefault(require("module"));
16
20
  const path_1 = require("path");
17
21
  const vm_1 = require("vm");
18
22
  /**
@@ -97,8 +101,7 @@ const legacyModules = {
97
101
  * @param exportName An optional name of a specific export to return. Otherwise, return all exports.
98
102
  */
99
103
  function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
100
- const { createRequire } = require('module');
101
- const scopedRequire = createRequire(schematicFile);
104
+ const scopedRequire = module_1.default.createRequire(schematicFile);
102
105
  const customRequire = function (id) {
103
106
  if (legacyModules[id]) {
104
107
  // Provide compatibility modules for older versions of @angular/cdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "12.1.0-next.6",
3
+ "version": "12.1.0",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/angular/angular-cli",
30
30
  "dependencies": {
31
- "@angular-devkit/architect": "0.1201.0-next.6",
32
- "@angular-devkit/core": "12.1.0-next.6",
33
- "@angular-devkit/schematics": "12.1.0-next.6",
34
- "@schematics/angular": "12.1.0-next.6",
31
+ "@angular-devkit/architect": "0.1201.0",
32
+ "@angular-devkit/core": "12.1.0",
33
+ "@angular-devkit/schematics": "12.1.0",
34
+ "@schematics/angular": "12.1.0",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
36
  "ansi-colors": "4.1.1",
37
37
  "debug": "4.3.1",
@@ -40,7 +40,7 @@
40
40
  "jsonc-parser": "3.0.0",
41
41
  "npm-package-arg": "8.1.5",
42
42
  "npm-pick-manifest": "6.1.1",
43
- "open": "8.2.0",
43
+ "open": "8.2.1",
44
44
  "ora": "5.4.1",
45
45
  "pacote": "11.3.4",
46
46
  "resolve": "1.20.0",
@@ -51,12 +51,12 @@
51
51
  "ng-update": {
52
52
  "migrations": "@schematics/angular/migrations/migration-collection.json",
53
53
  "packageGroup": {
54
- "@angular/cli": "12.1.0-next.6",
55
- "@angular-devkit/architect": "0.1201.0-next.6",
56
- "@angular-devkit/build-angular": "12.1.0-next.6",
57
- "@angular-devkit/build-webpack": "0.1201.0-next.6",
58
- "@angular-devkit/core": "12.1.0-next.6",
59
- "@angular-devkit/schematics": "12.1.0-next.6"
54
+ "@angular/cli": "12.1.0",
55
+ "@angular-devkit/architect": "0.1201.0",
56
+ "@angular-devkit/build-angular": "12.1.0",
57
+ "@angular-devkit/build-webpack": "0.1201.0",
58
+ "@angular-devkit/core": "12.1.0",
59
+ "@angular-devkit/schematics": "12.1.0"
60
60
  }
61
61
  },
62
62
  "engines": {