@angular/cli 9.1.11 → 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.
package/commands/add-impl.js
CHANGED
|
@@ -33,6 +33,7 @@ class AddCommand extends schematic_command_1.SchematicCommand {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async run(options) {
|
|
36
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
36
37
|
if (!options.collection) {
|
|
37
38
|
this.logger.fatal(`The "ng add" command requires a name argument to be specified eg. ` +
|
|
38
39
|
`${color_1.colors.yellow('ng add [name] ')}. For more details, use "ng help".`);
|
package/commands/update-impl.js
CHANGED
|
@@ -184,6 +184,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
184
184
|
}
|
|
185
185
|
// tslint:disable-next-line:no-big-function
|
|
186
186
|
async run(options) {
|
|
187
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
187
188
|
// Check if the @angular-devkit/schematics package can be resolved from the workspace root
|
|
188
189
|
// This works around issues with packages containing migrations that cannot directly depend on the package
|
|
189
190
|
// This check can be removed once the schematic runtime handles this situation
|
|
@@ -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.
|
|
3
|
+
"version": "9.1.15",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/angular/angular-cli",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@angular-devkit/architect": "0.901.
|
|
32
|
-
"@angular-devkit/core": "9.1.
|
|
33
|
-
"@angular-devkit/schematics": "9.1.
|
|
34
|
-
"@schematics/angular": "9.1.
|
|
35
|
-
"@schematics/update": "0.901.
|
|
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",
|
|
39
|
-
"ini": "1.3.
|
|
39
|
+
"ini": "1.3.6",
|
|
40
40
|
"inquirer": "7.1.0",
|
|
41
41
|
"npm-package-arg": "8.0.1",
|
|
42
42
|
"npm-pick-manifest": "6.0.0",
|
|
@@ -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.
|
|
56
|
-
"@angular-devkit/build-angular": "0.901.
|
|
57
|
-
"@angular-devkit/build-ng-packagr": "0.901.
|
|
58
|
-
"@angular-devkit/build-webpack": "0.901.
|
|
59
|
-
"@angular-devkit/core": "9.1.
|
|
60
|
-
"@angular-devkit/schematics": "9.1.
|
|
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": "
|
|
65
|
+
"npm": "^6.11.0 || ^7.5.6",
|
|
66
66
|
"yarn": ">= 1.13.0"
|
|
67
67
|
},
|
|
68
68
|
"husky": {
|
|
@@ -2,3 +2,7 @@ import { PackageManager } from '../lib/config/schema';
|
|
|
2
2
|
export declare function supportsYarn(): boolean;
|
|
3
3
|
export declare function supportsNpm(): boolean;
|
|
4
4
|
export declare function getPackageManager(root: string): Promise<PackageManager>;
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the npm version is a supported 7.x version. If not, display a warning.
|
|
7
|
+
*/
|
|
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) {
|
|
@@ -55,3 +56,27 @@ async function getPackageManager(root) {
|
|
|
55
56
|
return packageManager || schema_1.PackageManager.Npm;
|
|
56
57
|
}
|
|
57
58
|
exports.getPackageManager = getPackageManager;
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the npm version is a supported 7.x version. If not, display a warning.
|
|
61
|
+
*/
|
|
62
|
+
async function ensureCompatibleNpm(root) {
|
|
63
|
+
if ((await getPackageManager(root)) !== schema_1.PackageManager.Npm) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
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
|
+
return;
|
|
71
|
+
}
|
|
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
|
+
}
|
|
78
|
+
catch (_a) {
|
|
79
|
+
// npm is not installed
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ensureCompatibleNpm = ensureCompatibleNpm;
|