@bundle-stats/utils 4.2.2 → 4.2.3-beta.1
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/README.md +15 -10
- package/lib/browsertime/metrics.js +22 -22
- package/lib/browsertime/metrics.js.map +1 -1
- package/lib/config/component-links.js +7 -1
- package/lib/config/component-links.js.map +1 -1
- package/lib/config/file-types.js +3 -3
- package/lib/config/file-types.js.map +1 -1
- package/lib/config/index.js +1 -2
- package/lib/config/index.js.map +1 -1
- package/lib/config/metric-types.js +28 -0
- package/lib/config/metric-types.js.map +1 -0
- package/lib/constants.js +23 -22
- package/lib/constants.js.map +1 -1
- package/lib/i18n.js +15 -10
- package/lib/i18n.js.map +1 -1
- package/lib/jobs/create-job.js +17 -7
- package/lib/jobs/create-job.js.map +1 -1
- package/lib/jobs/create-jobs.js.map +1 -1
- package/lib/lighthouse/metrics.js +13 -13
- package/lib/lighthouse/metrics.js.map +1 -1
- package/lib/report/add-row-metric-data.js +4 -4
- package/lib/report/add-row-metric-data.js.map +1 -1
- package/lib/report/compare-metrics.js +4 -1
- package/lib/report/compare-metrics.js.map +1 -1
- package/lib/report/create.js +17 -7
- package/lib/report/create.js.map +1 -1
- package/lib/report/get-metric-changed.js.map +1 -1
- package/lib/report/index.js +1 -0
- package/lib/report/index.js.map +1 -1
- package/lib/report/merge-metrics-by-key.js +1 -1
- package/lib/report/merge-metrics-by-key.js.map +1 -1
- package/lib/utils/component-links.js +191 -27
- package/lib/utils/component-links.js.map +1 -1
- package/lib/utils/date.js.map +1 -1
- package/lib/utils/delta.js +35 -30
- package/lib/utils/delta.js.map +1 -1
- package/lib/utils/format.js +5 -6
- package/lib/utils/format.js.map +1 -1
- package/lib/utils/insights.js.map +1 -1
- package/lib/utils/metrics.js +49 -32
- package/lib/utils/metrics.js.map +1 -1
- package/lib/webpack/compare.js +16 -12
- package/lib/webpack/compare.js.map +1 -1
- package/lib/webpack/extract/assets.js +7 -1
- package/lib/webpack/extract/assets.js.map +1 -1
- package/lib/webpack/extract/meta.js.map +1 -1
- package/lib/webpack/extract/modules-packages-duplicate.js +13 -8
- package/lib/webpack/extract/modules-packages-duplicate.js.map +1 -1
- package/lib/webpack/extract/modules-packages-new-insight.js.map +1 -1
- package/lib/webpack/extract/modules-packages.js +8 -1
- package/lib/webpack/extract/modules-packages.js.map +1 -1
- package/lib/webpack/extract/modules.js +45 -20
- package/lib/webpack/extract/modules.js.map +1 -1
- package/lib/webpack/metrics.js +35 -34
- package/lib/webpack/metrics.js.map +1 -1
- package/lib/webpack/selectors.js +40 -3
- package/lib/webpack/selectors.js.map +1 -1
- package/lib/webpack/types.js +1 -1
- package/lib/webpack/types.js.map +1 -1
- package/lib/webpack/utils.js +37 -25
- package/lib/webpack/utils.js.map +1 -1
- package/lib-esm/browsertime/metrics.js +22 -22
- package/lib-esm/browsertime/metrics.js.map +1 -1
- package/lib-esm/config/component-links.js +6 -0
- package/lib-esm/config/component-links.js.map +1 -1
- package/lib-esm/config/file-types.js +3 -3
- package/lib-esm/config/file-types.js.map +1 -1
- package/lib-esm/config/index.js +1 -2
- package/lib-esm/config/index.js.map +1 -1
- package/lib-esm/config/metric-types.js +25 -0
- package/lib-esm/config/metric-types.js.map +1 -0
- package/lib-esm/constants.js +19 -18
- package/lib-esm/constants.js.map +1 -1
- package/lib-esm/i18n.js +15 -10
- package/lib-esm/i18n.js.map +1 -1
- package/lib-esm/jobs/create-job.js.map +1 -1
- package/lib-esm/jobs/create-jobs.js.map +1 -1
- package/lib-esm/lighthouse/metrics.js +13 -13
- package/lib-esm/lighthouse/metrics.js.map +1 -1
- package/lib-esm/report/add-row-metric-data.js +4 -4
- package/lib-esm/report/add-row-metric-data.js.map +1 -1
- package/lib-esm/report/compare-metrics.js +4 -1
- package/lib-esm/report/compare-metrics.js.map +1 -1
- package/lib-esm/report/create.js.map +1 -1
- package/lib-esm/report/get-metric-changed.js.map +1 -1
- package/lib-esm/report/index.js +1 -0
- package/lib-esm/report/index.js.map +1 -1
- package/lib-esm/report/merge-metrics-by-key.js +1 -1
- package/lib-esm/report/merge-metrics-by-key.js.map +1 -1
- package/lib-esm/utils/component-links.js +185 -27
- package/lib-esm/utils/component-links.js.map +1 -1
- package/lib-esm/utils/date.js.map +1 -1
- package/lib-esm/utils/delta.js +32 -26
- package/lib-esm/utils/delta.js.map +1 -1
- package/lib-esm/utils/format.js.map +1 -1
- package/lib-esm/utils/insights.js.map +1 -1
- package/lib-esm/utils/metrics.js +44 -27
- package/lib-esm/utils/metrics.js.map +1 -1
- package/lib-esm/webpack/compare.js +7 -5
- package/lib-esm/webpack/compare.js.map +1 -1
- package/lib-esm/webpack/extract/assets.js +7 -1
- package/lib-esm/webpack/extract/assets.js.map +1 -1
- package/lib-esm/webpack/extract/meta.js.map +1 -1
- package/lib-esm/webpack/extract/modules-packages-duplicate.js +13 -8
- package/lib-esm/webpack/extract/modules-packages-duplicate.js.map +1 -1
- package/lib-esm/webpack/extract/modules-packages-new-insight.js.map +1 -1
- package/lib-esm/webpack/extract/modules-packages.js +8 -1
- package/lib-esm/webpack/extract/modules-packages.js.map +1 -1
- package/lib-esm/webpack/extract/modules.js +45 -20
- package/lib-esm/webpack/extract/modules.js.map +1 -1
- package/lib-esm/webpack/metrics.js +35 -34
- package/lib-esm/webpack/metrics.js.map +1 -1
- package/lib-esm/webpack/selectors.js +35 -1
- package/lib-esm/webpack/selectors.js.map +1 -1
- package/lib-esm/webpack/utils.js +37 -25
- package/lib-esm/webpack/utils.js.map +1 -1
- package/package.json +20 -22
- package/src/browsertime/metrics.js +22 -22
- package/src/config/component-links.js +7 -0
- package/src/config/file-types.js +3 -3
- package/src/config/index.js +1 -2
- package/src/config/metric-types.ts +25 -0
- package/src/constants.ts +94 -34
- package/src/i18n.js +15 -10
- package/src/lighthouse/metrics.js +13 -15
- package/src/report/add-row-metric-data.ts +42 -38
- package/src/report/compare-metrics.ts +7 -4
- package/src/report/create.ts +1 -1
- package/src/report/index.js +1 -0
- package/src/report/merge-metrics-by-key.ts +7 -5
- package/src/report/types.ts +17 -0
- package/src/utils/component-links.ts +276 -35
- package/src/utils/delta.ts +98 -0
- package/src/utils/metrics.ts +88 -0
- package/src/webpack/compare.ts +62 -0
- package/src/webpack/extract/assets.ts +13 -7
- package/src/webpack/extract/modules-packages-duplicate.ts +23 -15
- package/src/webpack/extract/modules-packages.ts +74 -61
- package/src/webpack/extract/modules.ts +66 -33
- package/src/webpack/{metrics.js → metrics.ts} +41 -39
- package/src/webpack/selectors.js +82 -9
- package/src/webpack/types.ts +13 -4
- package/src/webpack/utils.ts +173 -0
- package/types/browsertime/compare.d.ts +1 -1
- package/types/browsertime/metrics.d.ts +63 -43
- package/types/config/component-links.d.ts +26 -18
- package/types/config/file-types.d.ts +17 -17
- package/types/config/index.d.ts +1 -2
- package/types/config/metric-types.d.ts +2 -0
- package/types/constants.d.ts +52 -29
- package/types/i18n.d.ts +19 -14
- package/types/lighthouse/compare.d.ts +1 -1
- package/types/lighthouse/filter.d.ts +1 -1
- package/types/lighthouse/metrics.d.ts +36 -28
- package/types/report/add-row-metric-data.d.ts +1 -16
- package/types/report/compare-metrics.d.ts +1 -1
- package/types/report/index.d.ts +1 -0
- package/types/report/merge-metrics-by-key.d.ts +1 -1
- package/types/report/types.d.ts +12 -0
- package/types/utils/component-links.d.ts +24 -8
- package/types/utils/delta.d.ts +4 -6
- package/types/utils/metrics.d.ts +4 -3
- package/types/webpack/compare.d.ts +11 -14
- package/types/webpack/constants.d.ts +1 -1
- package/types/webpack/extract/assets-size-total-insight.d.ts +2 -2
- package/types/webpack/extract/modules-packages-duplicate.d.ts +3 -3
- package/types/webpack/extract/modules.d.ts +1 -1
- package/types/webpack/metrics.d.ts +7 -153
- package/types/webpack/selectors.d.ts +21 -7
- package/types/webpack/types.d.ts +4 -4
- package/types/webpack/utils.d.ts +8 -8
- package/CHANGELOG.md +0 -333
- package/lib/config/delta.js +0 -13
- package/lib/config/delta.js.map +0 -1
- package/lib/config/metrics.js +0 -32
- package/lib/config/metrics.js.map +0 -1
- package/lib-esm/config/delta.js +0 -10
- package/lib-esm/config/delta.js.map +0 -1
- package/lib-esm/config/metrics.js +0 -29
- package/lib-esm/config/metrics.js.map +0 -1
- package/src/config/delta.js +0 -11
- package/src/config/metrics.js +0 -35
- package/src/utils/delta.js +0 -94
- package/src/utils/metrics.js +0 -92
- package/src/webpack/compare.js +0 -81
- package/src/webpack/utils.js +0 -155
- package/types/config/delta.d.ts +0 -9
- package/types/config/metrics.d.ts +0 -35
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
export const ASSET_ENTRY_TYPE: "et";
|
|
2
|
+
export const ASSET_CHUNK: "c";
|
|
2
3
|
export const ASSET_FILE_TYPE: "ft";
|
|
3
4
|
export const MODULE_CHUNK: "c";
|
|
4
5
|
export const MODULE_FILE_TYPE: "mft";
|
|
5
6
|
export const MODULE_SOURCE_TYPE: "mst";
|
|
6
7
|
export namespace ASSET_FILTERS {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
let OTHER: string;
|
|
9
|
+
let CHANGED: string;
|
|
10
|
+
let ENTRY: string;
|
|
11
|
+
let INITIAL: string;
|
|
12
|
+
let CHUNK: string;
|
|
12
13
|
}
|
|
13
14
|
export namespace MODULE_FILTERS {
|
|
14
|
-
|
|
15
|
+
let CHANGED_1: string;
|
|
15
16
|
export { CHANGED_1 as CHANGED };
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export let DUPLICATED: string;
|
|
18
|
+
export let FIRST_PARTY: string;
|
|
19
|
+
export let THIRD_PARTY: string;
|
|
20
|
+
export let METRIC: string;
|
|
19
21
|
}
|
|
20
22
|
export namespace PACKAGE_FILTERS {
|
|
21
|
-
|
|
23
|
+
let CHANGED_2: string;
|
|
22
24
|
export { CHANGED_2 as CHANGED };
|
|
23
|
-
export
|
|
25
|
+
export let DUPLICATE: string;
|
|
24
26
|
}
|
|
25
27
|
export namespace SECTIONS {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
let TOTALS: string;
|
|
29
|
+
let ASSETS: string;
|
|
30
|
+
let MODULES: string;
|
|
31
|
+
let PACKAGES: string;
|
|
30
32
|
}
|
|
31
33
|
export namespace COMPONENT {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
let BUNDLE_ASSETS: string;
|
|
35
|
+
let BUNDLE_MODULES: string;
|
|
36
|
+
let BUNDLE_PACKAGES: string;
|
|
37
|
+
}
|
|
38
|
+
export namespace MODULE_SOURCE_TYPE_LABELS {
|
|
39
|
+
let FIRST_PARTY_1: string;
|
|
40
|
+
export { FIRST_PARTY_1 as FIRST_PARTY };
|
|
41
|
+
let THIRD_PARTY_1: string;
|
|
42
|
+
export { THIRD_PARTY_1 as THIRD_PARTY };
|
|
35
43
|
}
|
|
@@ -6,40 +6,40 @@ export const FILE_TYPE_FONT: "FONT";
|
|
|
6
6
|
export const FILE_TYPE_HTML: "HTML";
|
|
7
7
|
export const FILE_TYPE_OTHER: "OTHER";
|
|
8
8
|
export namespace FILE_TYPE_PATTERNS {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
let CSS: RegExp;
|
|
10
|
+
let JS: RegExp;
|
|
11
|
+
let IMG: RegExp;
|
|
12
|
+
let MEDIA: RegExp;
|
|
13
|
+
let FONT: RegExp;
|
|
14
|
+
let HTML: RegExp;
|
|
15
15
|
}
|
|
16
16
|
export namespace FILE_TYPE_LABELS {
|
|
17
|
-
|
|
17
|
+
let CSS_1: string;
|
|
18
18
|
export { CSS_1 as CSS };
|
|
19
|
-
|
|
19
|
+
let JS_1: string;
|
|
20
20
|
export { JS_1 as JS };
|
|
21
|
-
|
|
21
|
+
let IMG_1: string;
|
|
22
22
|
export { IMG_1 as IMG };
|
|
23
|
-
|
|
23
|
+
let MEDIA_1: string;
|
|
24
24
|
export { MEDIA_1 as MEDIA };
|
|
25
|
-
|
|
25
|
+
let FONT_1: string;
|
|
26
26
|
export { FONT_1 as FONT };
|
|
27
|
-
|
|
27
|
+
let HTML_1: string;
|
|
28
28
|
export { HTML_1 as HTML };
|
|
29
|
-
export
|
|
29
|
+
export let OTHER: string;
|
|
30
30
|
}
|
|
31
31
|
export const FILE_TYPES: string[];
|
|
32
32
|
export namespace MODULE_SOURCE_PATTERNS {
|
|
33
|
-
|
|
33
|
+
let CSS_2: RegExp;
|
|
34
34
|
export { CSS_2 as CSS };
|
|
35
|
-
|
|
35
|
+
let JS_2: RegExp;
|
|
36
36
|
export { JS_2 as JS };
|
|
37
37
|
}
|
|
38
38
|
export const MODULE_SOURCE_FILE_TYPES: string[];
|
|
39
39
|
export namespace MODULE_DESTINATION_PATTERNS {
|
|
40
|
-
|
|
40
|
+
let CSS_3: RegExp;
|
|
41
41
|
export { CSS_3 as CSS };
|
|
42
|
-
|
|
42
|
+
let JS_3: RegExp;
|
|
43
43
|
export { JS_3 as JS };
|
|
44
44
|
}
|
|
45
45
|
export const MODULE_DESTINATION_FILE_TYPES: string[];
|
package/types/config/index.d.ts
CHANGED
package/types/constants.d.ts
CHANGED
|
@@ -9,42 +9,55 @@ export declare enum InsightType {
|
|
|
9
9
|
INFO = "info",
|
|
10
10
|
WARNING = "warning"
|
|
11
11
|
}
|
|
12
|
-
export declare enum
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
export declare enum MetricTypes {
|
|
13
|
+
Numeric = "METRIC_TYPE_NUMERIC",
|
|
14
|
+
Score = "METRIC_TYPE_SCORE",
|
|
15
|
+
FileSize = "METRIC_TYPE_FILE_SIZE",
|
|
16
|
+
Duration = "METRIC_TYPE_DURATION",
|
|
17
|
+
Percentage = "METRIC_TYPE_PERCENTAGE"
|
|
18
18
|
}
|
|
19
19
|
export interface MetricTypeConfig {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: MetricTypeType;
|
|
23
|
-
}
|
|
24
|
-
export interface MetricType extends MetricTypeConfig {
|
|
25
|
-
formatter: Function;
|
|
26
|
-
biggerIsBetter: boolean;
|
|
27
|
-
}
|
|
28
|
-
export declare enum MetricRunInfoDeltaType {
|
|
29
|
-
'HIGH_NEGATIVE' = "HIGH_NEGATIVE",
|
|
30
|
-
'NEGATIVE' = "NEGATIVE",
|
|
31
|
-
'LOW_NEGATIVE' = "LOW_NEGATIVE",
|
|
32
|
-
'NO_CHANGE' = "NO_CHANGE",
|
|
33
|
-
'LOW_POSITIVE' = "LOW_POSITIVE",
|
|
34
|
-
'POSITIVE' = "POSITIVE",
|
|
35
|
-
'HIGH_POSITIVE' = "HIGH_POSITIVE"
|
|
20
|
+
biggerIsBetter?: boolean | null;
|
|
21
|
+
formatter: (value: number | null) => string;
|
|
36
22
|
}
|
|
23
|
+
export interface MetricConfig {
|
|
24
|
+
label: string;
|
|
25
|
+
type: MetricTypes;
|
|
26
|
+
description?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
biggerIsBetter?: MetricTypeConfig['biggerIsBetter'];
|
|
29
|
+
skipDelta?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type Metric = MetricTypeConfig & MetricConfig;
|
|
32
|
+
export declare enum DeltaType {
|
|
33
|
+
HIGH_NEGATIVE = "HIGH_NEGATIVE",
|
|
34
|
+
NEGATIVE = "NEGATIVE",
|
|
35
|
+
LOW_NEGATIVE = "LOW_NEGATIVE",
|
|
36
|
+
NO_CHANGE = "NO_CHANGE",
|
|
37
|
+
CHANGE = "CHANGE",
|
|
38
|
+
LOW_POSITIVE = "LOW_POSITIVE",
|
|
39
|
+
POSITIVE = "POSITIVE",
|
|
40
|
+
HIGH_POSITIVE = "HIGH_POSITIVE"
|
|
41
|
+
}
|
|
42
|
+
export type MetricRunInfoDeltaType = `${DeltaType}`;
|
|
37
43
|
export interface MetricRun {
|
|
38
44
|
value: number;
|
|
39
45
|
}
|
|
40
|
-
export interface
|
|
46
|
+
export interface MetricRunDelta {
|
|
47
|
+
delta: number;
|
|
48
|
+
deltaPercentage: number;
|
|
49
|
+
}
|
|
50
|
+
export interface MetricRunInfoBaseline {
|
|
41
51
|
value: number;
|
|
42
52
|
displayValue: string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
}
|
|
54
|
+
export interface MetricRunInfo extends MetricRunInfoBaseline {
|
|
55
|
+
delta: number;
|
|
56
|
+
deltaPercentage: number;
|
|
57
|
+
deltaType: MetricRunInfoDeltaType;
|
|
58
|
+
displayDelta: string;
|
|
59
|
+
displayDeltaPercentage: string;
|
|
60
|
+
regression?: boolean | null;
|
|
48
61
|
}
|
|
49
62
|
export type JobSection<T = object> = Record<Source, T>;
|
|
50
63
|
export declare enum JobSectionId {
|
|
@@ -54,6 +67,15 @@ export declare enum JobSectionId {
|
|
|
54
67
|
metrics = "metrics",
|
|
55
68
|
rawData = "rawData"
|
|
56
69
|
}
|
|
70
|
+
export interface WebpackChunk {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
}
|
|
74
|
+
export interface JobMeta {
|
|
75
|
+
[Source.webpack]: {
|
|
76
|
+
chunks?: Array<WebpackChunk>;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
57
79
|
export interface JobSummaryItem {
|
|
58
80
|
baseline: number;
|
|
59
81
|
current: number;
|
|
@@ -66,6 +88,7 @@ export interface JobInsight<T = object> {
|
|
|
66
88
|
}
|
|
67
89
|
export interface JobInsightAssetsSizeTotalData {
|
|
68
90
|
md: string;
|
|
91
|
+
text: string;
|
|
69
92
|
info: MetricRunInfo;
|
|
70
93
|
}
|
|
71
94
|
export type JobInsightDuplicatePackagesData = Record<string, Array<string>>;
|
|
@@ -92,7 +115,7 @@ export interface JobInsightsInfo {
|
|
|
92
115
|
export type JobMetricsSource = Record<string, MetricRun | Record<string, MetricRun>>;
|
|
93
116
|
export type JobMetrics = JobSection<JobMetricsSource>;
|
|
94
117
|
export interface JobData {
|
|
95
|
-
[JobSectionId.meta]?:
|
|
118
|
+
[JobSectionId.meta]?: JobMeta;
|
|
96
119
|
[JobSectionId.insights]?: JobInsights;
|
|
97
120
|
[JobSectionId.summary]?: JobSummary;
|
|
98
121
|
[JobSectionId.metrics]?: JobMetrics;
|
package/types/i18n.d.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
let COMPONENT_LINK_TOTALS: string;
|
|
3
|
+
let COMPONENT_LINK_BUNDLE_ASSET_DETAILS: string;
|
|
4
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_JS: string;
|
|
5
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_CSS: string;
|
|
6
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_CACHE_INVALIDATION: string;
|
|
7
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_COUNT: string;
|
|
8
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_CHUNK_COUNT: string;
|
|
9
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_CHUNKS: string;
|
|
10
|
+
let COMPONENT_LINK_MODULES: string;
|
|
11
|
+
let COMPONENT_LINK_MODULES_DUPLICATE: string;
|
|
12
|
+
function COMPONENT_LINK_MODULES_BY_FILE_TYPE(fileType: any): string;
|
|
13
|
+
function COMPONENT_LINK_MODULES_BY_SOURCE(source: any): string;
|
|
14
|
+
let COMPONENT_LINK_CHUNK_MODULES: string;
|
|
15
|
+
let COMPONENT_LINK_PACKAGES_COUNT: string;
|
|
16
|
+
let COMPONENT_LINK_PACKAGES_CHANGED: string;
|
|
17
|
+
let COMPONENT_LINK_PACKAGES_DUPLICATE: string;
|
|
18
|
+
let COMPONENT_LINK_PACKAGES_DUPLICATE_CHANGED: string;
|
|
19
|
+
let COMPONENT_LINK_VIEW_PACKAGE: string;
|
|
16
20
|
function COMPONENT_LINK_BUNDLE_ASSETS_BY_FILE_TYPE({ label }: {
|
|
17
21
|
label: any;
|
|
18
22
|
}): string;
|
|
23
|
+
function COMPONENT_LINK_BUNDLE_ASSETS_BY_ENTRY_TYPE(assetType: any): string;
|
|
19
24
|
}
|
|
20
25
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function compare(jobs: any): import("
|
|
1
|
+
export function compare(jobs: any): import("..").ReportMetricRow[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function filter(source: Object): import(
|
|
1
|
+
export function filter(source: Object): import("../constants").LighthouseSource;
|
|
@@ -1,65 +1,73 @@
|
|
|
1
1
|
export namespace metrics {
|
|
2
2
|
namespace score {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
let label: string;
|
|
4
|
+
let type: MetricTypes;
|
|
5
5
|
}
|
|
6
6
|
namespace performanceScore {
|
|
7
|
-
|
|
7
|
+
let label_1: string;
|
|
8
8
|
export { label_1 as label };
|
|
9
|
-
|
|
9
|
+
let type_1: MetricTypes;
|
|
10
|
+
export { type_1 as type };
|
|
10
11
|
}
|
|
11
12
|
namespace accessibilityScore {
|
|
12
|
-
|
|
13
|
+
let label_2: string;
|
|
13
14
|
export { label_2 as label };
|
|
14
|
-
|
|
15
|
+
let type_2: MetricTypes;
|
|
16
|
+
export { type_2 as type };
|
|
15
17
|
}
|
|
16
18
|
namespace bestPracticesScore {
|
|
17
|
-
|
|
19
|
+
let label_3: string;
|
|
18
20
|
export { label_3 as label };
|
|
19
|
-
|
|
21
|
+
let type_3: MetricTypes;
|
|
22
|
+
export { type_3 as type };
|
|
20
23
|
}
|
|
21
24
|
namespace seoScore {
|
|
22
|
-
|
|
25
|
+
let label_4: string;
|
|
23
26
|
export { label_4 as label };
|
|
24
|
-
|
|
27
|
+
let type_4: MetricTypes;
|
|
28
|
+
export { type_4 as type };
|
|
25
29
|
}
|
|
26
30
|
namespace pwaScore {
|
|
27
|
-
|
|
31
|
+
let label_5: string;
|
|
28
32
|
export { label_5 as label };
|
|
29
|
-
|
|
33
|
+
let type_5: MetricTypes;
|
|
34
|
+
export { type_5 as type };
|
|
30
35
|
}
|
|
31
36
|
namespace speedIndex {
|
|
32
|
-
|
|
37
|
+
let label_6: string;
|
|
33
38
|
export { label_6 as label };
|
|
34
|
-
|
|
39
|
+
let type_6: MetricTypes;
|
|
40
|
+
export { type_6 as type };
|
|
35
41
|
}
|
|
36
42
|
namespace firstMeaningfulPaint {
|
|
37
|
-
|
|
43
|
+
let label_7: string;
|
|
38
44
|
export { label_7 as label };
|
|
39
|
-
|
|
45
|
+
let type_7: MetricTypes;
|
|
46
|
+
export { type_7 as type };
|
|
40
47
|
}
|
|
41
48
|
namespace timeToFirstByte {
|
|
42
|
-
|
|
49
|
+
let label_8: string;
|
|
43
50
|
export { label_8 as label };
|
|
44
|
-
|
|
51
|
+
let type_8: MetricTypes;
|
|
52
|
+
export { type_8 as type };
|
|
45
53
|
}
|
|
46
54
|
namespace firstInteractive {
|
|
47
|
-
|
|
55
|
+
let label_9: string;
|
|
48
56
|
export { label_9 as label };
|
|
49
|
-
|
|
57
|
+
let type_9: MetricTypes;
|
|
58
|
+
export { type_9 as type };
|
|
50
59
|
}
|
|
51
60
|
namespace totalByteWeight {
|
|
52
|
-
|
|
61
|
+
let label_10: string;
|
|
53
62
|
export { label_10 as label };
|
|
54
|
-
|
|
63
|
+
let type_10: MetricTypes;
|
|
64
|
+
export { type_10 as type };
|
|
55
65
|
}
|
|
56
66
|
namespace domSize {
|
|
57
|
-
|
|
67
|
+
let label_11: string;
|
|
58
68
|
export { label_11 as label };
|
|
59
|
-
|
|
69
|
+
let type_11: MetricTypes;
|
|
70
|
+
export { type_11 as type };
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
|
-
import {
|
|
63
|
-
import { METRIC_TYPE_DURATION } from "../config/metrics";
|
|
64
|
-
import { METRIC_TYPE_FILE_SIZE } from "../config/metrics";
|
|
65
|
-
import { METRIC_TYPE_NUMERIC } from "../config/metrics";
|
|
73
|
+
import { MetricTypes } from '../constants';
|
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
import * as types from './types';
|
|
2
|
-
export declare const getAddRowMetricData: (metricType?: string) => (row: types.ReportRow) =>
|
|
3
|
-
biggerIsBetter: any;
|
|
4
|
-
label: any;
|
|
5
|
-
changed: boolean;
|
|
6
|
-
runs: ({
|
|
7
|
-
value: number;
|
|
8
|
-
displayValue: string;
|
|
9
|
-
delta?: number | undefined;
|
|
10
|
-
deltaPercentage?: number | undefined;
|
|
11
|
-
deltaType?: import("..").MetricRunInfoDeltaType | undefined;
|
|
12
|
-
displayDelta?: string | undefined;
|
|
13
|
-
displayDeltaPercentage?: string | undefined;
|
|
14
|
-
name?: string | undefined;
|
|
15
|
-
} | null)[];
|
|
16
|
-
key: string;
|
|
17
|
-
};
|
|
2
|
+
export declare const getAddRowMetricData: (metricType?: string) => (row: types.ReportRow) => types.ReportMetricRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as types from './types';
|
|
2
|
-
export declare const compareMetrics: (jobs: Array<any>, selectMetrics: (job: any) => any, metricType
|
|
2
|
+
export declare const compareMetrics: (jobs: Array<any>, selectMetrics: (job: any) => any, metricType?: string, rowTransformers?: Array<types.MetricReportRowTransformFn>) => Array<types.ReportMetricRow>;
|
package/types/report/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as types from './types';
|
|
2
2
|
type RunMetrics = Record<string, types.MetricValue>;
|
|
3
|
-
export declare const mergeMetricsByKey: (runs: Array<RunMetrics>, rowTransformers?:
|
|
3
|
+
export declare const mergeMetricsByKey: (runs: Array<RunMetrics>, rowTransformers?: Array<types.MetricReportRowTransformFn>) => Array<types.ReportRow>;
|
|
4
4
|
export {};
|
package/types/report/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MetricRunInfo, MetricRunInfoBaseline, MetricTypeConfig } from '../constants';
|
|
1
2
|
export interface MetricValue {
|
|
2
3
|
value: number;
|
|
3
4
|
name?: string;
|
|
@@ -6,3 +7,14 @@ export interface ReportRow {
|
|
|
6
7
|
key: string;
|
|
7
8
|
runs: Array<MetricValue | null>;
|
|
8
9
|
}
|
|
10
|
+
export type ReportMetricRun = {
|
|
11
|
+
name?: MetricValue['name'];
|
|
12
|
+
} & (MetricRunInfo | MetricRunInfoBaseline);
|
|
13
|
+
export interface ReportMetricRow {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
biggerIsBetter: MetricTypeConfig['biggerIsBetter'];
|
|
17
|
+
changed: boolean;
|
|
18
|
+
runs: Array<ReportMetricRun | null>;
|
|
19
|
+
}
|
|
20
|
+
export type MetricReportRowTransformFn = (row: ReportRow) => ReportMetricRow;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { QueryParamConfig } from 'serialize-query-params';
|
|
2
|
+
import { COMPONENT } from '../config/component-links';
|
|
3
|
+
export type ComponentLinkFilters = Record<string, boolean | string>;
|
|
2
4
|
export interface ComponentLinkParams {
|
|
3
5
|
search?: string;
|
|
4
|
-
|
|
6
|
+
entryId?: string;
|
|
7
|
+
metric?: string;
|
|
8
|
+
filters?: ComponentLinkFilters;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
direction?: string;
|
|
5
11
|
}
|
|
6
12
|
export interface ComponentLink {
|
|
7
13
|
title: string;
|
|
@@ -21,21 +27,31 @@ export declare const BUNDLE_ASSETS_INITIAL_CSS: ComponentLink;
|
|
|
21
27
|
export declare const BUNDLE_ASSETS_CACHE_INVALIDATION: ComponentLink;
|
|
22
28
|
export declare const BUNDLE_ASSETS_COUNT: ComponentLink;
|
|
23
29
|
export declare const BUNDLE_ASSETS_CHUNK_COUNT: ComponentLink;
|
|
30
|
+
export declare const getBundleAsset: (entryId: string) => ComponentLink;
|
|
31
|
+
export declare const getBundleAssetsByEntryType: (assetType: "entry" | "initial" | "chunk") => ComponentLink;
|
|
32
|
+
export declare const getBundleAssetsFileTypeComponentLink: (fileType: string, label?: string) => ComponentLink;
|
|
33
|
+
export declare const getBundleAssetsByChunk: (chunkIds: Array<string>, chunkId: string) => ComponentLink;
|
|
24
34
|
export declare const BUNDLE_MODULES: ComponentLink;
|
|
25
35
|
export declare const BUNDLE_MODULES_DUPLICATE: ComponentLink;
|
|
26
36
|
export declare const getBundleModulesBySearch: (search: string) => ComponentLink;
|
|
27
37
|
export declare const getBundleModulesByChunk: (chunkIds: Array<string>, chunkId: string, fileType?: string) => ComponentLink;
|
|
38
|
+
export declare const getBundleModulesByFileTpe: (fileType: string, fileTypeLabel?: string) => ComponentLink;
|
|
39
|
+
export declare const getBundleModulesBySource: (thirdParty: boolean, label?: string) => ComponentLink;
|
|
28
40
|
export declare const BUNDLE_PACKAGES_COUNT: ComponentLink;
|
|
29
41
|
export declare const BUNDLE_PACKAGES_CHANGED: ComponentLink;
|
|
30
42
|
export declare const BUNDLE_PACKAGES_DUPLICATE: ComponentLink;
|
|
31
43
|
export declare const BUNDLE_PACKAGES_DUPLICATE_CHANGED: ComponentLink;
|
|
32
|
-
export declare const getBundleAssetsFileTypeComponentLink: (fileType: string, label: string) => ComponentLink;
|
|
33
44
|
export declare const getBundlePackagesByNameComponentLink: (search: string) => ComponentLink;
|
|
34
|
-
export declare const
|
|
45
|
+
export declare const ComponentStateParam: QueryParamConfig<any, any>;
|
|
46
|
+
export declare const COMPONENT_STATE_META: {
|
|
47
|
+
readonly [COMPONENT.BUNDLE_ASSETS]: QueryParamConfig<any, any>;
|
|
48
|
+
readonly [COMPONENT.BUNDLE_MODULES]: QueryParamConfig<any, any>;
|
|
49
|
+
readonly [COMPONENT.BUNDLE_PACKAGES]: QueryParamConfig<any, any>;
|
|
50
|
+
};
|
|
51
|
+
type ComponentStateQueryStringParams = Record<string, ComponentLinkParams>;
|
|
52
|
+
export declare const getComponentStateQueryString: (params?: ComponentStateQueryStringParams) => string;
|
|
53
|
+
export declare const getComponentStateData: (queryString: string) => ComponentStateQueryStringParams;
|
|
35
54
|
export declare const METRIC_COMPONENT_LINKS: Map<string, {
|
|
36
55
|
link: ComponentLink;
|
|
37
|
-
showDelta?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
link: ComponentLink;
|
|
40
|
-
showDelta: boolean;
|
|
41
56
|
}>;
|
|
57
|
+
export {};
|
package/types/utils/delta.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export function formatDelta(value: number, formatter: Function): string;
|
|
6
|
-
export function getDeltaType(deltaValue: number, biggerIsBetter: boolean): string;
|
|
1
|
+
import type { MetricRun, MetricRunDelta, MetricRunInfoDeltaType, MetricTypeConfig } from '../constants';
|
|
2
|
+
export declare function getDelta(baseline?: MetricRun | null, current?: MetricRun | null): MetricRunDelta;
|
|
3
|
+
export declare function formatDelta(value: number, formatter: MetricTypeConfig['formatter']): string;
|
|
4
|
+
export declare function getDeltaType(deltaPercentageValue: number, biggerIsBetter?: MetricTypeConfig['biggerIsBetter']): MetricRunInfoDeltaType;
|
package/types/utils/metrics.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export function
|
|
1
|
+
import { MetricRunInfo, MetricRunInfoBaseline, Metric, MetricTypes, MetricTypeConfig } from '../constants';
|
|
2
|
+
export declare function createGetMetricType(metrics: Record<string, unknown>): (key: string, type?: MetricTypes) => Metric;
|
|
3
|
+
export declare function getGlobalMetricType(key: string, type?: MetricTypes): Metric;
|
|
4
|
+
export declare function getMetricRunInfo(metricType: MetricTypeConfig, current: number, baseline?: number): MetricRunInfo | MetricRunInfoBaseline;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare
|
|
12
|
-
declare function compareModules(jobs: Object[], rowTransformers?: Function[] | undefined): Object[];
|
|
13
|
-
declare function comparePackages(jobs: Object[], rowTransformers?: Function[] | undefined): Object[];
|
|
14
|
-
export {};
|
|
1
|
+
import { MetricReportRowTransformFn } from '../report/types';
|
|
2
|
+
export declare const compareModuleDuplicateSize: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
3
|
+
export declare const compareModuleTotalSize: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
4
|
+
export declare const compareBySection: {
|
|
5
|
+
stats: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
6
|
+
sizes: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
7
|
+
assets: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
8
|
+
modules: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
9
|
+
packages: (jobs: Array<unknown>, rowTransformers?: Array<MetricReportRowTransformFn>) => import("..").ReportMetricRow[];
|
|
10
|
+
};
|
|
11
|
+
export declare const compare: (jobs: Array<unknown>) => {};
|
|
@@ -5,9 +5,9 @@ export function extractAssetsSizeTotalInsight(_: any, currentExtractedData: any,
|
|
|
5
5
|
data: {
|
|
6
6
|
text: string;
|
|
7
7
|
md: string;
|
|
8
|
-
info: import("
|
|
8
|
+
info: import("../..").MetricRunInfoBaseline | import("../..").MetricRunInfo;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
import { InsightType } from
|
|
13
|
+
import { InsightType } from '../../constants';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Job, JobInsight, JobInsightDuplicatePackagesV3Data, JobInsights, MetricRun } from '../../constants';
|
|
2
2
|
interface ModulesPackagesDuplicateData {
|
|
3
|
-
insights
|
|
3
|
+
insights?: {
|
|
4
4
|
duplicatePackages?: JobInsights['webpack']['duplicatePackages'];
|
|
5
|
-
duplicatePackagesV3
|
|
5
|
+
duplicatePackagesV3?: JobInsights['webpack']['duplicatePackagesV3'];
|
|
6
6
|
};
|
|
7
7
|
metrics: {
|
|
8
8
|
duplicatePackagesCount: MetricRun;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
export declare const getDuplicatePackagesInsight: (duplicatePackagesMap: Record<string, Array<string>>, baselineDuplicatePackagesMap?: Record<string, Array<string>>) => JobInsight<JobInsightDuplicatePackagesV3Data
|
|
11
|
+
export declare const getDuplicatePackagesInsight: (duplicatePackagesMap: Record<string, Array<string>>, baselineDuplicatePackagesMap?: Record<string, Array<string>>) => JobInsight<JobInsightDuplicatePackagesV3Data> | null;
|
|
12
12
|
export declare const extractModulesPackagesDuplicate: (_: any, currentExtractedData: any, baselineJob?: Job) => ModulesPackagesDuplicateData;
|
|
13
13
|
export {};
|