@angular-devkit/core 15.0.0-next.4 → 15.0.0-next.6
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/node/BUILD.bazel +0 -1
- package/node/index.d.ts +0 -2
- package/node/index.js +0 -15
- package/package.json +2 -2
- package/src/index.d.ts +1 -3
- package/src/index.js +1 -5
- package/src/logger/logger.d.ts +1 -1
- package/src/logger/logger.js +2 -2
- package/src/utils/index.d.ts +0 -9
- package/src/workspace/json/reader.js +1 -1
- package/node/experimental/index.d.ts +0 -9
- package/node/experimental/index.js +0 -35
- package/node/experimental/jobs/index.d.ts +0 -8
- package/node/experimental/jobs/index.js +0 -24
- package/node/experimental/jobs/job-registry.d.ts +0 -19
- package/node/experimental/jobs/job-registry.js +0 -59
- package/src/analytics/api.d.ts +0 -46
- package/src/analytics/api.js +0 -9
- package/src/analytics/forwarder.d.ts +0 -67
- package/src/analytics/forwarder.js +0 -88
- package/src/analytics/index.d.ts +0 -53
- package/src/analytics/index.js +0 -96
- package/src/analytics/logging.d.ts +0 -22
- package/src/analytics/logging.js +0 -35
- package/src/analytics/multi.d.ts +0 -21
- package/src/analytics/multi.js +0 -37
- package/src/analytics/noop.d.ts +0 -18
- package/src/analytics/noop.js +0 -23
- package/src/experimental/jobs/README.md +0 -510
- package/src/experimental/jobs/api.d.ts +0 -332
- package/src/experimental/jobs/api.js +0 -73
- package/src/experimental/jobs/architecture.md +0 -260
- package/src/experimental/jobs/create-job-handler.d.ts +0 -48
- package/src/experimental/jobs/create-job-handler.js +0 -135
- package/src/experimental/jobs/dispatcher.d.ts +0 -31
- package/src/experimental/jobs/dispatcher.js +0 -50
- package/src/experimental/jobs/exception.d.ts +0 -15
- package/src/experimental/jobs/exception.js +0 -23
- package/src/experimental/jobs/fallback-registry.d.ts +0 -19
- package/src/experimental/jobs/fallback-registry.js +0 -27
- package/src/experimental/jobs/index.d.ts +0 -15
- package/src/experimental/jobs/index.js +0 -31
- package/src/experimental/jobs/simple-registry.d.ts +0 -44
- package/src/experimental/jobs/simple-registry.js +0 -77
- package/src/experimental/jobs/simple-scheduler.d.ts +0 -77
- package/src/experimental/jobs/simple-scheduler.js +0 -382
- package/src/experimental/jobs/strategy.d.ts +0 -28
- package/src/experimental/jobs/strategy.js +0 -99
- package/src/experimental.d.ts +0 -9
- package/src/experimental.js +0 -35
package/node/BUILD.bazel
CHANGED
package/node/index.d.ts
CHANGED
|
@@ -5,7 +5,5 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import * as experimental from './experimental/jobs/job-registry';
|
|
9
8
|
export * from './cli-logger';
|
|
10
9
|
export * from './host';
|
|
11
|
-
export { experimental };
|
package/node/index.js
CHANGED
|
@@ -17,24 +17,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
17
17
|
if (k2 === undefined) k2 = k;
|
|
18
18
|
o[k2] = m[k];
|
|
19
19
|
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
20
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
33
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34
22
|
};
|
|
35
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.experimental = void 0;
|
|
37
|
-
const experimental = __importStar(require("./experimental/jobs/job-registry"));
|
|
38
|
-
exports.experimental = experimental;
|
|
39
24
|
__exportStar(require("./cli-logger"), exports);
|
|
40
25
|
__exportStar(require("./host"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/core",
|
|
3
|
-
"version": "15.0.0-next.
|
|
3
|
+
"version": "15.0.0-next.6",
|
|
4
4
|
"description": "Angular DevKit - Core Utility Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/angular/angular-cli.git"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": "^14.20.0 ||
|
|
35
|
+
"node": "^14.20.0 || ^16.13.0 || >=18.10.0",
|
|
36
36
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
37
37
|
"yarn": ">= 1.13.0"
|
|
38
38
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import * as analytics from './analytics';
|
|
9
|
-
import * as experimental from './experimental';
|
|
10
8
|
import * as json from './json/index';
|
|
11
9
|
import * as logging from './logger/index';
|
|
12
10
|
import * as workspaces from './workspace';
|
|
@@ -14,4 +12,4 @@ export * from './exception';
|
|
|
14
12
|
export * from './json/index';
|
|
15
13
|
export * from './utils/index';
|
|
16
14
|
export * from './virtual-fs/index';
|
|
17
|
-
export {
|
|
15
|
+
export { json, logging, workspaces };
|
package/src/index.js
CHANGED
|
@@ -33,11 +33,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
33
33
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.workspaces = exports.logging = exports.json =
|
|
37
|
-
const analytics = __importStar(require("./analytics"));
|
|
38
|
-
exports.analytics = analytics;
|
|
39
|
-
const experimental = __importStar(require("./experimental"));
|
|
40
|
-
exports.experimental = experimental;
|
|
36
|
+
exports.workspaces = exports.logging = exports.json = void 0;
|
|
41
37
|
const json = __importStar(require("./json/index"));
|
|
42
38
|
exports.json = json;
|
|
43
39
|
const logging = __importStar(require("./logger/index"));
|
package/src/logger/logger.d.ts
CHANGED
|
@@ -51,5 +51,5 @@ export declare class Logger extends Observable<LogEntry> implements LoggerApi {
|
|
|
51
51
|
subscribe(): Subscription;
|
|
52
52
|
subscribe(observer: PartialObserver<LogEntry>): Subscription;
|
|
53
53
|
subscribe(next?: (value: LogEntry) => void, error?: (error: Error) => void, complete?: () => void): Subscription;
|
|
54
|
-
forEach(next: (value: LogEntry) => void,
|
|
54
|
+
forEach(next: (value: LogEntry) => void, promiseCtor?: PromiseConstructorLike): Promise<void>;
|
|
55
55
|
}
|
package/src/logger/logger.js
CHANGED
|
@@ -112,8 +112,8 @@ class Logger extends rxjs_1.Observable {
|
|
|
112
112
|
// eslint-disable-next-line prefer-rest-params
|
|
113
113
|
arguments);
|
|
114
114
|
}
|
|
115
|
-
forEach(next,
|
|
116
|
-
return this._observable.forEach(next,
|
|
115
|
+
forEach(next, promiseCtor) {
|
|
116
|
+
return this._observable.forEach(next, promiseCtor);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
exports.Logger = Logger;
|
package/src/utils/index.d.ts
CHANGED
|
@@ -13,12 +13,3 @@ export * from './partially-ordered-set';
|
|
|
13
13
|
export * from './priority-queue';
|
|
14
14
|
export * from './lang';
|
|
15
15
|
export { tags, strings };
|
|
16
|
-
export declare type DeepReadonly<T> = T extends (infer R)[] ? DeepReadonlyArray<R> : T extends Function ? T : T extends object ? DeepReadonlyObject<T> : T;
|
|
17
|
-
export interface DeepReadonlyArray<T> extends Array<DeepReadonly<T>> {
|
|
18
|
-
}
|
|
19
|
-
export declare type DeepReadonlyObject<T> = {
|
|
20
|
-
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
21
|
-
};
|
|
22
|
-
export declare type Readwrite<T> = {
|
|
23
|
-
-readonly [P in keyof T]: T[P];
|
|
24
|
-
};
|
|
@@ -168,7 +168,7 @@ function parseProject(projectName, projectNode, context) {
|
|
|
168
168
|
break;
|
|
169
169
|
default:
|
|
170
170
|
if (!context.unprefixedProjectExtensions.has(name) && !/^[a-z]{1,3}-.*/.test(name)) {
|
|
171
|
-
context.warn(`Project extension with invalid name (${name})
|
|
171
|
+
context.warn(`Project '${projectName}' contains extension with invalid name (${name}).`, name);
|
|
172
172
|
}
|
|
173
173
|
if (extensions) {
|
|
174
174
|
extensions[name] = value;
|
|
@@ -1,35 +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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.jobs = void 0;
|
|
34
|
-
const jobs = __importStar(require("./jobs"));
|
|
35
|
-
exports.jobs = jobs;
|
|
@@ -1,24 +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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
__exportStar(require("./job-registry"), exports);
|
|
@@ -1,19 +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 { Observable } from 'rxjs';
|
|
9
|
-
import { JsonValue, experimental as core_experimental } from '../../../src';
|
|
10
|
-
export declare class NodeModuleJobRegistry<MinimumArgumentValueT extends JsonValue = JsonValue, MinimumInputValueT extends JsonValue = JsonValue, MinimumOutputValueT extends JsonValue = JsonValue> implements core_experimental.jobs.Registry<MinimumArgumentValueT, MinimumInputValueT, MinimumOutputValueT> {
|
|
11
|
-
protected _resolve(name: string): string | null;
|
|
12
|
-
/**
|
|
13
|
-
* Get a job description for a named job.
|
|
14
|
-
*
|
|
15
|
-
* @param name The name of the job.
|
|
16
|
-
* @returns A description, or null if the job is not registered.
|
|
17
|
-
*/
|
|
18
|
-
get<A extends MinimumArgumentValueT, I extends MinimumInputValueT, O extends MinimumOutputValueT>(name: core_experimental.jobs.JobName): Observable<core_experimental.jobs.JobHandler<A, I, O> | null>;
|
|
19
|
-
}
|
|
@@ -1,59 +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 });
|
|
10
|
-
exports.NodeModuleJobRegistry = void 0;
|
|
11
|
-
const rxjs_1 = require("rxjs");
|
|
12
|
-
const src_1 = require("../../../src");
|
|
13
|
-
class NodeModuleJobRegistry {
|
|
14
|
-
_resolve(name) {
|
|
15
|
-
try {
|
|
16
|
-
return require.resolve(name);
|
|
17
|
-
}
|
|
18
|
-
catch (e) {
|
|
19
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
throw e;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Get a job description for a named job.
|
|
27
|
-
*
|
|
28
|
-
* @param name The name of the job.
|
|
29
|
-
* @returns A description, or null if the job is not registered.
|
|
30
|
-
*/
|
|
31
|
-
get(name) {
|
|
32
|
-
const [moduleName, exportName] = name.split(/#/, 2);
|
|
33
|
-
const resolvedPath = this._resolve(moduleName);
|
|
34
|
-
if (!resolvedPath) {
|
|
35
|
-
return (0, rxjs_1.of)(null);
|
|
36
|
-
}
|
|
37
|
-
const pkg = require(resolvedPath);
|
|
38
|
-
const handler = pkg[exportName || 'default'];
|
|
39
|
-
if (!handler) {
|
|
40
|
-
return (0, rxjs_1.of)(null);
|
|
41
|
-
}
|
|
42
|
-
function _getValue(...fields) {
|
|
43
|
-
return fields.find((x) => src_1.schema.isJsonSchema(x)) || true;
|
|
44
|
-
}
|
|
45
|
-
const argument = _getValue(pkg.argument, handler.argument);
|
|
46
|
-
const input = _getValue(pkg.input, handler.input);
|
|
47
|
-
const output = _getValue(pkg.output, handler.output);
|
|
48
|
-
const channels = _getValue(pkg.channels, handler.channels);
|
|
49
|
-
return (0, rxjs_1.of)(Object.assign(handler.bind(undefined), {
|
|
50
|
-
jobDescription: {
|
|
51
|
-
argument,
|
|
52
|
-
input,
|
|
53
|
-
output,
|
|
54
|
-
channels,
|
|
55
|
-
},
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.NodeModuleJobRegistry = NodeModuleJobRegistry;
|
package/src/analytics/api.d.ts
DELETED
|
@@ -1,46 +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
|
-
export interface CustomDimensionsAndMetricsOptions {
|
|
9
|
-
dimensions?: (boolean | number | string)[];
|
|
10
|
-
metrics?: (boolean | number | string)[];
|
|
11
|
-
}
|
|
12
|
-
export interface EventOptions extends CustomDimensionsAndMetricsOptions {
|
|
13
|
-
label?: string;
|
|
14
|
-
value?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ScreenviewOptions extends CustomDimensionsAndMetricsOptions {
|
|
17
|
-
appVersion?: string;
|
|
18
|
-
appId?: string;
|
|
19
|
-
appInstallerId?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface PageviewOptions extends CustomDimensionsAndMetricsOptions {
|
|
22
|
-
hostname?: string;
|
|
23
|
-
title?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface TimingOptions extends CustomDimensionsAndMetricsOptions {
|
|
26
|
-
label?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Interface for managing analytics. This is highly platform dependent, and mostly matches
|
|
30
|
-
* Google Analytics. The reason the interface is here is to remove the dependency to an
|
|
31
|
-
* implementation from most other places.
|
|
32
|
-
*
|
|
33
|
-
* The methods exported from this interface more or less match those needed by us in the
|
|
34
|
-
* universal analytics package, see https://unpkg.com/@types/universal-analytics@0.4.2/index.d.ts
|
|
35
|
-
* for typings. We mostly named arguments to make it easier to follow, but didn't change or
|
|
36
|
-
* add any semantics to those methods. They're mapping GA and u-a one for one.
|
|
37
|
-
*
|
|
38
|
-
* The Angular CLI (or any other kind of backend) should forward it to some compatible backend.
|
|
39
|
-
*/
|
|
40
|
-
export interface Analytics {
|
|
41
|
-
event(category: string, action: string, options?: EventOptions): void;
|
|
42
|
-
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
|
|
43
|
-
pageview(path: string, options?: PageviewOptions): void;
|
|
44
|
-
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
|
|
45
|
-
flush(): Promise<void>;
|
|
46
|
-
}
|
package/src/analytics/api.js
DELETED
|
@@ -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,67 +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 { JsonObject } from '../json';
|
|
9
|
-
import { Analytics, EventOptions, PageviewOptions, ScreenviewOptions, TimingOptions } from './api';
|
|
10
|
-
export declare enum AnalyticsReportKind {
|
|
11
|
-
Event = "event",
|
|
12
|
-
Screenview = "screenview",
|
|
13
|
-
Pageview = "pageview",
|
|
14
|
-
Timing = "timing"
|
|
15
|
-
}
|
|
16
|
-
export interface AnalyticsReportBase extends JsonObject {
|
|
17
|
-
kind: AnalyticsReportKind;
|
|
18
|
-
}
|
|
19
|
-
export interface AnalyticsReportEvent extends AnalyticsReportBase {
|
|
20
|
-
kind: AnalyticsReportKind.Event;
|
|
21
|
-
options: JsonObject & EventOptions;
|
|
22
|
-
category: string;
|
|
23
|
-
action: string;
|
|
24
|
-
}
|
|
25
|
-
export interface AnalyticsReportScreenview extends AnalyticsReportBase {
|
|
26
|
-
kind: AnalyticsReportKind.Screenview;
|
|
27
|
-
options: JsonObject & ScreenviewOptions;
|
|
28
|
-
screenName: string;
|
|
29
|
-
appName: string;
|
|
30
|
-
}
|
|
31
|
-
export interface AnalyticsReportPageview extends AnalyticsReportBase {
|
|
32
|
-
kind: AnalyticsReportKind.Pageview;
|
|
33
|
-
options: JsonObject & PageviewOptions;
|
|
34
|
-
path: string;
|
|
35
|
-
}
|
|
36
|
-
export interface AnalyticsReportTiming extends AnalyticsReportBase {
|
|
37
|
-
kind: AnalyticsReportKind.Timing;
|
|
38
|
-
options: JsonObject & TimingOptions;
|
|
39
|
-
category: string;
|
|
40
|
-
variable: string;
|
|
41
|
-
time: string | number;
|
|
42
|
-
}
|
|
43
|
-
export declare type AnalyticsReport = AnalyticsReportEvent | AnalyticsReportScreenview | AnalyticsReportPageview | AnalyticsReportTiming;
|
|
44
|
-
/**
|
|
45
|
-
* A function that can forward analytics along some stream. AnalyticsReport is already a
|
|
46
|
-
* JsonObject descendant, but we force it here so the user knows it's safe to serialize.
|
|
47
|
-
*/
|
|
48
|
-
export declare type AnalyticsForwarderFn = (report: JsonObject & AnalyticsReport) => void;
|
|
49
|
-
/**
|
|
50
|
-
* A class that follows the Analytics interface and forwards analytic reports (JavaScript objects).
|
|
51
|
-
* AnalyticsReporter is the counterpart which takes analytic reports and report them to another
|
|
52
|
-
* Analytics interface.
|
|
53
|
-
*/
|
|
54
|
-
export declare class ForwardingAnalytics implements Analytics {
|
|
55
|
-
protected _fn: AnalyticsForwarderFn;
|
|
56
|
-
constructor(_fn: AnalyticsForwarderFn);
|
|
57
|
-
event(category: string, action: string, options?: EventOptions): void;
|
|
58
|
-
screenview(screenName: string, appName: string, options?: ScreenviewOptions): void;
|
|
59
|
-
pageview(path: string, options?: PageviewOptions): void;
|
|
60
|
-
timing(category: string, variable: string, time: string | number, options?: TimingOptions): void;
|
|
61
|
-
flush(): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
export declare class AnalyticsReporter {
|
|
64
|
-
protected _analytics: Analytics;
|
|
65
|
-
constructor(_analytics: Analytics);
|
|
66
|
-
report(report: AnalyticsReport): void;
|
|
67
|
-
}
|
|
@@ -1,88 +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 });
|
|
10
|
-
exports.AnalyticsReporter = exports.ForwardingAnalytics = exports.AnalyticsReportKind = void 0;
|
|
11
|
-
var AnalyticsReportKind;
|
|
12
|
-
(function (AnalyticsReportKind) {
|
|
13
|
-
AnalyticsReportKind["Event"] = "event";
|
|
14
|
-
AnalyticsReportKind["Screenview"] = "screenview";
|
|
15
|
-
AnalyticsReportKind["Pageview"] = "pageview";
|
|
16
|
-
AnalyticsReportKind["Timing"] = "timing";
|
|
17
|
-
})(AnalyticsReportKind = exports.AnalyticsReportKind || (exports.AnalyticsReportKind = {}));
|
|
18
|
-
/**
|
|
19
|
-
* A class that follows the Analytics interface and forwards analytic reports (JavaScript objects).
|
|
20
|
-
* AnalyticsReporter is the counterpart which takes analytic reports and report them to another
|
|
21
|
-
* Analytics interface.
|
|
22
|
-
*/
|
|
23
|
-
class ForwardingAnalytics {
|
|
24
|
-
constructor(_fn) {
|
|
25
|
-
this._fn = _fn;
|
|
26
|
-
}
|
|
27
|
-
event(category, action, options) {
|
|
28
|
-
this._fn({
|
|
29
|
-
kind: AnalyticsReportKind.Event,
|
|
30
|
-
category,
|
|
31
|
-
action,
|
|
32
|
-
options: { ...options },
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
screenview(screenName, appName, options) {
|
|
36
|
-
this._fn({
|
|
37
|
-
kind: AnalyticsReportKind.Screenview,
|
|
38
|
-
screenName,
|
|
39
|
-
appName,
|
|
40
|
-
options: { ...options },
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
pageview(path, options) {
|
|
44
|
-
this._fn({
|
|
45
|
-
kind: AnalyticsReportKind.Pageview,
|
|
46
|
-
path,
|
|
47
|
-
options: { ...options },
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
timing(category, variable, time, options) {
|
|
51
|
-
this._fn({
|
|
52
|
-
kind: AnalyticsReportKind.Timing,
|
|
53
|
-
category,
|
|
54
|
-
variable,
|
|
55
|
-
time,
|
|
56
|
-
options: { ...options },
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
// We do not support flushing.
|
|
60
|
-
flush() {
|
|
61
|
-
return Promise.resolve();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.ForwardingAnalytics = ForwardingAnalytics;
|
|
65
|
-
class AnalyticsReporter {
|
|
66
|
-
constructor(_analytics) {
|
|
67
|
-
this._analytics = _analytics;
|
|
68
|
-
}
|
|
69
|
-
report(report) {
|
|
70
|
-
switch (report.kind) {
|
|
71
|
-
case AnalyticsReportKind.Event:
|
|
72
|
-
this._analytics.event(report.category, report.action, report.options);
|
|
73
|
-
break;
|
|
74
|
-
case AnalyticsReportKind.Screenview:
|
|
75
|
-
this._analytics.screenview(report.screenName, report.appName, report.options);
|
|
76
|
-
break;
|
|
77
|
-
case AnalyticsReportKind.Pageview:
|
|
78
|
-
this._analytics.pageview(report.path, report.options);
|
|
79
|
-
break;
|
|
80
|
-
case AnalyticsReportKind.Timing:
|
|
81
|
-
this._analytics.timing(report.category, report.variable, report.time, report.options);
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
throw new Error('Unexpected analytics report: ' + JSON.stringify(report));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.AnalyticsReporter = AnalyticsReporter;
|
package/src/analytics/index.d.ts
DELETED
|
@@ -1,53 +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
|
-
export * from './api';
|
|
9
|
-
export * from './forwarder';
|
|
10
|
-
export * from './logging';
|
|
11
|
-
export * from './multi';
|
|
12
|
-
export * from './noop';
|
|
13
|
-
/**
|
|
14
|
-
* MAKE SURE TO KEEP THIS IN SYNC WITH THE TABLE AND CONTENT IN `/docs/design/analytics.md`.
|
|
15
|
-
* WE LIST THOSE DIMENSIONS (AND MORE).
|
|
16
|
-
*
|
|
17
|
-
* These cannot be in their respective schema.json file because we either change the type
|
|
18
|
-
* (e.g. --buildEventLog is string, but we want to know the usage of it, not its value), or
|
|
19
|
-
* some validation needs to be done (we cannot record ng add --collection if it's not marked as
|
|
20
|
-
* allowed).
|
|
21
|
-
*/
|
|
22
|
-
export declare enum NgCliAnalyticsDimensions {
|
|
23
|
-
CpuCount = 1,
|
|
24
|
-
CpuSpeed = 2,
|
|
25
|
-
RamInGigabytes = 3,
|
|
26
|
-
NodeVersion = 4,
|
|
27
|
-
NgAddCollection = 6,
|
|
28
|
-
AngularCLIMajorVersion = 8,
|
|
29
|
-
BuildErrors = 20
|
|
30
|
-
}
|
|
31
|
-
export declare enum NgCliAnalyticsMetrics {
|
|
32
|
-
NgComponentCount = 1,
|
|
33
|
-
UNUSED_2 = 2,
|
|
34
|
-
UNUSED_3 = 3,
|
|
35
|
-
UNUSED_4 = 4,
|
|
36
|
-
BuildTime = 5,
|
|
37
|
-
NgOnInitCount = 6,
|
|
38
|
-
InitialChunkSize = 7,
|
|
39
|
-
TotalChunkCount = 8,
|
|
40
|
-
TotalChunkSize = 9,
|
|
41
|
-
LazyChunkCount = 10,
|
|
42
|
-
LazyChunkSize = 11,
|
|
43
|
-
AssetCount = 12,
|
|
44
|
-
AssetSize = 13,
|
|
45
|
-
PolyfillSize = 14,
|
|
46
|
-
CssSize = 15
|
|
47
|
-
}
|
|
48
|
-
export declare const NgCliAnalyticsDimensionsFlagInfo: {
|
|
49
|
-
[name: string]: [string, string];
|
|
50
|
-
};
|
|
51
|
-
export declare const NgCliAnalyticsMetricsFlagInfo: {
|
|
52
|
-
[name: string]: [string, string];
|
|
53
|
-
};
|
package/src/analytics/index.js
DELETED
|
@@ -1,96 +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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.NgCliAnalyticsMetricsFlagInfo = exports.NgCliAnalyticsDimensionsFlagInfo = exports.NgCliAnalyticsMetrics = exports.NgCliAnalyticsDimensions = void 0;
|
|
25
|
-
__exportStar(require("./api"), exports);
|
|
26
|
-
__exportStar(require("./forwarder"), exports);
|
|
27
|
-
__exportStar(require("./logging"), exports);
|
|
28
|
-
__exportStar(require("./multi"), exports);
|
|
29
|
-
__exportStar(require("./noop"), exports);
|
|
30
|
-
/**
|
|
31
|
-
* MAKE SURE TO KEEP THIS IN SYNC WITH THE TABLE AND CONTENT IN `/docs/design/analytics.md`.
|
|
32
|
-
* WE LIST THOSE DIMENSIONS (AND MORE).
|
|
33
|
-
*
|
|
34
|
-
* These cannot be in their respective schema.json file because we either change the type
|
|
35
|
-
* (e.g. --buildEventLog is string, but we want to know the usage of it, not its value), or
|
|
36
|
-
* some validation needs to be done (we cannot record ng add --collection if it's not marked as
|
|
37
|
-
* allowed).
|
|
38
|
-
*/
|
|
39
|
-
var NgCliAnalyticsDimensions;
|
|
40
|
-
(function (NgCliAnalyticsDimensions) {
|
|
41
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["CpuCount"] = 1] = "CpuCount";
|
|
42
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["CpuSpeed"] = 2] = "CpuSpeed";
|
|
43
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["RamInGigabytes"] = 3] = "RamInGigabytes";
|
|
44
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NodeVersion"] = 4] = "NodeVersion";
|
|
45
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NgAddCollection"] = 6] = "NgAddCollection";
|
|
46
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["AngularCLIMajorVersion"] = 8] = "AngularCLIMajorVersion";
|
|
47
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["BuildErrors"] = 20] = "BuildErrors";
|
|
48
|
-
})(NgCliAnalyticsDimensions = exports.NgCliAnalyticsDimensions || (exports.NgCliAnalyticsDimensions = {}));
|
|
49
|
-
var NgCliAnalyticsMetrics;
|
|
50
|
-
(function (NgCliAnalyticsMetrics) {
|
|
51
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["NgComponentCount"] = 1] = "NgComponentCount";
|
|
52
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["UNUSED_2"] = 2] = "UNUSED_2";
|
|
53
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["UNUSED_3"] = 3] = "UNUSED_3";
|
|
54
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["UNUSED_4"] = 4] = "UNUSED_4";
|
|
55
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["BuildTime"] = 5] = "BuildTime";
|
|
56
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["NgOnInitCount"] = 6] = "NgOnInitCount";
|
|
57
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["InitialChunkSize"] = 7] = "InitialChunkSize";
|
|
58
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["TotalChunkCount"] = 8] = "TotalChunkCount";
|
|
59
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["TotalChunkSize"] = 9] = "TotalChunkSize";
|
|
60
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["LazyChunkCount"] = 10] = "LazyChunkCount";
|
|
61
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["LazyChunkSize"] = 11] = "LazyChunkSize";
|
|
62
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["AssetCount"] = 12] = "AssetCount";
|
|
63
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["AssetSize"] = 13] = "AssetSize";
|
|
64
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["PolyfillSize"] = 14] = "PolyfillSize";
|
|
65
|
-
NgCliAnalyticsMetrics[NgCliAnalyticsMetrics["CssSize"] = 15] = "CssSize";
|
|
66
|
-
})(NgCliAnalyticsMetrics = exports.NgCliAnalyticsMetrics || (exports.NgCliAnalyticsMetrics = {}));
|
|
67
|
-
// This table is used when generating the analytics.md file. It should match the enum above
|
|
68
|
-
// or the validate-user-analytics script will fail.
|
|
69
|
-
exports.NgCliAnalyticsDimensionsFlagInfo = {
|
|
70
|
-
CpuCount: ['CPU Count', 'number'],
|
|
71
|
-
CpuSpeed: ['CPU Speed', 'number'],
|
|
72
|
-
RamInGigabytes: ['RAM (In GB)', 'number'],
|
|
73
|
-
NodeVersion: ['Node Version', 'number'],
|
|
74
|
-
NgAddCollection: ['--collection', 'string'],
|
|
75
|
-
AngularCLIMajorVersion: ['Angular CLI Major Version', 'string'],
|
|
76
|
-
BuildErrors: ['Build Errors (comma separated)', 'string'],
|
|
77
|
-
};
|
|
78
|
-
// This table is used when generating the analytics.md file. It should match the enum above
|
|
79
|
-
// or the validate-user-analytics script will fail.
|
|
80
|
-
exports.NgCliAnalyticsMetricsFlagInfo = {
|
|
81
|
-
NgComponentCount: ['NgComponentCount', 'number'],
|
|
82
|
-
UNUSED_2: ['UNUSED_2', 'none'],
|
|
83
|
-
UNUSED_3: ['UNUSED_3', 'none'],
|
|
84
|
-
UNUSED_4: ['UNUSED_4', 'none'],
|
|
85
|
-
BuildTime: ['Build Time', 'number'],
|
|
86
|
-
NgOnInitCount: ['NgOnInit Count', 'number'],
|
|
87
|
-
InitialChunkSize: ['Initial Chunk Size', 'number'],
|
|
88
|
-
TotalChunkCount: ['Total Chunk Count', 'number'],
|
|
89
|
-
TotalChunkSize: ['Total Chunk Size', 'number'],
|
|
90
|
-
LazyChunkCount: ['Lazy Chunk Count', 'number'],
|
|
91
|
-
LazyChunkSize: ['Lazy Chunk Size', 'number'],
|
|
92
|
-
AssetCount: ['Asset Count', 'number'],
|
|
93
|
-
AssetSize: ['Asset Size', 'number'],
|
|
94
|
-
PolyfillSize: [' Polyfill Size', 'number'],
|
|
95
|
-
CssSize: [' Css Size', 'number'],
|
|
96
|
-
};
|