@angular/cli 11.2.0 → 11.2.4
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/update-impl.js +36 -1
- package/lib/config/schema.json +36 -1
- package/models/analytics.js +2 -2
- package/package.json +13 -13
- package/utilities/package-manager.d.ts +1 -1
- package/utilities/package-manager.js +11 -12
package/commands/update-impl.js
CHANGED
|
@@ -197,6 +197,11 @@ class UpdateCommand extends command_1.Command {
|
|
|
197
197
|
'Installing a temporary version to perform the update.');
|
|
198
198
|
return install_package_1.runTempPackageBin(`@angular/cli@${options.next ? 'next' : 'latest'}`, this.logger, this.packageManager, process.argv.slice(2));
|
|
199
199
|
}
|
|
200
|
+
const logVerbose = (message) => {
|
|
201
|
+
if (options.verbose) {
|
|
202
|
+
this.logger.info(message);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
200
205
|
if (options.all) {
|
|
201
206
|
const updateCmd = this.packageManager === schema_1.PackageManager.Yarn
|
|
202
207
|
? `'yarn upgrade-interactive' or 'yarn upgrade'`
|
|
@@ -474,7 +479,37 @@ class UpdateCommand extends command_1.Command {
|
|
|
474
479
|
for (const migration of migrations) {
|
|
475
480
|
// Resolve the package from the workspace root, as otherwise it will be resolved from the temp
|
|
476
481
|
// installed CLI version.
|
|
477
|
-
|
|
482
|
+
let packagePath;
|
|
483
|
+
logVerbose(`Resolving migration package '${migration.package}' from '${this.context.root}'...`);
|
|
484
|
+
try {
|
|
485
|
+
try {
|
|
486
|
+
packagePath = path.dirname(
|
|
487
|
+
// This may fail if the `package.json` is not exported as an entry point
|
|
488
|
+
require.resolve(path.join(migration.package, 'package.json'), {
|
|
489
|
+
paths: [this.context.root],
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
catch (e) {
|
|
493
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
494
|
+
// Fallback to trying to resolve the package's main entry point
|
|
495
|
+
packagePath = require.resolve(migration.package, { paths: [this.context.root] });
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
throw e;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
catch (e) {
|
|
503
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
504
|
+
logVerbose(e.toString());
|
|
505
|
+
this.logger.error(`Migrations for package (${migration.package}) were not found.` +
|
|
506
|
+
' The package could not be found in the workspace.');
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
this.logger.error(`Unable to resolve migrations for package (${migration.package}). [${e.message}]`);
|
|
510
|
+
}
|
|
511
|
+
return 1;
|
|
512
|
+
}
|
|
478
513
|
let migrations;
|
|
479
514
|
// Check if it is a package-local location
|
|
480
515
|
const localMigrations = path.join(packagePath, migration.collection);
|
package/lib/config/schema.json
CHANGED
|
@@ -492,7 +492,8 @@
|
|
|
492
492
|
"@angular-devkit/build-angular:karma",
|
|
493
493
|
"@angular-devkit/build-angular:protractor",
|
|
494
494
|
"@angular-devkit/build-angular:server",
|
|
495
|
-
"@angular-devkit/build-angular:tslint"
|
|
495
|
+
"@angular-devkit/build-angular:tslint",
|
|
496
|
+
"@angular-devkit/build-angular:ng-packagr"
|
|
496
497
|
]
|
|
497
498
|
}
|
|
498
499
|
},
|
|
@@ -598,6 +599,17 @@
|
|
|
598
599
|
"additionalProperties": { "$ref": "#/definitions/targetOptions/definitions/tslint" }
|
|
599
600
|
}
|
|
600
601
|
}
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"type": "object",
|
|
605
|
+
"properties": {
|
|
606
|
+
"builder": { "const": "@angular-devkit/build-angular:ng-packagr" },
|
|
607
|
+
"options": { "$ref": "#/definitions/targetOptions/definitions/ngPackagr" },
|
|
608
|
+
"configurations": {
|
|
609
|
+
"type": "object",
|
|
610
|
+
"additionalProperties": { "$ref": "#/definitions/targetOptions/definitions/ngPackagr" }
|
|
611
|
+
}
|
|
612
|
+
}
|
|
601
613
|
}
|
|
602
614
|
]
|
|
603
615
|
}
|
|
@@ -2101,6 +2113,29 @@
|
|
|
2101
2113
|
}
|
|
2102
2114
|
},
|
|
2103
2115
|
"additionalProperties": false
|
|
2116
|
+
},
|
|
2117
|
+
"ngPackagr": {
|
|
2118
|
+
"description": "ng-packagr target options for Build Architect. Use to build library projects.",
|
|
2119
|
+
"type": "object",
|
|
2120
|
+
"properties": {
|
|
2121
|
+
"project": {
|
|
2122
|
+
"type": "string",
|
|
2123
|
+
"description": "The file path for the ng-packagr configuration file, relative to the current workspace."
|
|
2124
|
+
},
|
|
2125
|
+
"tsConfig": {
|
|
2126
|
+
"type": "string",
|
|
2127
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
2128
|
+
},
|
|
2129
|
+
"watch": {
|
|
2130
|
+
"type": "boolean",
|
|
2131
|
+
"description": "Run build when files change.",
|
|
2132
|
+
"default": false
|
|
2133
|
+
}
|
|
2134
|
+
},
|
|
2135
|
+
"additionalProperties": false,
|
|
2136
|
+
"required": [
|
|
2137
|
+
"project"
|
|
2138
|
+
]
|
|
2104
2139
|
}
|
|
2105
2140
|
}
|
|
2106
2141
|
},
|
package/models/analytics.js
CHANGED
|
@@ -336,7 +336,7 @@ async function promptGlobalAnalytics(force = false) {
|
|
|
336
336
|
message: core_1.tags.stripIndents `
|
|
337
337
|
Would you like to share anonymous usage data with the Angular Team at Google under
|
|
338
338
|
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
|
|
339
|
-
how to change this setting, see
|
|
339
|
+
how to change this setting, see https://angular.io/analytics.
|
|
340
340
|
`,
|
|
341
341
|
default: false,
|
|
342
342
|
},
|
|
@@ -390,7 +390,7 @@ async function promptProjectAnalytics(force = false) {
|
|
|
390
390
|
message: core_1.tags.stripIndents `
|
|
391
391
|
Would you like to share anonymous usage data about this project with the Angular Team at
|
|
392
392
|
Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more
|
|
393
|
-
details and how to change this setting, see
|
|
393
|
+
details and how to change this setting, see https://angular.io/analytics.
|
|
394
394
|
|
|
395
395
|
`,
|
|
396
396
|
default: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.4",
|
|
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.1102.
|
|
32
|
-
"@angular-devkit/core": "11.2.
|
|
33
|
-
"@angular-devkit/schematics": "11.2.
|
|
34
|
-
"@schematics/angular": "11.2.
|
|
35
|
-
"@schematics/update": "0.1102.
|
|
31
|
+
"@angular-devkit/architect": "0.1102.4",
|
|
32
|
+
"@angular-devkit/core": "11.2.4",
|
|
33
|
+
"@angular-devkit/schematics": "11.2.4",
|
|
34
|
+
"@schematics/angular": "11.2.4",
|
|
35
|
+
"@schematics/update": "0.1102.4",
|
|
36
36
|
"@yarnpkg/lockfile": "1.1.0",
|
|
37
37
|
"ansi-colors": "4.1.1",
|
|
38
38
|
"debug": "4.3.1",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"ng-update": {
|
|
55
55
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
56
56
|
"packageGroup": {
|
|
57
|
-
"@angular/cli": "11.2.
|
|
58
|
-
"@angular-devkit/architect": "0.1102.
|
|
59
|
-
"@angular-devkit/build-angular": "0.1102.
|
|
60
|
-
"@angular-devkit/build-webpack": "0.1102.
|
|
61
|
-
"@angular-devkit/core": "11.2.
|
|
62
|
-
"@angular-devkit/schematics": "11.2.
|
|
57
|
+
"@angular/cli": "11.2.4",
|
|
58
|
+
"@angular-devkit/architect": "0.1102.4",
|
|
59
|
+
"@angular-devkit/build-angular": "0.1102.4",
|
|
60
|
+
"@angular-devkit/build-webpack": "0.1102.4",
|
|
61
|
+
"@angular-devkit/core": "11.2.4",
|
|
62
|
+
"@angular-devkit/schematics": "11.2.4"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">= 10.13.0",
|
|
67
|
-
"npm": "^6.11.0",
|
|
67
|
+
"npm": "^6.11.0 || ^7.5.6",
|
|
68
68
|
"yarn": ">= 1.13.0"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -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,27 +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
|
-
|
|
78
|
-
process.exit(3);
|
|
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
|
+
}
|
|
79
78
|
}
|
|
80
|
-
catch (
|
|
79
|
+
catch (_a) {
|
|
81
80
|
// npm is not installed
|
|
82
81
|
}
|
|
83
82
|
}
|