@angular/cli 14.0.0-next.5 → 14.0.0-next.8
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/lib/cli/index.d.ts +0 -1
- package/lib/cli/index.js +3 -30
- package/lib/config/schema.json +26 -7
- package/lib/config/workspace-schema.d.ts +6 -1
- package/lib/init.js +7 -6
- package/package.json +17 -20
- package/src/analytics/analytics-collector.js +7 -1
- package/src/analytics/analytics.d.ts +10 -23
- package/src/analytics/analytics.js +99 -184
- package/src/command-builder/architect-base-command-module.d.ts +8 -1
- package/src/command-builder/architect-base-command-module.js +61 -7
- package/src/command-builder/architect-command-module.d.ts +0 -1
- package/src/command-builder/architect-command-module.js +16 -12
- package/src/command-builder/command-module.d.ts +5 -2
- package/src/command-builder/command-module.js +21 -8
- package/src/command-builder/command-runner.d.ts +1 -2
- package/src/command-builder/command-runner.js +54 -48
- package/src/command-builder/schematics-command-module.d.ts +19 -7
- package/src/command-builder/schematics-command-module.js +268 -50
- package/src/command-builder/utilities/command.d.ts +13 -0
- package/src/command-builder/utilities/command.js +27 -0
- package/src/command-builder/utilities/json-help.d.ts +16 -14
- package/src/command-builder/utilities/json-help.js +26 -22
- package/{models → src/command-builder/utilities}/schematic-engine-host.d.ts +0 -0
- package/{models → src/command-builder/utilities}/schematic-engine-host.js +0 -0
- package/src/command-builder/utilities/schematic-workflow.d.ts +14 -0
- package/src/command-builder/utilities/schematic-workflow.js +68 -0
- package/src/commands/add/cli.d.ts +11 -1
- package/src/commands/add/cli.js +325 -6
- package/src/commands/add/long-description.md +1 -4
- package/src/commands/analytics/cli.d.ts +5 -10
- package/src/commands/analytics/cli.js +15 -50
- package/src/commands/analytics/info/cli.d.ts +16 -0
- package/src/commands/analytics/info/cli.js +26 -0
- package/src/commands/analytics/settings/cli.d.ts +35 -0
- package/src/commands/analytics/settings/cli.js +61 -0
- package/src/commands/cache/clean/cli.d.ts +17 -0
- package/src/commands/cache/clean/cli.js +32 -0
- package/src/commands/cache/cli.d.ts +17 -0
- package/src/commands/cache/cli.js +38 -0
- package/src/commands/cache/info/cli.d.ts +20 -0
- package/src/commands/cache/info/cli.js +82 -0
- package/src/commands/cache/long-description.md +53 -0
- package/src/commands/cache/settings/cli.d.ts +27 -0
- package/src/commands/cache/settings/cli.js +42 -0
- package/src/commands/cache/utilities.d.ts +11 -0
- package/src/commands/cache/utilities.js +50 -0
- package/src/commands/config/cli.d.ts +5 -2
- package/src/commands/config/cli.js +128 -6
- package/src/commands/deploy/cli.d.ts +2 -1
- package/src/commands/deploy/cli.js +27 -13
- package/src/commands/doc/cli.d.ts +1 -1
- package/src/commands/doc/cli.js +5 -1
- package/src/commands/e2e/cli.d.ts +3 -2
- package/src/commands/e2e/cli.js +14 -13
- package/src/commands/generate/cli.d.ts +14 -2
- package/src/commands/generate/cli.js +83 -36
- package/src/commands/lint/cli.d.ts +2 -1
- package/src/commands/lint/cli.js +6 -9
- package/src/commands/new/cli.d.ts +7 -3
- package/src/commands/new/cli.js +52 -6
- package/src/commands/update/cli.d.ts +31 -5
- package/src/commands/update/cli.js +709 -8
- package/src/commands/update/schematic/index.js +32 -19
- package/src/commands/version/cli.d.ts +0 -1
- package/src/commands/version/cli.js +19 -43
- package/src/typings-bazel.d.ts +14 -0
- package/src/typings.d.ts +0 -13
- package/src/utilities/color.js +5 -1
- package/src/utilities/config.d.ts +1 -1
- package/src/utilities/config.js +22 -11
- package/src/utilities/environment-options.d.ts +12 -0
- package/src/utilities/environment-options.js +24 -0
- package/src/utilities/find-up.js +5 -1
- package/src/utilities/memoize.d.ts +15 -0
- package/src/utilities/memoize.js +69 -0
- package/src/utilities/package-manager.d.ts +33 -5
- package/src/utilities/package-manager.js +252 -71
- package/src/utilities/package-metadata.d.ts +15 -37
- package/src/utilities/package-metadata.js +15 -27
- package/src/utilities/package-tree.d.ts +2 -2
- package/src/utilities/package-tree.js +5 -1
- package/src/utilities/project.js +5 -1
- package/src/utilities/prompt.d.ts +2 -0
- package/src/utilities/prompt.js +25 -4
- package/bin/postinstall/analytics-prompt.js +0 -27
- package/bin/postinstall/script.js +0 -16
- package/models/command.d.ts +0 -29
- package/models/command.js +0 -50
- package/models/interface.d.ts +0 -19
- package/models/interface.js +0 -9
- package/models/schematic-command.d.ts +0 -43
- package/models/schematic-command.js +0 -378
- package/src/commands/add/add-impl.d.ts +0 -22
- package/src/commands/add/add-impl.js +0 -331
- package/src/commands/analytics/long-description.md +0 -10
- package/src/commands/config/config-impl.d.ts +0 -17
- package/src/commands/config/config-impl.js +0 -151
- package/src/commands/generate/generate-impl.d.ts +0 -19
- package/src/commands/generate/generate-impl.js +0 -49
- package/src/commands/new/new-impl.d.ts +0 -18
- package/src/commands/new/new-impl.js +0 -38
- package/src/commands/update/update-impl.d.ts +0 -40
- package/src/commands/update/update-impl.js +0 -728
- package/src/utilities/install-package.d.ts +0 -16
- package/src/utilities/install-package.js +0 -193
- package/src/utilities/package-json.d.ts +0 -249
- package/src/utilities/package-json.js +0 -9
package/lib/cli/index.d.ts
CHANGED
package/lib/cli/index.js
CHANGED
|
@@ -13,13 +13,10 @@ const util_1 = require("util");
|
|
|
13
13
|
const command_module_1 = require("../../src/command-builder/command-module");
|
|
14
14
|
const command_runner_1 = require("../../src/command-builder/command-runner");
|
|
15
15
|
const color_1 = require("../../src/utilities/color");
|
|
16
|
-
const
|
|
16
|
+
const environment_options_1 = require("../../src/utilities/environment-options");
|
|
17
17
|
const log_file_1 = require("../../src/utilities/log-file");
|
|
18
|
-
const project_1 = require("../../src/utilities/project");
|
|
19
18
|
var version_1 = require("../../src/utilities/version");
|
|
20
19
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
21
|
-
const debugEnv = process.env['NG_DEBUG'];
|
|
22
|
-
const isDebug = debugEnv !== undefined && debugEnv !== '0' && debugEnv.toLowerCase() !== 'false';
|
|
23
20
|
/* eslint-disable no-console */
|
|
24
21
|
async function default_1(options) {
|
|
25
22
|
// This node version check ensures that the requirements of the project instance of the CLI are met
|
|
@@ -30,7 +27,7 @@ async function default_1(options) {
|
|
|
30
27
|
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n');
|
|
31
28
|
return 3;
|
|
32
29
|
}
|
|
33
|
-
const logger = (0, node_1.createConsoleLogger)(
|
|
30
|
+
const logger = (0, node_1.createConsoleLogger)(environment_options_1.ngDebug, process.stdout, process.stderr, {
|
|
34
31
|
info: (s) => (color_1.colors.enabled ? s : (0, color_1.removeColor)(s)),
|
|
35
32
|
debug: (s) => (color_1.colors.enabled ? s : (0, color_1.removeColor)(s)),
|
|
36
33
|
warn: (s) => (color_1.colors.enabled ? color_1.colors.bold.yellow(s) : (0, color_1.removeColor)(s)),
|
|
@@ -47,27 +44,8 @@ async function default_1(options) {
|
|
|
47
44
|
console.error = function (...args) {
|
|
48
45
|
logger.error((0, util_1.format)(...args));
|
|
49
46
|
};
|
|
50
|
-
let workspace;
|
|
51
|
-
const workspaceFile = (0, project_1.findWorkspaceFile)();
|
|
52
|
-
if (workspaceFile === null) {
|
|
53
|
-
const [, localPath] = (0, config_1.getWorkspaceRaw)('local');
|
|
54
|
-
if (localPath !== null) {
|
|
55
|
-
logger.fatal(`An invalid configuration file was found ['${localPath}'].` +
|
|
56
|
-
' Please delete the file before running the command.');
|
|
57
|
-
return 1;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
try {
|
|
62
|
-
workspace = await config_1.AngularWorkspace.load(workspaceFile);
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
logger.fatal(`Unable to read workspace file '${workspaceFile}': ${e.message}`);
|
|
66
|
-
return 1;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
47
|
try {
|
|
70
|
-
return await (0, command_runner_1.runCommand)(options.cliArgs, logger
|
|
48
|
+
return await (0, command_runner_1.runCommand)(options.cliArgs, logger);
|
|
71
49
|
}
|
|
72
50
|
catch (err) {
|
|
73
51
|
if (err instanceof command_module_1.CommandModuleError) {
|
|
@@ -97,11 +75,6 @@ async function default_1(options) {
|
|
|
97
75
|
else {
|
|
98
76
|
logger.fatal('An unexpected error occurred: ' + JSON.stringify(err));
|
|
99
77
|
}
|
|
100
|
-
if (options.testing) {
|
|
101
|
-
// eslint-disable-next-line no-debugger
|
|
102
|
-
debugger;
|
|
103
|
-
throw err;
|
|
104
|
-
}
|
|
105
78
|
return 1;
|
|
106
79
|
}
|
|
107
80
|
}
|
package/lib/config/schema.json
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"defaultProject": {
|
|
24
24
|
"type": "string",
|
|
25
|
-
"description": "Default project name used in commands."
|
|
25
|
+
"description": "Default project name used in commands.",
|
|
26
|
+
"x-deprecated": "The project to use will be determined from the current working directory."
|
|
26
27
|
},
|
|
27
28
|
"projects": {
|
|
28
29
|
"type": "object",
|
|
@@ -44,7 +45,16 @@
|
|
|
44
45
|
"properties": {
|
|
45
46
|
"defaultCollection": {
|
|
46
47
|
"description": "The default schematics collection to use.",
|
|
47
|
-
"type": "string"
|
|
48
|
+
"type": "string",
|
|
49
|
+
"x-deprecated": "Use 'schematicCollections' instead."
|
|
50
|
+
},
|
|
51
|
+
"schematicCollections": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"description": "The list of schematic collections to use.",
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"uniqueItems": true
|
|
57
|
+
}
|
|
48
58
|
},
|
|
49
59
|
"packageManager": {
|
|
50
60
|
"description": "Specify which package manager tool to use.",
|
|
@@ -175,7 +185,16 @@
|
|
|
175
185
|
"cli": {
|
|
176
186
|
"defaultCollection": {
|
|
177
187
|
"description": "The default schematics collection to use.",
|
|
178
|
-
"type": "string"
|
|
188
|
+
"type": "string",
|
|
189
|
+
"x-deprecated": "Use 'schematicCollections' instead."
|
|
190
|
+
},
|
|
191
|
+
"schematicCollections": {
|
|
192
|
+
"type": "array",
|
|
193
|
+
"description": "The list of schematic collections to use.",
|
|
194
|
+
"items": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"uniqueItems": true
|
|
197
|
+
}
|
|
179
198
|
}
|
|
180
199
|
},
|
|
181
200
|
"schematics": {
|
|
@@ -586,7 +605,7 @@
|
|
|
586
605
|
"SchematicsAngularApplicationSchema": {
|
|
587
606
|
"title": "Angular Application Options Schema",
|
|
588
607
|
"type": "object",
|
|
589
|
-
"description": "Generates a new basic
|
|
608
|
+
"description": "Generates a new basic application definition in the \"projects\" subfolder of the workspace.",
|
|
590
609
|
"additionalProperties": false,
|
|
591
610
|
"properties": {
|
|
592
611
|
"projectRoot": {
|
|
@@ -1524,12 +1543,12 @@
|
|
|
1524
1543
|
"properties": {
|
|
1525
1544
|
"browserTarget": {
|
|
1526
1545
|
"type": "string",
|
|
1527
|
-
"description": "A browser builder target use for rendering the
|
|
1546
|
+
"description": "A browser builder target use for rendering the application shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
1528
1547
|
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
|
|
1529
1548
|
},
|
|
1530
1549
|
"serverTarget": {
|
|
1531
1550
|
"type": "string",
|
|
1532
|
-
"description": "A server builder target use for rendering the
|
|
1551
|
+
"description": "A server builder target use for rendering the application shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
1533
1552
|
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
|
|
1534
1553
|
},
|
|
1535
1554
|
"appModuleBundle": {
|
|
@@ -2183,7 +2202,7 @@
|
|
|
2183
2202
|
},
|
|
2184
2203
|
"servePath": {
|
|
2185
2204
|
"type": "string",
|
|
2186
|
-
"description": "The pathname where the
|
|
2205
|
+
"description": "The pathname where the application will be served."
|
|
2187
2206
|
},
|
|
2188
2207
|
"disableHostCheck": {
|
|
2189
2208
|
"type": "boolean",
|
|
@@ -3,6 +3,7 @@ export interface Schema {
|
|
|
3
3
|
cli?: CliOptions;
|
|
4
4
|
/**
|
|
5
5
|
* Default project name used in commands.
|
|
6
|
+
* @deprecated The project to use will be determined from the current working directory.
|
|
6
7
|
*/
|
|
7
8
|
defaultProject?: string;
|
|
8
9
|
/**
|
|
@@ -31,6 +32,10 @@ export interface CliOptions {
|
|
|
31
32
|
* Specify which package manager tool to use.
|
|
32
33
|
*/
|
|
33
34
|
packageManager?: PackageManager;
|
|
35
|
+
/**
|
|
36
|
+
* The list of schematic collections to use.
|
|
37
|
+
*/
|
|
38
|
+
schematicCollections?: string[];
|
|
34
39
|
/**
|
|
35
40
|
* Control CLI specific console warnings
|
|
36
41
|
*/
|
|
@@ -114,7 +119,7 @@ export interface SchematicOptions {
|
|
|
114
119
|
"@schematics/angular:web-worker"?: AngularWebWorkerOptionsSchema;
|
|
115
120
|
}
|
|
116
121
|
/**
|
|
117
|
-
* Generates a new basic
|
|
122
|
+
* Generates a new basic application definition in the "projects" subfolder of the workspace.
|
|
118
123
|
*/
|
|
119
124
|
export interface AngularApplicationOptionsSchema {
|
|
120
125
|
/**
|
package/lib/init.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -33,6 +37,7 @@ const path = __importStar(require("path"));
|
|
|
33
37
|
const semver_1 = require("semver");
|
|
34
38
|
const color_1 = require("../src/utilities/color");
|
|
35
39
|
const config_1 = require("../src/utilities/config");
|
|
40
|
+
const environment_options_1 = require("../src/utilities/environment-options");
|
|
36
41
|
const version_1 = require("../src/utilities/version");
|
|
37
42
|
(async () => {
|
|
38
43
|
var _a;
|
|
@@ -43,15 +48,11 @@ const version_1 = require("../src/utilities/version");
|
|
|
43
48
|
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
|
|
44
49
|
*/
|
|
45
50
|
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
|
|
46
|
-
const disableVersionCheckEnv = process.env['NG_DISABLE_VERSION_CHECK'];
|
|
47
51
|
/**
|
|
48
52
|
* Disable CLI version mismatch checks and forces usage of the invoked CLI
|
|
49
53
|
* instead of invoking the local installed version.
|
|
50
54
|
*/
|
|
51
|
-
|
|
52
|
-
disableVersionCheckEnv !== '0' &&
|
|
53
|
-
disableVersionCheckEnv.toLowerCase() !== 'false';
|
|
54
|
-
if (disableVersionCheck) {
|
|
55
|
+
if (environment_options_1.disableVersionCheck) {
|
|
55
56
|
return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
|
|
56
57
|
}
|
|
57
58
|
let cli;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.8",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
"Angular DevKit",
|
|
15
15
|
"angular-cli"
|
|
16
16
|
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"postinstall": "node ./bin/postinstall/script.js"
|
|
19
|
-
},
|
|
20
17
|
"repository": {
|
|
21
18
|
"type": "git",
|
|
22
19
|
"url": "https://github.com/angular/angular-cli.git"
|
|
@@ -28,36 +25,36 @@
|
|
|
28
25
|
},
|
|
29
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
30
27
|
"dependencies": {
|
|
31
|
-
"@angular-devkit/architect": "0.1400.0-next.
|
|
32
|
-
"@angular-devkit/core": "14.0.0-next.
|
|
33
|
-
"@angular-devkit/schematics": "14.0.0-next.
|
|
34
|
-
"@schematics/angular": "14.0.0-next.
|
|
28
|
+
"@angular-devkit/architect": "0.1400.0-next.8",
|
|
29
|
+
"@angular-devkit/core": "14.0.0-next.8",
|
|
30
|
+
"@angular-devkit/schematics": "14.0.0-next.8",
|
|
31
|
+
"@schematics/angular": "14.0.0-next.8",
|
|
35
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
36
33
|
"ansi-colors": "4.1.1",
|
|
37
|
-
"debug": "4.3.
|
|
34
|
+
"debug": "4.3.4",
|
|
38
35
|
"ini": "2.0.0",
|
|
39
|
-
"inquirer": "8.2.
|
|
36
|
+
"inquirer": "8.2.2",
|
|
40
37
|
"jsonc-parser": "3.0.0",
|
|
41
|
-
"npm-package-arg": "9.0.
|
|
42
|
-
"npm-pick-manifest": "7.0.
|
|
38
|
+
"npm-package-arg": "9.0.2",
|
|
39
|
+
"npm-pick-manifest": "7.0.1",
|
|
43
40
|
"open": "8.4.0",
|
|
44
41
|
"ora": "5.4.1",
|
|
45
|
-
"pacote": "13.0
|
|
42
|
+
"pacote": "13.1.0",
|
|
46
43
|
"resolve": "1.22.0",
|
|
47
44
|
"semver": "7.3.5",
|
|
48
45
|
"symbol-observable": "4.0.0",
|
|
49
46
|
"uuid": "8.3.2",
|
|
50
|
-
"yargs": "17.
|
|
47
|
+
"yargs": "17.4.0"
|
|
51
48
|
},
|
|
52
49
|
"ng-update": {
|
|
53
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
54
51
|
"packageGroup": {
|
|
55
|
-
"@angular/cli": "14.0.0-next.
|
|
56
|
-
"@angular-devkit/architect": "0.1400.0-next.
|
|
57
|
-
"@angular-devkit/build-angular": "14.0.0-next.
|
|
58
|
-
"@angular-devkit/build-webpack": "0.1400.0-next.
|
|
59
|
-
"@angular-devkit/core": "14.0.0-next.
|
|
60
|
-
"@angular-devkit/schematics": "14.0.0-next.
|
|
52
|
+
"@angular/cli": "14.0.0-next.8",
|
|
53
|
+
"@angular-devkit/architect": "0.1400.0-next.8",
|
|
54
|
+
"@angular-devkit/build-angular": "14.0.0-next.8",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1400.0-next.8",
|
|
56
|
+
"@angular-devkit/core": "14.0.0-next.8",
|
|
57
|
+
"@angular-devkit/schematics": "14.0.0-next.8"
|
|
61
58
|
}
|
|
62
59
|
},
|
|
63
60
|
"engines": {
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -68,6 +72,8 @@ class AnalyticsCollector {
|
|
|
68
72
|
this.parameters['cd' + core_1.analytics.NgCliAnalyticsDimensions.CpuSpeed] = Math.floor(os.cpus()[0].speed);
|
|
69
73
|
this.parameters['cd' + core_1.analytics.NgCliAnalyticsDimensions.RamInGigabytes] = Math.round(os.totalmem() / (1024 * 1024 * 1024));
|
|
70
74
|
this.parameters['cd' + core_1.analytics.NgCliAnalyticsDimensions.NodeVersion] = nodeVersion;
|
|
75
|
+
this.parameters['cd' + core_1.analytics.NgCliAnalyticsDimensions.AngularCLIMajorVersion] =
|
|
76
|
+
version_1.VERSION.major;
|
|
71
77
|
}
|
|
72
78
|
event(ec, ea, options = {}) {
|
|
73
79
|
const { label: el, value: ev, metrics, dimensions } = options;
|
|
@@ -19,42 +19,29 @@ export declare const analyticsPackageSafelist: (string | RegExp)[];
|
|
|
19
19
|
export declare function isPackageNameSafeForAnalytics(name: string): boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Set analytics settings. This does not work if the user is not inside a project.
|
|
22
|
-
* @param
|
|
22
|
+
* @param global Which config to use. "global" for user-level, and "local" for project-level.
|
|
23
23
|
* @param value Either a user ID, true to generate a new User ID, or false to disable analytics.
|
|
24
24
|
*/
|
|
25
|
-
export declare function setAnalyticsConfig(
|
|
25
|
+
export declare function setAnalyticsConfig(global: boolean, value: string | boolean): void;
|
|
26
26
|
/**
|
|
27
27
|
* Prompt the user for usage gathering permission.
|
|
28
28
|
* @param force Whether to ask regardless of whether or not the user is using an interactive shell.
|
|
29
29
|
* @return Whether or not the user was shown a prompt.
|
|
30
30
|
*/
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function promptAnalytics(global: boolean, force?: boolean): Promise<boolean>;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* local workspace.
|
|
35
|
-
* @param force Whether to ask regardless of whether or not the user is using an interactive shell.
|
|
36
|
-
* @return Whether or not the user was shown a prompt.
|
|
37
|
-
*/
|
|
38
|
-
export declare function promptProjectAnalytics(force?: boolean): Promise<boolean>;
|
|
39
|
-
export declare function hasGlobalAnalyticsConfiguration(): Promise<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Get the global analytics object for the user. This returns an instance of UniversalAnalytics,
|
|
42
|
-
* or undefined if analytics are disabled.
|
|
43
|
-
*
|
|
44
|
-
* If any problem happens, it is considered the user has been opting out of analytics.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getGlobalAnalytics(): Promise<AnalyticsCollector | undefined>;
|
|
47
|
-
export declare function hasWorkspaceAnalyticsConfiguration(): Promise<boolean>;
|
|
48
|
-
/**
|
|
49
|
-
* Get the workspace analytics object for the user. This returns an instance of AnalyticsCollector,
|
|
50
|
-
* or undefined if analytics are disabled.
|
|
33
|
+
* Get the analytics object for the user.
|
|
51
34
|
*
|
|
52
|
-
*
|
|
35
|
+
* @returns
|
|
36
|
+
* - `AnalyticsCollector` when enabled.
|
|
37
|
+
* - `analytics.NoopAnalytics` when disabled.
|
|
38
|
+
* - `undefined` when not configured.
|
|
53
39
|
*/
|
|
54
|
-
export declare function
|
|
40
|
+
export declare function getAnalytics(level: 'local' | 'global'): Promise<AnalyticsCollector | analytics.NoopAnalytics | undefined>;
|
|
55
41
|
/**
|
|
56
42
|
* Return the usage analytics sharing setting, which is either a property string (GA-XXXXXXX-XX),
|
|
57
43
|
* or undefined if no sharing.
|
|
58
44
|
*/
|
|
59
45
|
export declare function getSharedAnalytics(): Promise<AnalyticsCollector | undefined>;
|
|
60
46
|
export declare function createAnalytics(workspace: boolean, skipPrompt?: boolean): Promise<analytics.Analytics>;
|
|
47
|
+
export declare function getAnalyticsInfoString(): Promise<string>;
|