@angular/cli 9.1.14 → 9.1.15

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.
@@ -8,7 +8,6 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const schematic_command_1 = require("../models/schematic-command");
11
- const package_manager_1 = require("../utilities/package-manager");
12
11
  class NewCommand extends schematic_command_1.SchematicCommand {
13
12
  constructor() {
14
13
  super(...arguments);
@@ -20,7 +19,6 @@ class NewCommand extends schematic_command_1.SchematicCommand {
20
19
  return super.initialize(options);
21
20
  }
22
21
  async run(options) {
23
- await package_manager_1.ensureCompatibleNpm(this.workspace.root);
24
22
  // Register the version of the CLI in the registry.
25
23
  const packageJson = require('../package.json');
26
24
  const version = packageJson.version;
@@ -397,6 +397,13 @@ class SchematicCommand extends command_1.Command {
397
397
  error = false;
398
398
  }
399
399
  });
400
+ // Temporary compatibility check for NPM 7
401
+ if (collectionName === '@schematics/angular' && schematicName === 'ng-new') {
402
+ if (!input.skipInstall &&
403
+ (input.packageManager === undefined || input.packageManager === 'npm')) {
404
+ await package_manager_1.ensureCompatibleNpm(this.workspace.root);
405
+ }
406
+ }
400
407
  return new Promise(resolve => {
401
408
  workflow
402
409
  .execute({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "9.1.14",
3
+ "version": "9.1.15",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "homepage": "https://github.com/angular/angular-cli",
30
30
  "dependencies": {
31
- "@angular-devkit/architect": "0.901.14",
32
- "@angular-devkit/core": "9.1.14",
33
- "@angular-devkit/schematics": "9.1.14",
34
- "@schematics/angular": "9.1.14",
35
- "@schematics/update": "0.901.14",
31
+ "@angular-devkit/architect": "0.901.15",
32
+ "@angular-devkit/core": "9.1.15",
33
+ "@angular-devkit/schematics": "9.1.15",
34
+ "@schematics/angular": "9.1.15",
35
+ "@schematics/update": "0.901.15",
36
36
  "@yarnpkg/lockfile": "1.1.0",
37
37
  "ansi-colors": "4.1.1",
38
38
  "debug": "4.1.1",
@@ -52,17 +52,17 @@
52
52
  "ng-update": {
53
53
  "migrations": "@schematics/angular/migrations/migration-collection.json",
54
54
  "packageGroup": {
55
- "@angular/cli": "9.1.14",
56
- "@angular-devkit/build-angular": "0.901.14",
57
- "@angular-devkit/build-ng-packagr": "0.901.14",
58
- "@angular-devkit/build-webpack": "0.901.14",
59
- "@angular-devkit/core": "9.1.14",
60
- "@angular-devkit/schematics": "9.1.14"
55
+ "@angular/cli": "9.1.15",
56
+ "@angular-devkit/build-angular": "0.901.15",
57
+ "@angular-devkit/build-ng-packagr": "0.901.15",
58
+ "@angular-devkit/build-webpack": "0.901.15",
59
+ "@angular-devkit/core": "9.1.15",
60
+ "@angular-devkit/schematics": "9.1.15"
61
61
  }
62
62
  },
63
63
  "engines": {
64
64
  "node": ">= 10.13.0",
65
- "npm": "^6.11.0",
65
+ "npm": "^6.11.0 || ^7.5.6",
66
66
  "yarn": ">= 1.13.0"
67
67
  },
68
68
  "husky": {
@@ -3,6 +3,6 @@ export declare function supportsYarn(): boolean;
3
3
  export declare function supportsNpm(): boolean;
4
4
  export declare function getPackageManager(root: string): Promise<PackageManager>;
5
5
  /**
6
- * Checks if the npm version is version 6.x. If not, display a message and exit.
6
+ * Checks if the npm version is a supported 7.x version. If not, display a warning.
7
7
  */
8
8
  export declare function ensureCompatibleNpm(root: string): Promise<void>;
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const child_process_1 = require("child_process");
11
11
  const fs_1 = require("fs");
12
12
  const path_1 = require("path");
13
+ const semver_1 = require("semver");
13
14
  const schema_1 = require("../lib/config/schema");
14
15
  const config_1 = require("./config");
15
16
  function supports(name) {
@@ -56,26 +57,25 @@ async function getPackageManager(root) {
56
57
  }
57
58
  exports.getPackageManager = getPackageManager;
58
59
  /**
59
- * Checks if the npm version is version 6.x. If not, display a message and exit.
60
+ * Checks if the npm version is a supported 7.x version. If not, display a warning.
60
61
  */
61
62
  async function ensureCompatibleNpm(root) {
62
- var _a;
63
63
  if ((await getPackageManager(root)) !== schema_1.PackageManager.Npm) {
64
64
  return;
65
65
  }
66
66
  try {
67
- const version = child_process_1.execSync('npm --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
68
- const major = Number((_a = version.match(/^(\d+)\./)) === null || _a === void 0 ? void 0 : _a[1]);
69
- if (major === 6) {
67
+ const versionText = child_process_1.execSync('npm --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
68
+ const version = semver_1.valid(versionText);
69
+ if (!version) {
70
70
  return;
71
71
  }
72
- // tslint:disable-next-line: no-console
73
- console.error(`npm version ${version} detected.\n` +
74
- 'The Angular CLI currently requires npm version 6.\n\n' +
75
- 'Please install a compatible version to proceed (`npm install --global npm@6`).\n');
76
- process.exit(3);
72
+ if (semver_1.satisfies(version, '>=7 <7.5.6')) {
73
+ // tslint:disable-next-line: no-console
74
+ console.warn(`npm version ${version} detected.` +
75
+ ' When using npm 7 with the Angular CLI, npm version 7.5.6 or higher is recommended.');
76
+ }
77
77
  }
78
- catch (_b) {
78
+ catch (_a) {
79
79
  // npm is not installed
80
80
  }
81
81
  }