@angular/cli 8.3.1 → 8.3.5
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.
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
// This file is
|
|
2
|
+
// This file is ES5 because it needs to be executed as is.
|
|
3
3
|
|
|
4
|
-
if ('NG_CLI_ANALYTICS'
|
|
4
|
+
if (process.env['NG_CLI_ANALYTICS'] !== undefined) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const analytics = require('../../models/analytics');
|
|
8
|
+
try {
|
|
9
|
+
var analytics = require('../../models/analytics');
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})();
|
|
11
|
+
if (!analytics.hasGlobalAnalyticsConfiguration()) {
|
|
12
|
+
analytics.promptGlobalAnalytics().catch(function() { });
|
|
13
|
+
}
|
|
14
|
+
} catch (_) {}
|
package/commands/update-impl.js
CHANGED
|
@@ -121,25 +121,25 @@ class UpdateCommand extends schematic_command_1.SchematicCommand {
|
|
|
121
121
|
this.logger.warn('"next" option has no effect when using "migrate-only" option.');
|
|
122
122
|
}
|
|
123
123
|
const packageName = packages[0].name;
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const packageDependency = rootDependencies[packageName];
|
|
125
|
+
let packageNode = packageDependency && packageDependency.node;
|
|
126
|
+
if (packageDependency && !packageNode) {
|
|
126
127
|
this.logger.error('Package found in package.json but is not installed.');
|
|
127
128
|
return 1;
|
|
128
129
|
}
|
|
129
|
-
else if (!
|
|
130
|
+
else if (!packageDependency) {
|
|
130
131
|
// Allow running migrations on transitively installed dependencies
|
|
131
132
|
// There can technically be nested multiple versions
|
|
132
133
|
// TODO: If multiple, this should find all versions and ask which one to use
|
|
133
134
|
const child = packageTree.children.find(c => c.name === packageName);
|
|
134
135
|
if (child) {
|
|
135
|
-
|
|
136
|
-
packageNode = child.isLink ? child.target : child;
|
|
137
|
-
}
|
|
138
|
-
if (!packageNode) {
|
|
139
|
-
this.logger.error('Package is not installed.');
|
|
140
|
-
return 1;
|
|
136
|
+
packageNode = child;
|
|
141
137
|
}
|
|
142
138
|
}
|
|
139
|
+
if (!packageNode) {
|
|
140
|
+
this.logger.error('Package is not installed.');
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
143
|
const updateMetadata = packageNode.package['ng-update'];
|
|
144
144
|
let migrations = updateMetadata && updateMetadata.migrations;
|
|
145
145
|
if (migrations === undefined) {
|
|
@@ -200,7 +200,7 @@ class UpdateCommand extends schematic_command_1.SchematicCommand {
|
|
|
200
200
|
const requests = [];
|
|
201
201
|
// Validate packages actually are part of the workspace
|
|
202
202
|
for (const pkg of packages) {
|
|
203
|
-
const node = rootDependencies[pkg.name];
|
|
203
|
+
const node = rootDependencies[pkg.name] && rootDependencies[pkg.name].node;
|
|
204
204
|
if (!node) {
|
|
205
205
|
this.logger.error(`Package '${pkg.name}' is not a dependency.`);
|
|
206
206
|
return 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.5",
|
|
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.803.
|
|
32
|
-
"@angular-devkit/core": "8.3.
|
|
33
|
-
"@angular-devkit/schematics": "8.3.
|
|
34
|
-
"@schematics/angular": "8.3.
|
|
35
|
-
"@schematics/update": "0.803.
|
|
31
|
+
"@angular-devkit/architect": "0.803.5",
|
|
32
|
+
"@angular-devkit/core": "8.3.5",
|
|
33
|
+
"@angular-devkit/schematics": "8.3.5",
|
|
34
|
+
"@schematics/angular": "8.3.5",
|
|
35
|
+
"@schematics/update": "0.803.5",
|
|
36
36
|
"@yarnpkg/lockfile": "1.1.0",
|
|
37
37
|
"ansi-colors": "4.1.1",
|
|
38
38
|
"debug": "^4.1.1",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"ng-update": {
|
|
51
51
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
52
52
|
"packageGroup": {
|
|
53
|
-
"@angular/cli": "8.3.
|
|
54
|
-
"@angular-devkit/build-angular": "0.803.
|
|
55
|
-
"@angular-devkit/build-ng-packagr": "0.803.
|
|
56
|
-
"@angular-devkit/build-webpack": "0.803.
|
|
53
|
+
"@angular/cli": "8.3.5",
|
|
54
|
+
"@angular-devkit/build-angular": "0.803.5",
|
|
55
|
+
"@angular-devkit/build-ng-packagr": "0.803.5",
|
|
56
|
+
"@angular-devkit/build-webpack": "0.803.5"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
@@ -39,9 +39,7 @@ function readOptions(logger, yarn = false, showPotentials = false) {
|
|
|
39
39
|
path.join(globalPrefix, 'etc', baseFilename),
|
|
40
40
|
path.join(os_1.homedir(), dotFilename),
|
|
41
41
|
];
|
|
42
|
-
const projectConfigLocations = [
|
|
43
|
-
path.join(cwd, dotFilename),
|
|
44
|
-
];
|
|
42
|
+
const projectConfigLocations = [path.join(cwd, dotFilename)];
|
|
45
43
|
const root = path.parse(cwd).root;
|
|
46
44
|
for (let curDir = path.dirname(cwd); curDir && curDir !== root; curDir = path.dirname(curDir)) {
|
|
47
45
|
projectConfigLocations.unshift(path.join(curDir, dotFilename));
|
|
@@ -18,21 +18,25 @@ export interface PackageTreeNodeBase {
|
|
|
18
18
|
dependencies?: Record<string, string>;
|
|
19
19
|
devDependencies?: Record<string, string>;
|
|
20
20
|
peerDependencies?: Record<string, string>;
|
|
21
|
+
optionalDependencies?: Record<string, string>;
|
|
21
22
|
'ng-update'?: {
|
|
22
23
|
migrations?: string;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
26
|
+
parent?: PackageTreeNode;
|
|
25
27
|
children: PackageTreeNode[];
|
|
26
28
|
}
|
|
27
29
|
export interface PackageTreeActual extends PackageTreeNodeBase {
|
|
28
30
|
isLink: false;
|
|
29
|
-
parent?: PackageTreeActual;
|
|
30
31
|
}
|
|
31
32
|
export interface PackageTreeLink extends PackageTreeNodeBase {
|
|
32
33
|
isLink: true;
|
|
33
|
-
parent: null;
|
|
34
34
|
target: PackageTreeActual;
|
|
35
35
|
}
|
|
36
36
|
export declare type PackageTreeNode = PackageTreeActual | PackageTreeLink;
|
|
37
37
|
export declare function readPackageTree(path: string): Promise<PackageTreeNode>;
|
|
38
|
-
export
|
|
38
|
+
export interface NodeDependency {
|
|
39
|
+
version: string;
|
|
40
|
+
node?: PackageTreeNode;
|
|
41
|
+
}
|
|
42
|
+
export declare function findNodeDependencies(node: PackageTreeNode): Record<string, NodeDependency>;
|
|
@@ -14,19 +14,25 @@ function readPackageTree(path) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
exports.readPackageTree = readPackageTree;
|
|
17
|
-
function findNodeDependencies(
|
|
18
|
-
const actual = node.isLink ? node.target : node;
|
|
17
|
+
function findNodeDependencies(node) {
|
|
19
18
|
const rawDeps = {
|
|
20
|
-
...
|
|
21
|
-
...
|
|
22
|
-
...
|
|
19
|
+
...node.package.dependencies,
|
|
20
|
+
...node.package.devDependencies,
|
|
21
|
+
...node.package.peerDependencies,
|
|
22
|
+
...node.package.optionalDependencies,
|
|
23
23
|
};
|
|
24
24
|
return Object.entries(rawDeps).reduce((deps, [name, version]) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
let dependencyNode;
|
|
26
|
+
let parent = node;
|
|
27
|
+
while (!dependencyNode && parent) {
|
|
28
|
+
dependencyNode = parent.children.find(child => child.name === name);
|
|
29
|
+
parent = parent.parent;
|
|
30
|
+
}
|
|
31
|
+
deps[name] = {
|
|
32
|
+
node: dependencyNode,
|
|
33
|
+
version,
|
|
34
|
+
};
|
|
29
35
|
return deps;
|
|
30
|
-
},
|
|
36
|
+
}, Object.create(null));
|
|
31
37
|
}
|
|
32
38
|
exports.findNodeDependencies = findNodeDependencies;
|