@angular/cli 12.1.0-next.5 → 12.1.2
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/doc-impl.js +25 -3
- package/commands/e2e-impl.d.ts +1 -1
- package/commands/e2e-impl.js +1 -0
- package/commands/new-impl.js +2 -2
- package/commands/update-impl.js +24 -4
- package/commands/version-impl.js +30 -2
- package/lib/config/schema.json +3 -2
- package/lib/config/workspace-schema.d.ts +17 -5
- package/lib/config/workspace-schema.js +20 -8
- package/lib/init.js +29 -33
- package/models/analytics-collector.js +27 -5
- package/models/analytics.js +27 -4
- package/models/command-runner.js +20 -1
- package/models/schematic-command.js +21 -2
- package/models/schematic-engine-host.js +5 -2
- package/package.json +14 -14
- package/src/commands/update/schematic/index.js +24 -5
- package/utilities/color.js +20 -1
- package/utilities/config.js +22 -3
- package/utilities/find-up.js +20 -1
- package/{src/commands/update/schematic → utilities}/package-json.d.ts +0 -0
- package/{src/commands/update/schematic → utilities}/package-json.js +0 -0
- package/utilities/package-metadata.d.ts +26 -9
- package/utilities/package-metadata.js +88 -30
- package/utilities/package-tree.js +21 -2
- package/utilities/project.js +22 -3
- package/utilities/prompt.js +20 -1
- package/utilities/spinner.js +5 -2
- package/src/commands/update/schematic/npm-package-json.d.ts +0 -24
- package/src/commands/update/schematic/npm-package-json.js +0 -9
- package/src/commands/update/schematic/npm.d.ts +0 -22
- package/src/commands/update/schematic/npm.js +0 -140
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.2",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/angular/angular-cli",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@angular-devkit/architect": "0.1201.
|
|
32
|
-
"@angular-devkit/core": "12.1.
|
|
33
|
-
"@angular-devkit/schematics": "12.1.
|
|
34
|
-
"@schematics/angular": "12.1.
|
|
31
|
+
"@angular-devkit/architect": "0.1201.2",
|
|
32
|
+
"@angular-devkit/core": "12.1.2",
|
|
33
|
+
"@angular-devkit/schematics": "12.1.2",
|
|
34
|
+
"@schematics/angular": "12.1.2",
|
|
35
35
|
"@yarnpkg/lockfile": "1.1.0",
|
|
36
36
|
"ansi-colors": "4.1.1",
|
|
37
37
|
"debug": "4.3.1",
|
|
38
38
|
"ini": "2.0.0",
|
|
39
|
-
"inquirer": "8.1.
|
|
39
|
+
"inquirer": "8.1.1",
|
|
40
40
|
"jsonc-parser": "3.0.0",
|
|
41
|
-
"npm-package-arg": "8.1.
|
|
41
|
+
"npm-package-arg": "8.1.5",
|
|
42
42
|
"npm-pick-manifest": "6.1.1",
|
|
43
|
-
"open": "8.2.
|
|
43
|
+
"open": "8.2.1",
|
|
44
44
|
"ora": "5.4.1",
|
|
45
45
|
"pacote": "11.3.4",
|
|
46
46
|
"resolve": "1.20.0",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"ng-update": {
|
|
52
52
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
53
53
|
"packageGroup": {
|
|
54
|
-
"@angular/cli": "12.1.
|
|
55
|
-
"@angular-devkit/architect": "0.1201.
|
|
56
|
-
"@angular-devkit/build-angular": "12.1.
|
|
57
|
-
"@angular-devkit/build-webpack": "0.1201.
|
|
58
|
-
"@angular-devkit/core": "12.1.
|
|
59
|
-
"@angular-devkit/schematics": "12.1.
|
|
54
|
+
"@angular/cli": "12.1.2",
|
|
55
|
+
"@angular-devkit/architect": "0.1201.2",
|
|
56
|
+
"@angular-devkit/build-angular": "12.1.2",
|
|
57
|
+
"@angular-devkit/build-webpack": "0.1201.2",
|
|
58
|
+
"@angular-devkit/core": "12.1.2",
|
|
59
|
+
"@angular-devkit/schematics": "12.1.2"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
@@ -6,13 +6,32 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.angularMajorCompatGuarantee = void 0;
|
|
11
30
|
const core_1 = require("@angular-devkit/core");
|
|
12
31
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
-
const npa = require("npm-package-arg");
|
|
14
|
-
const semver = require("semver");
|
|
15
|
-
const
|
|
32
|
+
const npa = __importStar(require("npm-package-arg"));
|
|
33
|
+
const semver = __importStar(require("semver"));
|
|
34
|
+
const package_metadata_1 = require("../../../../utilities/package-metadata");
|
|
16
35
|
// Angular guarantees that a major is compatible with its following major (so packages that depend
|
|
17
36
|
// on Angular 5 are also compatible with Angular 6). This is, in code, represented by verifying
|
|
18
37
|
// that all other packages that have a peer dependency of `"@angular/core": "^5.0.0"` actually
|
|
@@ -604,8 +623,8 @@ function default_1(options) {
|
|
|
604
623
|
const packages = _buildPackageList(options, npmDeps, logger);
|
|
605
624
|
// Grab all package.json from the npm repository. This requires a lot of HTTP calls so we
|
|
606
625
|
// try to parallelize as many as possible.
|
|
607
|
-
const allPackageMetadata = await Promise.all(Array.from(npmDeps.keys()).map((depName) =>
|
|
608
|
-
|
|
626
|
+
const allPackageMetadata = await Promise.all(Array.from(npmDeps.keys()).map((depName) => package_metadata_1.getNpmPackageJson(depName, logger, {
|
|
627
|
+
registry: options.registry,
|
|
609
628
|
usingYarn,
|
|
610
629
|
verbose: options.verbose,
|
|
611
630
|
})));
|
package/utilities/color.js
CHANGED
|
@@ -6,9 +6,28 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.colors = exports.removeColor = void 0;
|
|
11
|
-
const ansiColors = require("ansi-colors");
|
|
30
|
+
const ansiColors = __importStar(require("ansi-colors"));
|
|
12
31
|
const tty_1 = require("tty");
|
|
13
32
|
const supportsColor = process.stdout instanceof tty_1.WriteStream && process.stdout.getColorDepth() > 1;
|
|
14
33
|
function removeColor(text) {
|
package/utilities/config.js
CHANGED
|
@@ -6,12 +6,31 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.isWarningEnabled = exports.getSchematicDefaults = exports.migrateLegacyGlobalConfig = exports.getConfiguredPackageManager = exports.getProjectByCwd = exports.validateWorkspace = exports.getWorkspaceRaw = exports.createGlobalSettings = exports.getWorkspace = exports.AngularWorkspace = exports.workspaceSchemaPath = void 0;
|
|
11
30
|
const core_1 = require("@angular-devkit/core");
|
|
12
31
|
const fs_1 = require("fs");
|
|
13
|
-
const os = require("os");
|
|
14
|
-
const path = require("path");
|
|
32
|
+
const os = __importStar(require("os"));
|
|
33
|
+
const path = __importStar(require("path"));
|
|
15
34
|
const find_up_1 = require("./find-up");
|
|
16
35
|
const json_file_1 = require("./json-file");
|
|
17
36
|
function isJsonObject(value) {
|
|
@@ -178,7 +197,7 @@ function getWorkspaceRaw(level = 'local') {
|
|
|
178
197
|
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
179
198
|
async function validateWorkspace(data) {
|
|
180
199
|
const schema = json_file_1.readAndParseJson(path.join(__dirname, '../lib/config/schema.json'));
|
|
181
|
-
const { formats } = await Promise.resolve().then(() => require('@angular-devkit/schematics'));
|
|
200
|
+
const { formats } = await Promise.resolve().then(() => __importStar(require('@angular-devkit/schematics')));
|
|
182
201
|
const registry = new core_1.json.schema.CoreSchemaRegistry(formats.standardFormats);
|
|
183
202
|
const validator = await registry.compile(schema).toPromise();
|
|
184
203
|
const { success, errors } = await validator(data).toPromise();
|
package/utilities/find-up.js
CHANGED
|
@@ -6,10 +6,29 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.findUp = void 0;
|
|
11
30
|
const fs_1 = require("fs");
|
|
12
|
-
const path = require("path");
|
|
31
|
+
const path = __importStar(require("path"));
|
|
13
32
|
function findUp(names, from) {
|
|
14
33
|
if (!Array.isArray(names)) {
|
|
15
34
|
names = [names];
|
|
File without changes
|
|
File without changes
|
|
@@ -6,8 +6,22 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { logging } from '@angular-devkit/core';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import { JsonSchemaForNpmPackageJsonFiles } from './package-json';
|
|
10
|
+
export interface NpmRepositoryPackageJson {
|
|
11
|
+
name: string;
|
|
12
|
+
requestedName: string;
|
|
13
|
+
description: string;
|
|
14
|
+
'dist-tags': {
|
|
15
|
+
[name: string]: string;
|
|
16
|
+
};
|
|
17
|
+
versions: {
|
|
18
|
+
[version: string]: JsonSchemaForNpmPackageJsonFiles;
|
|
19
|
+
};
|
|
20
|
+
time: {
|
|
21
|
+
modified: string;
|
|
22
|
+
created: string;
|
|
23
|
+
[version: string]: string;
|
|
24
|
+
};
|
|
11
25
|
}
|
|
12
26
|
export declare type NgAddSaveDepedency = 'dependencies' | 'devDependencies' | boolean;
|
|
13
27
|
export interface PackageIdentifier {
|
|
@@ -25,18 +39,16 @@ export interface PackageManifest {
|
|
|
25
39
|
license?: string;
|
|
26
40
|
private?: boolean;
|
|
27
41
|
deprecated?: boolean;
|
|
28
|
-
dependencies:
|
|
29
|
-
devDependencies:
|
|
30
|
-
peerDependencies:
|
|
31
|
-
optionalDependencies:
|
|
42
|
+
dependencies: Record<string, string>;
|
|
43
|
+
devDependencies: Record<string, string>;
|
|
44
|
+
peerDependencies: Record<string, string>;
|
|
45
|
+
optionalDependencies: Record<string, string>;
|
|
32
46
|
'ng-add'?: {
|
|
33
47
|
save?: NgAddSaveDepedency;
|
|
34
48
|
};
|
|
35
49
|
'ng-update'?: {
|
|
36
50
|
migrations: string;
|
|
37
|
-
packageGroup:
|
|
38
|
-
[name: string]: string;
|
|
39
|
-
};
|
|
51
|
+
packageGroup: Record<string, string>;
|
|
40
52
|
};
|
|
41
53
|
}
|
|
42
54
|
export interface PackageMetadata {
|
|
@@ -57,3 +69,8 @@ export declare function fetchPackageManifest(name: string, logger: logging.Logge
|
|
|
57
69
|
usingYarn?: boolean;
|
|
58
70
|
verbose?: boolean;
|
|
59
71
|
}): Promise<PackageManifest>;
|
|
72
|
+
export declare function getNpmPackageJson(packageName: string, logger: logging.LoggerApi, options?: {
|
|
73
|
+
registry?: string;
|
|
74
|
+
usingYarn?: boolean;
|
|
75
|
+
verbose?: boolean;
|
|
76
|
+
}): Promise<Partial<NpmRepositoryPackageJson>>;
|
|
@@ -6,14 +6,34 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.fetchPackageManifest = exports.fetchPackageMetadata = void 0;
|
|
29
|
+
exports.getNpmPackageJson = exports.fetchPackageManifest = exports.fetchPackageMetadata = void 0;
|
|
11
30
|
const fs_1 = require("fs");
|
|
12
31
|
const os_1 = require("os");
|
|
13
|
-
const path = require("path");
|
|
32
|
+
const path = __importStar(require("path"));
|
|
14
33
|
const lockfile = require('@yarnpkg/lockfile');
|
|
15
34
|
const ini = require('ini');
|
|
16
35
|
const pacote = require('pacote');
|
|
36
|
+
const npmPackageJsonCache = new Map();
|
|
17
37
|
let npmrc;
|
|
18
38
|
function ensureNpmrc(logger, usingYarn, verbose) {
|
|
19
39
|
if (!npmrc) {
|
|
@@ -30,6 +50,7 @@ function ensureNpmrc(logger, usingYarn, verbose) {
|
|
|
30
50
|
}
|
|
31
51
|
}
|
|
32
52
|
function readOptions(logger, yarn = false, showPotentials = false) {
|
|
53
|
+
var _a;
|
|
33
54
|
const cwd = process.cwd();
|
|
34
55
|
const baseFilename = yarn ? 'yarnrc' : 'npmrc';
|
|
35
56
|
const dotFilename = '.' + baseFilename;
|
|
@@ -48,9 +69,11 @@ function readOptions(logger, yarn = false, showPotentials = false) {
|
|
|
48
69
|
(!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(os_1.homedir(), dotFilename),
|
|
49
70
|
];
|
|
50
71
|
const projectConfigLocations = [path.join(cwd, dotFilename)];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
if (yarn) {
|
|
73
|
+
const root = path.parse(cwd).root;
|
|
74
|
+
for (let curDir = path.dirname(cwd); curDir && curDir !== root; curDir = path.dirname(curDir)) {
|
|
75
|
+
projectConfigLocations.unshift(path.join(curDir, dotFilename));
|
|
76
|
+
}
|
|
54
77
|
}
|
|
55
78
|
if (showPotentials) {
|
|
56
79
|
logger.info(`Locating potential ${baseFilename} files:`);
|
|
@@ -66,27 +89,45 @@ function readOptions(logger, yarn = false, showPotentials = false) {
|
|
|
66
89
|
// See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
|
|
67
90
|
const rcConfig = yarn ? lockfile.parse(data) : ini.parse(data);
|
|
68
91
|
for (const [key, value] of Object.entries(rcConfig)) {
|
|
92
|
+
let substitutedValue = value;
|
|
93
|
+
// Substitute any environment variable references.
|
|
94
|
+
if (typeof value === 'string') {
|
|
95
|
+
substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
|
|
96
|
+
}
|
|
69
97
|
switch (key) {
|
|
98
|
+
// Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
|
|
99
|
+
// even though they are documented.
|
|
100
|
+
// https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
|
|
101
|
+
// https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
|
|
102
|
+
case '_authToken':
|
|
103
|
+
case 'token':
|
|
104
|
+
case 'username':
|
|
105
|
+
case 'password':
|
|
106
|
+
case '_auth':
|
|
107
|
+
case 'auth':
|
|
108
|
+
(_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
|
|
109
|
+
options['forceAuth'][key] = substitutedValue;
|
|
110
|
+
break;
|
|
70
111
|
case 'noproxy':
|
|
71
112
|
case 'no-proxy':
|
|
72
|
-
options['noProxy'] =
|
|
113
|
+
options['noProxy'] = substitutedValue;
|
|
73
114
|
break;
|
|
74
115
|
case 'maxsockets':
|
|
75
|
-
options['maxSockets'] =
|
|
116
|
+
options['maxSockets'] = substitutedValue;
|
|
76
117
|
break;
|
|
77
118
|
case 'https-proxy':
|
|
78
119
|
case 'proxy':
|
|
79
|
-
options['proxy'] =
|
|
120
|
+
options['proxy'] = substitutedValue;
|
|
80
121
|
break;
|
|
81
122
|
case 'strict-ssl':
|
|
82
|
-
options['strictSSL'] =
|
|
123
|
+
options['strictSSL'] = substitutedValue;
|
|
83
124
|
break;
|
|
84
125
|
case 'local-address':
|
|
85
|
-
options['localAddress'] =
|
|
126
|
+
options['localAddress'] = substitutedValue;
|
|
86
127
|
break;
|
|
87
128
|
case 'cafile':
|
|
88
|
-
if (typeof
|
|
89
|
-
const cafile = path.resolve(path.dirname(location),
|
|
129
|
+
if (typeof substitutedValue === 'string') {
|
|
130
|
+
const cafile = path.resolve(path.dirname(location), substitutedValue);
|
|
90
131
|
try {
|
|
91
132
|
options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
|
|
92
133
|
}
|
|
@@ -94,21 +135,11 @@ function readOptions(logger, yarn = false, showPotentials = false) {
|
|
|
94
135
|
}
|
|
95
136
|
break;
|
|
96
137
|
default:
|
|
97
|
-
options[key] =
|
|
138
|
+
options[key] = substitutedValue;
|
|
98
139
|
break;
|
|
99
140
|
}
|
|
100
141
|
}
|
|
101
142
|
}
|
|
102
|
-
else if (showPotentials) {
|
|
103
|
-
logger.info(`Trying '${location}'...not found.`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// Substitute any environment variable references
|
|
107
|
-
for (const key in options) {
|
|
108
|
-
const value = options[key];
|
|
109
|
-
if (typeof value === 'string') {
|
|
110
|
-
options[key] = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
|
|
111
|
-
}
|
|
112
143
|
}
|
|
113
144
|
return options;
|
|
114
145
|
}
|
|
@@ -162,13 +193,8 @@ async function fetchPackageMetadata(name, logger, options) {
|
|
|
162
193
|
return metadata;
|
|
163
194
|
}
|
|
164
195
|
exports.fetchPackageMetadata = fetchPackageMetadata;
|
|
165
|
-
async function fetchPackageManifest(name, logger, options) {
|
|
166
|
-
const { usingYarn, verbose, registry } =
|
|
167
|
-
registry: undefined,
|
|
168
|
-
usingYarn: false,
|
|
169
|
-
verbose: false,
|
|
170
|
-
...options,
|
|
171
|
-
};
|
|
196
|
+
async function fetchPackageManifest(name, logger, options = {}) {
|
|
197
|
+
const { usingYarn = false, verbose = false, registry } = options;
|
|
172
198
|
ensureNpmrc(logger, usingYarn, verbose);
|
|
173
199
|
const response = await pacote.manifest(name, {
|
|
174
200
|
fullMetadata: true,
|
|
@@ -178,3 +204,35 @@ async function fetchPackageManifest(name, logger, options) {
|
|
|
178
204
|
return normalizeManifest(response);
|
|
179
205
|
}
|
|
180
206
|
exports.fetchPackageManifest = fetchPackageManifest;
|
|
207
|
+
function getNpmPackageJson(packageName, logger, options = {}) {
|
|
208
|
+
const cachedResponse = npmPackageJsonCache.get(packageName);
|
|
209
|
+
if (cachedResponse) {
|
|
210
|
+
return cachedResponse;
|
|
211
|
+
}
|
|
212
|
+
const { usingYarn = false, verbose = false, registry } = options;
|
|
213
|
+
if (!npmrc) {
|
|
214
|
+
try {
|
|
215
|
+
npmrc = readOptions(logger, false, verbose);
|
|
216
|
+
}
|
|
217
|
+
catch { }
|
|
218
|
+
if (usingYarn) {
|
|
219
|
+
try {
|
|
220
|
+
npmrc = { ...npmrc, ...readOptions(logger, true, verbose) };
|
|
221
|
+
}
|
|
222
|
+
catch { }
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const resultPromise = pacote.packument(packageName, {
|
|
226
|
+
fullMetadata: true,
|
|
227
|
+
...npmrc,
|
|
228
|
+
...(registry ? { registry } : {}),
|
|
229
|
+
});
|
|
230
|
+
// TODO: find some way to test this
|
|
231
|
+
const response = resultPromise.catch((err) => {
|
|
232
|
+
logger.warn(err.message || err);
|
|
233
|
+
return { requestedName: packageName };
|
|
234
|
+
});
|
|
235
|
+
npmPackageJsonCache.set(packageName, response);
|
|
236
|
+
return response;
|
|
237
|
+
}
|
|
238
|
+
exports.getNpmPackageJson = getNpmPackageJson;
|
|
@@ -6,11 +6,30 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.getProjectDependencies = exports.findPackageJson = exports.readPackageJson = void 0;
|
|
11
|
-
const fs = require("fs");
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
12
31
|
const path_1 = require("path");
|
|
13
|
-
const resolve = require("resolve");
|
|
32
|
+
const resolve = __importStar(require("resolve"));
|
|
14
33
|
function getAllDependencies(pkg) {
|
|
15
34
|
return new Set([
|
|
16
35
|
...Object.entries(pkg.dependencies || []),
|
package/utilities/project.js
CHANGED
|
@@ -6,12 +6,31 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.findWorkspaceFile = void 0;
|
|
11
30
|
const core_1 = require("@angular-devkit/core");
|
|
12
|
-
const fs = require("fs");
|
|
13
|
-
const os = require("os");
|
|
14
|
-
const path = require("path");
|
|
31
|
+
const fs = __importStar(require("fs"));
|
|
32
|
+
const os = __importStar(require("os"));
|
|
33
|
+
const path = __importStar(require("path"));
|
|
15
34
|
const find_up_1 = require("./find-up");
|
|
16
35
|
function findWorkspaceFile(currentDirectory = process.cwd()) {
|
|
17
36
|
const possibleConfigFiles = [
|
package/utilities/prompt.js
CHANGED
|
@@ -6,9 +6,28 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.askConfirmation = void 0;
|
|
11
|
-
const inquirer = require("inquirer");
|
|
30
|
+
const inquirer = __importStar(require("inquirer"));
|
|
12
31
|
const tty_1 = require("./tty");
|
|
13
32
|
async function askConfirmation(message, defaultResponse, noTTYResponse) {
|
|
14
33
|
if (!tty_1.isTTY()) {
|
package/utilities/spinner.js
CHANGED
|
@@ -6,15 +6,18 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
exports.Spinner = void 0;
|
|
11
|
-
const
|
|
14
|
+
const ora_1 = __importDefault(require("ora"));
|
|
12
15
|
const color_1 = require("./color");
|
|
13
16
|
class Spinner {
|
|
14
17
|
constructor(text) {
|
|
15
18
|
/** When false, only fail messages will be displayed. */
|
|
16
19
|
this.enabled = true;
|
|
17
|
-
this.spinner =
|
|
20
|
+
this.spinner = ora_1.default({
|
|
18
21
|
text,
|
|
19
22
|
// The below 2 options are needed because otherwise CTRL+C will be delayed
|
|
20
23
|
// when the underlying process is sync.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { JsonSchemaForNpmPackageJsonFiles } from './package-json';
|
|
9
|
-
export interface NpmRepositoryPackageJson {
|
|
10
|
-
name: string;
|
|
11
|
-
requestedName: string;
|
|
12
|
-
description: string;
|
|
13
|
-
'dist-tags': {
|
|
14
|
-
[name: string]: string;
|
|
15
|
-
};
|
|
16
|
-
versions: {
|
|
17
|
-
[version: string]: JsonSchemaForNpmPackageJsonFiles;
|
|
18
|
-
};
|
|
19
|
-
time: {
|
|
20
|
-
modified: string;
|
|
21
|
-
created: string;
|
|
22
|
-
[version: string]: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { logging } from '@angular-devkit/core';
|
|
9
|
-
import { NpmRepositoryPackageJson } from './npm-package-json';
|
|
10
|
-
/**
|
|
11
|
-
* Get the NPM repository's package.json for a package. This is p
|
|
12
|
-
* @param {string} packageName The package name to fetch.
|
|
13
|
-
* @param {string} registryUrl The NPM Registry URL to use.
|
|
14
|
-
* @param {LoggerApi} logger A logger instance to log debug information.
|
|
15
|
-
* @returns An observable that will put the pacakge.json content.
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
export declare function getNpmPackageJson(packageName: string, logger: logging.LoggerApi, options?: {
|
|
19
|
-
registryUrl?: string;
|
|
20
|
-
usingYarn?: boolean;
|
|
21
|
-
verbose?: boolean;
|
|
22
|
-
}): Promise<Partial<NpmRepositoryPackageJson>>;
|