@angular/cli 10.1.7 → 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/add-impl.js +1 -0
- package/commands/update-impl.js +1 -0
- package/commands/update-long.md +9 -4
- package/models/interface.d.ts +5 -0
- package/models/schematic-command.js +7 -0
- package/package.json +14 -14
- package/utilities/json-schema.js +5 -0
- package/utilities/package-manager.d.ts +4 -0
- package/utilities/package-manager.js +26 -1
package/commands/add-impl.js
CHANGED
|
@@ -35,6 +35,7 @@ class AddCommand extends schematic_command_1.SchematicCommand {
|
|
|
35
35
|
}
|
|
36
36
|
async run(options) {
|
|
37
37
|
var _a;
|
|
38
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
38
39
|
if (!options.collection) {
|
|
39
40
|
this.logger.fatal(`The "ng add" command requires a name argument to be specified eg. ` +
|
|
40
41
|
`${color_1.colors.yellow('ng add [name] ')}. For more details, use "ng help".`);
|
package/commands/update-impl.js
CHANGED
|
@@ -185,6 +185,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
185
185
|
}
|
|
186
186
|
// tslint:disable-next-line:no-big-function
|
|
187
187
|
async run(options) {
|
|
188
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
188
189
|
// Check if the @angular-devkit/schematics package can be resolved from the workspace root
|
|
189
190
|
// This works around issues with packages containing migrations that cannot directly depend on the package
|
|
190
191
|
// This check can be removed once the schematic runtime handles this situation
|
package/commands/update-long.md
CHANGED
|
@@ -4,14 +4,19 @@ Perform a basic update to the current stable release of the core framework and C
|
|
|
4
4
|
ng update @angular/cli @angular/core
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
To update to the next beta or pre-release version, use the `--next
|
|
7
|
+
To update to the next beta or pre-release version, use the `--next` option.
|
|
8
8
|
|
|
9
9
|
To update from one major version to another, use the format
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
ng update @angular/cli@^<major_version> @angular/core@^<major_version>
|
|
13
|
+
```
|
|
11
14
|
|
|
12
15
|
We recommend that you always update to the latest patch version, as it contains fixes we released since the initial major release.
|
|
13
|
-
For example, use the following command to take the latest
|
|
16
|
+
For example, use the following command to take the latest 10.x.x version and use that to update.
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
```
|
|
19
|
+
ng update @angular/cli@^10 @angular/core@^10
|
|
20
|
+
```
|
|
16
21
|
|
|
17
22
|
For detailed information and guidance on updating your application, see the interactive [Angular Update Guide](https://update.angular.io/).
|
package/models/interface.d.ts
CHANGED
|
@@ -129,6 +129,11 @@ export interface Option {
|
|
|
129
129
|
* If this is falsey, do not report this option.
|
|
130
130
|
*/
|
|
131
131
|
userAnalytics?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
|
|
134
|
+
* or a string to show the user as a notice.
|
|
135
|
+
*/
|
|
136
|
+
deprecated?: boolean | string;
|
|
132
137
|
}
|
|
133
138
|
/**
|
|
134
139
|
* Scope of the command.
|
|
@@ -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.
|
|
3
|
+
"version": "10.2.3",
|
|
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.
|
|
32
|
-
"@angular-devkit/core": "10.
|
|
33
|
-
"@angular-devkit/schematics": "10.
|
|
34
|
-
"@schematics/angular": "10.
|
|
35
|
-
"@schematics/update": "0.
|
|
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",
|
|
39
|
-
"ini": "1.3.
|
|
39
|
+
"ini": "1.3.6",
|
|
40
40
|
"inquirer": "7.3.3",
|
|
41
41
|
"npm-package-arg": "8.0.1",
|
|
42
42
|
"npm-pick-manifest": "6.1.0",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"ng-update": {
|
|
53
53
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
54
54
|
"packageGroup": {
|
|
55
|
-
"@angular/cli": "10.
|
|
56
|
-
"@angular-devkit/build-angular": "0.
|
|
57
|
-
"@angular-devkit/build-ng-packagr": "0.
|
|
58
|
-
"@angular-devkit/build-webpack": "0.
|
|
59
|
-
"@angular-devkit/core": "10.
|
|
60
|
-
"@angular-devkit/schematics": "10.
|
|
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": "
|
|
65
|
+
"npm": "^6.11.0 || ^7.5.6",
|
|
66
66
|
"yarn": ">= 1.13.0"
|
|
67
67
|
},
|
|
68
68
|
"husky": {
|
package/utilities/json-schema.js
CHANGED
|
@@ -199,6 +199,10 @@ async function parseJsonSchemaToOptions(registry, schema) {
|
|
|
199
199
|
const hidden = !!current.hidden || !visible;
|
|
200
200
|
const xUserAnalytics = current['x-user-analytics'];
|
|
201
201
|
const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined;
|
|
202
|
+
// Deprecated is set only if it's true or a string.
|
|
203
|
+
const xDeprecated = current['x-deprecated'];
|
|
204
|
+
const deprecated = (xDeprecated === true || typeof xDeprecated === 'string')
|
|
205
|
+
? xDeprecated : undefined;
|
|
202
206
|
const option = {
|
|
203
207
|
name,
|
|
204
208
|
description: '' + (current.description === undefined ? '' : current.description),
|
|
@@ -210,6 +214,7 @@ async function parseJsonSchemaToOptions(registry, schema) {
|
|
|
210
214
|
...format !== undefined ? { format } : {},
|
|
211
215
|
hidden,
|
|
212
216
|
...userAnalytics ? { userAnalytics } : {},
|
|
217
|
+
...deprecated !== undefined ? { deprecated } : {},
|
|
213
218
|
...positional !== undefined ? { positional } : {},
|
|
214
219
|
};
|
|
215
220
|
options.push(option);
|
|
@@ -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>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPackageManager = exports.supportsNpm = exports.supportsYarn = void 0;
|
|
3
|
+
exports.ensureCompatibleNpm = exports.getPackageManager = exports.supportsNpm = exports.supportsYarn = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -11,6 +11,7 @@ exports.getPackageManager = exports.supportsNpm = exports.supportsYarn = void 0;
|
|
|
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) {
|
|
@@ -56,3 +57,27 @@ async function getPackageManager(root) {
|
|
|
56
57
|
return packageManager || schema_1.PackageManager.Npm;
|
|
57
58
|
}
|
|
58
59
|
exports.getPackageManager = getPackageManager;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if the npm version is a supported 7.x version. If not, display a warning.
|
|
62
|
+
*/
|
|
63
|
+
async function ensureCompatibleNpm(root) {
|
|
64
|
+
if ((await getPackageManager(root)) !== schema_1.PackageManager.Npm) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
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
|
+
return;
|
|
72
|
+
}
|
|
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
|
+
}
|
|
79
|
+
catch (_a) {
|
|
80
|
+
// npm is not installed
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.ensureCompatibleNpm = ensureCompatibleNpm;
|