@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/commands/doc-impl.js
CHANGED
|
@@ -6,9 +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
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.DocCommand = void 0;
|
|
11
|
-
const
|
|
33
|
+
const open_1 = __importDefault(require("open"));
|
|
12
34
|
const command_1 = require("../models/command");
|
|
13
35
|
class DocCommand extends command_1.Command {
|
|
14
36
|
async run(options) {
|
|
@@ -36,7 +58,7 @@ class DocCommand extends command_1.Command {
|
|
|
36
58
|
// and use it if we can find it
|
|
37
59
|
try {
|
|
38
60
|
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
|
39
|
-
const currentNgVersion = (await Promise.resolve().then(() => require('@angular/core'))).VERSION.major;
|
|
61
|
+
const currentNgVersion = (await Promise.resolve().then(() => __importStar(require('@angular/core')))).VERSION.major;
|
|
40
62
|
domain = `v${currentNgVersion}.angular.io`;
|
|
41
63
|
}
|
|
42
64
|
catch (e) { }
|
|
@@ -45,7 +67,7 @@ class DocCommand extends command_1.Command {
|
|
|
45
67
|
if (options.search) {
|
|
46
68
|
searchUrl = `https://${domain}/docs?search=${options.keyword}`;
|
|
47
69
|
}
|
|
48
|
-
await
|
|
70
|
+
await open_1.default(searchUrl, {
|
|
49
71
|
wait: false,
|
|
50
72
|
});
|
|
51
73
|
}
|
package/commands/e2e-impl.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ import { Schema as E2eCommandSchema } from './e2e';
|
|
|
11
11
|
export declare class E2eCommand extends ArchitectCommand<E2eCommandSchema> {
|
|
12
12
|
readonly target = "e2e";
|
|
13
13
|
readonly multiTarget = true;
|
|
14
|
-
readonly missingTargetError = "\nCannot find \"e2e\" target for the specified project.\n\nYou should add a package that implements end-to-end testing capabilities.\n\nFor example:\n Cypress: ng add @cypress/schematic\n WebdriverIO: ng add @wdio/schematics\n\nMore options will be added to the list as they become available.\n";
|
|
14
|
+
readonly missingTargetError = "\nCannot find \"e2e\" target for the specified project.\n\nYou should add a package that implements end-to-end testing capabilities.\n\nFor example:\n Cypress: ng add @cypress/schematic\n Nightwatch: ng add @nightwatch/schematics\n WebdriverIO: ng add @wdio/schematics\n\nMore options will be added to the list as they become available.\n";
|
|
15
15
|
initialize(options: E2eCommandSchema & Arguments): Promise<number | void>;
|
|
16
16
|
}
|
package/commands/e2e-impl.js
CHANGED
|
@@ -21,6 +21,7 @@ You should add a package that implements end-to-end testing capabilities.
|
|
|
21
21
|
|
|
22
22
|
For example:
|
|
23
23
|
Cypress: ng add @cypress/schematic
|
|
24
|
+
Nightwatch: ng add @nightwatch/schematics
|
|
24
25
|
WebdriverIO: ng add @wdio/schematics
|
|
25
26
|
|
|
26
27
|
More options will be added to the list as they become available.
|
package/commands/new-impl.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.NewCommand = void 0;
|
|
11
11
|
const schematic_command_1 = require("../models/schematic-command");
|
|
12
|
+
const version_1 = require("../models/version");
|
|
12
13
|
class NewCommand extends schematic_command_1.SchematicCommand {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -21,8 +22,7 @@ class NewCommand extends schematic_command_1.SchematicCommand {
|
|
|
21
22
|
}
|
|
22
23
|
async run(options) {
|
|
23
24
|
// Register the version of the CLI in the registry.
|
|
24
|
-
const
|
|
25
|
-
const version = packageJson.version;
|
|
25
|
+
const version = version_1.VERSION.full;
|
|
26
26
|
this._workflow.registry.addSmartDefaultProvider('ng-cli-version', () => version);
|
|
27
27
|
return this.runSchematic({
|
|
28
28
|
collectionName: this.collectionName,
|
package/commands/update-impl.js
CHANGED
|
@@ -6,17 +6,37 @@
|
|
|
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.UpdateCommand = void 0;
|
|
11
30
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
31
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
13
32
|
const child_process_1 = require("child_process");
|
|
14
|
-
const fs = require("fs");
|
|
15
|
-
const path = require("path");
|
|
16
|
-
const semver = require("semver");
|
|
33
|
+
const fs = __importStar(require("fs"));
|
|
34
|
+
const path = __importStar(require("path"));
|
|
35
|
+
const semver = __importStar(require("semver"));
|
|
17
36
|
const workspace_schema_1 = require("../lib/config/workspace-schema");
|
|
18
37
|
const command_1 = require("../models/command");
|
|
19
38
|
const schematic_engine_host_1 = require("../models/schematic-engine-host");
|
|
39
|
+
const version_1 = require("../models/version");
|
|
20
40
|
const color_1 = require("../utilities/color");
|
|
21
41
|
const install_package_1 = require("../utilities/install-package");
|
|
22
42
|
const log_file_1 = require("../utilities/log-file");
|
|
@@ -634,7 +654,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
634
654
|
* @returns `true` when the installed version is older.
|
|
635
655
|
*/
|
|
636
656
|
async checkCLILatestVersion(verbose = false, next = false) {
|
|
637
|
-
const
|
|
657
|
+
const installedCLIVersion = version_1.VERSION.full;
|
|
638
658
|
const LatestCLIManifest = await package_metadata_1.fetchPackageManifest(`@angular/cli@${next ? 'next' : 'latest'}`, this.logger, {
|
|
639
659
|
verbose,
|
|
640
660
|
usingYarn: this.packageManager === workspace_schema_1.PackageManager.Yarn,
|
package/commands/version-impl.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.VersionCommand = void 0;
|
|
11
30
|
const child_process_1 = require("child_process");
|
|
12
|
-
const path = require("path");
|
|
31
|
+
const path = __importStar(require("path"));
|
|
13
32
|
const command_1 = require("../models/command");
|
|
14
33
|
const color_1 = require("../utilities/color");
|
|
15
34
|
const package_manager_1 = require("../utilities/package-manager");
|
|
@@ -149,7 +168,16 @@ class VersionCommand extends command_1.Command {
|
|
|
149
168
|
async getPackageManager() {
|
|
150
169
|
try {
|
|
151
170
|
const manager = await package_manager_1.getPackageManager(this.context.root);
|
|
152
|
-
const version = child_process_1.execSync(`${manager} --version`, {
|
|
171
|
+
const version = child_process_1.execSync(`${manager} --version`, {
|
|
172
|
+
encoding: 'utf8',
|
|
173
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
174
|
+
env: {
|
|
175
|
+
...process.env,
|
|
176
|
+
// NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.
|
|
177
|
+
NO_UPDATE_NOTIFIER: '1',
|
|
178
|
+
NPM_CONFIG_UPDATE_NOTIFIER: 'false',
|
|
179
|
+
},
|
|
180
|
+
}).trim();
|
|
153
181
|
return `${manager} ${version}`;
|
|
154
182
|
}
|
|
155
183
|
catch {
|
package/lib/config/schema.json
CHANGED
|
@@ -844,14 +844,15 @@
|
|
|
844
844
|
]
|
|
845
845
|
},
|
|
846
846
|
"style": {
|
|
847
|
-
"description": "The file extension or preprocessor to use for style files.",
|
|
847
|
+
"description": "The file extension or preprocessor to use for style files, or 'none' to skip generating the style file.",
|
|
848
848
|
"type": "string",
|
|
849
849
|
"default": "css",
|
|
850
850
|
"enum": [
|
|
851
851
|
"css",
|
|
852
852
|
"scss",
|
|
853
853
|
"sass",
|
|
854
|
-
"less"
|
|
854
|
+
"less",
|
|
855
|
+
"none"
|
|
855
856
|
],
|
|
856
857
|
"x-user-analytics": 5
|
|
857
858
|
},
|
|
@@ -150,7 +150,7 @@ export interface AngularApplicationOptionsSchema {
|
|
|
150
150
|
/**
|
|
151
151
|
* The file extension or preprocessor to use for style files.
|
|
152
152
|
*/
|
|
153
|
-
style?:
|
|
153
|
+
style?: SchematicsAngularApplicationStyle;
|
|
154
154
|
/**
|
|
155
155
|
* The view encapsulation strategy to use in the new app.
|
|
156
156
|
*/
|
|
@@ -159,7 +159,7 @@ export interface AngularApplicationOptionsSchema {
|
|
|
159
159
|
/**
|
|
160
160
|
* The file extension or preprocessor to use for style files.
|
|
161
161
|
*/
|
|
162
|
-
export declare enum
|
|
162
|
+
export declare enum SchematicsAngularApplicationStyle {
|
|
163
163
|
Css = "css",
|
|
164
164
|
Less = "less",
|
|
165
165
|
Sass = "sass",
|
|
@@ -280,9 +280,10 @@ export interface AngularComponentOptionsSchema {
|
|
|
280
280
|
*/
|
|
281
281
|
skipTests?: boolean;
|
|
282
282
|
/**
|
|
283
|
-
* The file extension or preprocessor to use for style files
|
|
283
|
+
* The file extension or preprocessor to use for style files, or 'none' to skip generating
|
|
284
|
+
* the style file.
|
|
284
285
|
*/
|
|
285
|
-
style?:
|
|
286
|
+
style?: SchematicsAngularComponentStyle;
|
|
286
287
|
/**
|
|
287
288
|
* Adds a developer-defined type to the filename, in the format "name.type.ts".
|
|
288
289
|
*/
|
|
@@ -299,6 +300,17 @@ export declare enum ChangeDetection {
|
|
|
299
300
|
Default = "Default",
|
|
300
301
|
OnPush = "OnPush"
|
|
301
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* The file extension or preprocessor to use for style files, or 'none' to skip generating
|
|
305
|
+
* the style file.
|
|
306
|
+
*/
|
|
307
|
+
export declare enum SchematicsAngularComponentStyle {
|
|
308
|
+
Css = "css",
|
|
309
|
+
Less = "less",
|
|
310
|
+
None = "none",
|
|
311
|
+
Sass = "sass",
|
|
312
|
+
Scss = "scss"
|
|
313
|
+
}
|
|
302
314
|
/**
|
|
303
315
|
* Creates a new, generic directive definition in the given or default project.
|
|
304
316
|
*/
|
|
@@ -596,7 +608,7 @@ export interface AngularNgNewOptionsSchema {
|
|
|
596
608
|
/**
|
|
597
609
|
* The file extension or preprocessor to use for style files.
|
|
598
610
|
*/
|
|
599
|
-
style?:
|
|
611
|
+
style?: SchematicsAngularApplicationStyle;
|
|
600
612
|
/**
|
|
601
613
|
* The version of the Angular CLI to use.
|
|
602
614
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
3
|
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.Implement = exports.ChangeDetection = exports.ViewEncapsulation = exports.
|
|
5
|
+
exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.PackageManager = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Specify which package manager tool to use.
|
|
8
8
|
*
|
|
@@ -18,13 +18,13 @@ var PackageManager;
|
|
|
18
18
|
/**
|
|
19
19
|
* The file extension or preprocessor to use for style files.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
22
|
-
(function (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(
|
|
21
|
+
var SchematicsAngularApplicationStyle;
|
|
22
|
+
(function (SchematicsAngularApplicationStyle) {
|
|
23
|
+
SchematicsAngularApplicationStyle["Css"] = "css";
|
|
24
|
+
SchematicsAngularApplicationStyle["Less"] = "less";
|
|
25
|
+
SchematicsAngularApplicationStyle["Sass"] = "sass";
|
|
26
|
+
SchematicsAngularApplicationStyle["Scss"] = "scss";
|
|
27
|
+
})(SchematicsAngularApplicationStyle = exports.SchematicsAngularApplicationStyle || (exports.SchematicsAngularApplicationStyle = {}));
|
|
28
28
|
/**
|
|
29
29
|
* The view encapsulation strategy to use in the new app.
|
|
30
30
|
*
|
|
@@ -46,6 +46,18 @@ var ChangeDetection;
|
|
|
46
46
|
ChangeDetection["Default"] = "Default";
|
|
47
47
|
ChangeDetection["OnPush"] = "OnPush";
|
|
48
48
|
})(ChangeDetection = exports.ChangeDetection || (exports.ChangeDetection = {}));
|
|
49
|
+
/**
|
|
50
|
+
* The file extension or preprocessor to use for style files, or 'none' to skip generating
|
|
51
|
+
* the style file.
|
|
52
|
+
*/
|
|
53
|
+
var SchematicsAngularComponentStyle;
|
|
54
|
+
(function (SchematicsAngularComponentStyle) {
|
|
55
|
+
SchematicsAngularComponentStyle["Css"] = "css";
|
|
56
|
+
SchematicsAngularComponentStyle["Less"] = "less";
|
|
57
|
+
SchematicsAngularComponentStyle["None"] = "none";
|
|
58
|
+
SchematicsAngularComponentStyle["Sass"] = "sass";
|
|
59
|
+
SchematicsAngularComponentStyle["Scss"] = "scss";
|
|
60
|
+
})(SchematicsAngularComponentStyle = exports.SchematicsAngularComponentStyle || (exports.SchematicsAngularComponentStyle = {}));
|
|
49
61
|
var Implement;
|
|
50
62
|
(function (Implement) {
|
|
51
63
|
Implement["CanActivate"] = "CanActivate";
|
package/lib/init.js
CHANGED
|
@@ -6,38 +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
29
|
require("symbol-observable");
|
|
11
30
|
// symbol polyfill must go first
|
|
12
|
-
const
|
|
13
|
-
const path = require("path");
|
|
31
|
+
const fs_1 = require("fs");
|
|
32
|
+
const path = __importStar(require("path"));
|
|
14
33
|
const semver_1 = require("semver");
|
|
34
|
+
const version_1 = require("../models/version");
|
|
15
35
|
const color_1 = require("../utilities/color");
|
|
16
36
|
const config_1 = require("../utilities/config");
|
|
17
|
-
// Check if we need to profile this CLI run.
|
|
18
|
-
if (process.env['NG_CLI_PROFILING']) {
|
|
19
|
-
let profiler;
|
|
20
|
-
try {
|
|
21
|
-
profiler = require('v8-profiler-node8'); // eslint-disable-line import/no-extraneous-dependencies
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
throw new Error(`Could not require 'v8-profiler-node8'. You must install it separetely with ` +
|
|
25
|
-
`'npm install v8-profiler-node8 --no-save'.\n\nOriginal error:\n\n${err}`);
|
|
26
|
-
}
|
|
27
|
-
profiler.startProfiling();
|
|
28
|
-
const exitHandler = (options) => {
|
|
29
|
-
if (options.cleanup) {
|
|
30
|
-
const cpuProfile = profiler.stopProfiling();
|
|
31
|
-
fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING || '') + '.cpuprofile', JSON.stringify(cpuProfile));
|
|
32
|
-
}
|
|
33
|
-
if (options.exit) {
|
|
34
|
-
process.exit();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
process.on('exit', () => exitHandler({ cleanup: true }));
|
|
38
|
-
process.on('SIGINT', () => exitHandler({ exit: true }));
|
|
39
|
-
process.on('uncaughtException', () => exitHandler({ exit: true }));
|
|
40
|
-
}
|
|
41
37
|
(async () => {
|
|
42
38
|
var _a;
|
|
43
39
|
/**
|
|
@@ -56,21 +52,21 @@ if (process.env['NG_CLI_PROFILING']) {
|
|
|
56
52
|
disableVersionCheckEnv !== '0' &&
|
|
57
53
|
disableVersionCheckEnv.toLowerCase() !== 'false';
|
|
58
54
|
if (disableVersionCheck) {
|
|
59
|
-
return (await Promise.resolve().then(() => require('./cli'))).default;
|
|
55
|
+
return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
|
|
60
56
|
}
|
|
61
57
|
let cli;
|
|
62
58
|
try {
|
|
63
59
|
// No error implies a projectLocalCli, which will load whatever
|
|
64
60
|
// version of ng-cli you have installed in a local package.json
|
|
65
61
|
const projectLocalCli = require.resolve('@angular/cli', { paths: [process.cwd()] });
|
|
66
|
-
cli = await Promise.resolve().then(() => require(projectLocalCli));
|
|
67
|
-
const globalVersion = new semver_1.SemVer(
|
|
62
|
+
cli = await Promise.resolve().then(() => __importStar(require(projectLocalCli)));
|
|
63
|
+
const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
|
|
68
64
|
// Older versions might not have the VERSION export
|
|
69
65
|
let localVersion = (_a = cli.VERSION) === null || _a === void 0 ? void 0 : _a.full;
|
|
70
66
|
if (!localVersion) {
|
|
71
67
|
try {
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
const localPackageJson = await fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
|
|
69
|
+
localVersion = JSON.parse(localPackageJson).version;
|
|
74
70
|
}
|
|
75
71
|
catch (error) {
|
|
76
72
|
// eslint-disable-next-line no-console
|
|
@@ -89,7 +85,7 @@ if (process.env['NG_CLI_PROFILING']) {
|
|
|
89
85
|
// If using the update command and the global version is greater, use the newer update command
|
|
90
86
|
// This allows improvements in update to be used in older versions that do not have bootstrapping
|
|
91
87
|
if (process.argv[2] === 'update') {
|
|
92
|
-
cli = await Promise.resolve().then(() => require('./cli'));
|
|
88
|
+
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
|
|
93
89
|
}
|
|
94
90
|
else if (await config_1.isWarningEnabled('versionMismatch')) {
|
|
95
91
|
// Otherwise, use local version and warn if global is newer than local
|
|
@@ -106,7 +102,7 @@ if (process.env['NG_CLI_PROFILING']) {
|
|
|
106
102
|
// library from a package.json. Instead, include it from a relative
|
|
107
103
|
// path to this script file (which is likely a globally installed
|
|
108
104
|
// npm package). Most common cause for hitting this is `ng new`
|
|
109
|
-
cli = await Promise.resolve().then(() => require('./cli'));
|
|
105
|
+
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
|
|
110
106
|
}
|
|
111
107
|
if ('default' in cli) {
|
|
112
108
|
cli = cli['default'];
|
|
@@ -6,14 +6,36 @@
|
|
|
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
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.AnalyticsCollector = void 0;
|
|
11
33
|
const core_1 = require("@angular-devkit/core");
|
|
12
34
|
const child_process_1 = require("child_process");
|
|
13
|
-
const
|
|
14
|
-
const https = require("https");
|
|
15
|
-
const os = require("os");
|
|
16
|
-
const querystring = require("querystring");
|
|
35
|
+
const debug_1 = __importDefault(require("debug"));
|
|
36
|
+
const https = __importStar(require("https"));
|
|
37
|
+
const os = __importStar(require("os"));
|
|
38
|
+
const querystring = __importStar(require("querystring"));
|
|
17
39
|
const version_1 = require("./version");
|
|
18
40
|
/**
|
|
19
41
|
* See: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
|
|
@@ -22,7 +44,7 @@ class AnalyticsCollector {
|
|
|
22
44
|
constructor(trackingId, userId) {
|
|
23
45
|
this.trackingEventsQueue = [];
|
|
24
46
|
this.parameters = {};
|
|
25
|
-
this.analyticsLogDebug =
|
|
47
|
+
this.analyticsLogDebug = debug_1.default('ng:analytics:log');
|
|
26
48
|
// API Version
|
|
27
49
|
this.parameters['v'] = '1';
|
|
28
50
|
// User ID
|
package/models/analytics.js
CHANGED
|
@@ -6,18 +6,41 @@
|
|
|
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
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.getSharedAnalytics = exports.getWorkspaceAnalytics = exports.hasWorkspaceAnalyticsConfiguration = exports.getGlobalAnalytics = exports.hasGlobalAnalyticsConfiguration = exports.promptProjectAnalytics = exports.promptGlobalAnalytics = exports.setAnalyticsConfig = exports.isPackageNameSafeForAnalytics = exports.analyticsPackageSafelist = exports.AnalyticsProperties = void 0;
|
|
11
33
|
const core_1 = require("@angular-devkit/core");
|
|
12
|
-
const
|
|
13
|
-
const inquirer = require("inquirer");
|
|
34
|
+
const debug_1 = __importDefault(require("debug"));
|
|
35
|
+
const inquirer = __importStar(require("inquirer"));
|
|
14
36
|
const uuid_1 = require("uuid");
|
|
37
|
+
const version_1 = require("../models/version");
|
|
15
38
|
const color_1 = require("../utilities/color");
|
|
16
39
|
const config_1 = require("../utilities/config");
|
|
17
40
|
const tty_1 = require("../utilities/tty");
|
|
18
41
|
const analytics_collector_1 = require("./analytics-collector");
|
|
19
42
|
/* eslint-disable no-console */
|
|
20
|
-
const analyticsDebug =
|
|
43
|
+
const analyticsDebug = debug_1.default('ng:analytics'); // Generate analytics, including settings and users.
|
|
21
44
|
let _defaultAngularCliPropertyCache;
|
|
22
45
|
exports.AnalyticsProperties = {
|
|
23
46
|
AngularCliProd: 'UA-8594346-29',
|
|
@@ -26,7 +49,7 @@ exports.AnalyticsProperties = {
|
|
|
26
49
|
if (_defaultAngularCliPropertyCache) {
|
|
27
50
|
return _defaultAngularCliPropertyCache;
|
|
28
51
|
}
|
|
29
|
-
const v =
|
|
52
|
+
const v = version_1.VERSION.full;
|
|
30
53
|
// The logic is if it's a full version then we should use the prod GA property.
|
|
31
54
|
if (/^\d+\.\d+\.\d+$/.test(v) && v !== '0.0.0') {
|
|
32
55
|
_defaultAngularCliPropertyCache = exports.AnalyticsProperties.AngularCliProd;
|
package/models/command-runner.js
CHANGED
|
@@ -6,6 +6,25 @@
|
|
|
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.runCommand = void 0;
|
|
11
30
|
const core_1 = require("@angular-devkit/core");
|
|
@@ -15,7 +34,7 @@ const json_file_1 = require("../utilities/json-file");
|
|
|
15
34
|
const json_schema_1 = require("../utilities/json-schema");
|
|
16
35
|
const analytics_1 = require("./analytics");
|
|
17
36
|
const command_1 = require("./command");
|
|
18
|
-
const parser = require("./parser");
|
|
37
|
+
const parser = __importStar(require("./parser"));
|
|
19
38
|
// NOTE: Update commands.json if changing this. It's still deep imported in one CI validation
|
|
20
39
|
const standardCommands = {
|
|
21
40
|
'add': '../commands/add.json',
|
|
@@ -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.SchematicCommand = exports.UnknownCollectionError = void 0;
|
|
11
30
|
const core_1 = require("@angular-devkit/core");
|
|
12
31
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
32
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
14
|
-
const inquirer = require("inquirer");
|
|
15
|
-
const systemPath = require("path");
|
|
33
|
+
const inquirer = __importStar(require("inquirer"));
|
|
34
|
+
const systemPath = __importStar(require("path"));
|
|
16
35
|
const color_1 = require("../utilities/color");
|
|
17
36
|
const config_1 = require("../utilities/config");
|
|
18
37
|
const json_schema_1 = require("../utilities/json-schema");
|
|
@@ -6,6 +6,9 @@
|
|
|
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
|
var _a;
|
|
10
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
14
|
exports.SchematicEngineHost = void 0;
|
|
@@ -13,6 +16,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
13
16
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
14
17
|
const fs_1 = require("fs");
|
|
15
18
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
19
|
+
const module_1 = __importDefault(require("module"));
|
|
16
20
|
const path_1 = require("path");
|
|
17
21
|
const vm_1 = require("vm");
|
|
18
22
|
/**
|
|
@@ -97,8 +101,7 @@ const legacyModules = {
|
|
|
97
101
|
* @param exportName An optional name of a specific export to return. Otherwise, return all exports.
|
|
98
102
|
*/
|
|
99
103
|
function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
|
|
100
|
-
const
|
|
101
|
-
const scopedRequire = createRequire(schematicFile);
|
|
104
|
+
const scopedRequire = module_1.default.createRequire(schematicFile);
|
|
102
105
|
const customRequire = function (id) {
|
|
103
106
|
if (legacyModules[id]) {
|
|
104
107
|
// Provide compatibility modules for older versions of @angular/cdk
|