@angular/cli 10.2.2 → 10.2.3
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.
package/commands/new-impl.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NewCommand = void 0;
|
|
4
4
|
const schematic_command_1 = require("../models/schematic-command");
|
|
5
|
-
const package_manager_1 = require("../utilities/package-manager");
|
|
6
5
|
class NewCommand extends schematic_command_1.SchematicCommand {
|
|
7
6
|
constructor() {
|
|
8
7
|
super(...arguments);
|
|
@@ -14,7 +13,6 @@ class NewCommand extends schematic_command_1.SchematicCommand {
|
|
|
14
13
|
return super.initialize(options);
|
|
15
14
|
}
|
|
16
15
|
async run(options) {
|
|
17
|
-
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
18
16
|
// Register the version of the CLI in the registry.
|
|
19
17
|
const packageJson = require('../package.json');
|
|
20
18
|
const version = packageJson.version;
|
|
@@ -398,6 +398,13 @@ class SchematicCommand extends command_1.Command {
|
|
|
398
398
|
error = false;
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
|
+
// Temporary compatibility check for NPM 7
|
|
402
|
+
if (collectionName === '@schematics/angular' && schematicName === 'ng-new') {
|
|
403
|
+
if (!input.skipInstall &&
|
|
404
|
+
(input.packageManager === undefined || input.packageManager === 'npm')) {
|
|
405
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
401
408
|
return new Promise(resolve => {
|
|
402
409
|
workflow
|
|
403
410
|
.execute({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.3",
|
|
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.1002.
|
|
32
|
-
"@angular-devkit/core": "10.2.
|
|
33
|
-
"@angular-devkit/schematics": "10.2.
|
|
34
|
-
"@schematics/angular": "10.2.
|
|
35
|
-
"@schematics/update": "0.1002.
|
|
31
|
+
"@angular-devkit/architect": "0.1002.3",
|
|
32
|
+
"@angular-devkit/core": "10.2.3",
|
|
33
|
+
"@angular-devkit/schematics": "10.2.3",
|
|
34
|
+
"@schematics/angular": "10.2.3",
|
|
35
|
+
"@schematics/update": "0.1002.3",
|
|
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": "10.2.
|
|
56
|
-
"@angular-devkit/build-angular": "0.1002.
|
|
57
|
-
"@angular-devkit/build-ng-packagr": "0.1002.
|
|
58
|
-
"@angular-devkit/build-webpack": "0.1002.
|
|
59
|
-
"@angular-devkit/core": "10.2.
|
|
60
|
-
"@angular-devkit/schematics": "10.2.
|
|
55
|
+
"@angular/cli": "10.2.3",
|
|
56
|
+
"@angular-devkit/build-angular": "0.1002.3",
|
|
57
|
+
"@angular-devkit/build-ng-packagr": "0.1002.3",
|
|
58
|
+
"@angular-devkit/build-webpack": "0.1002.3",
|
|
59
|
+
"@angular-devkit/core": "10.2.3",
|
|
60
|
+
"@angular-devkit/schematics": "10.2.3"
|
|
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
|
|
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>;
|
|
@@ -11,6 +11,7 @@ exports.ensureCompatibleNpm = exports.getPackageManager = exports.supportsNpm =
|
|
|
11
11
|
const child_process_1 = require("child_process");
|
|
12
12
|
const fs_1 = require("fs");
|
|
13
13
|
const path_1 = require("path");
|
|
14
|
+
const semver_1 = require("semver");
|
|
14
15
|
const schema_1 = require("../lib/config/schema");
|
|
15
16
|
const config_1 = require("./config");
|
|
16
17
|
function supports(name) {
|
|
@@ -57,26 +58,25 @@ async function getPackageManager(root) {
|
|
|
57
58
|
}
|
|
58
59
|
exports.getPackageManager = getPackageManager;
|
|
59
60
|
/**
|
|
60
|
-
* Checks if the npm version is
|
|
61
|
+
* Checks if the npm version is a supported 7.x version. If not, display a warning.
|
|
61
62
|
*/
|
|
62
63
|
async function ensureCompatibleNpm(root) {
|
|
63
|
-
var _a;
|
|
64
64
|
if ((await getPackageManager(root)) !== schema_1.PackageManager.Npm) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
try {
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
68
|
+
const versionText = child_process_1.execSync('npm --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
69
|
+
const version = semver_1.valid(versionText);
|
|
70
|
+
if (!version) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
if (semver_1.satisfies(version, '>=7 <7.5.6')) {
|
|
74
|
+
// tslint:disable-next-line: no-console
|
|
75
|
+
console.warn(`npm version ${version} detected.` +
|
|
76
|
+
' When using npm 7 with the Angular CLI, npm version 7.5.6 or higher is recommended.');
|
|
77
|
+
}
|
|
78
78
|
}
|
|
79
|
-
catch (
|
|
79
|
+
catch (_a) {
|
|
80
80
|
// npm is not installed
|
|
81
81
|
}
|
|
82
82
|
}
|