@bundle-stats/utils 4.4.0-beta.1 → 4.4.0-beta.3
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/config/component-links.js +5 -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/metrics.js.map +1 -1
- package/lib/constants.js +5 -5
- package/lib/constants.js.map +1 -1
- package/lib/i18n.js +5 -0
- package/lib/i18n.js.map +1 -1
- package/lib/utils/component-links.js +78 -14
- package/lib/utils/component-links.js.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/insights.js +54 -0
- package/lib/utils/insights.js.map +1 -0
- package/lib/webpack/extract/modules-packages-duplicate.js +21 -9
- package/lib/webpack/extract/modules-packages-duplicate.js.map +1 -1
- package/lib/webpack/extract/modules.js +45 -22
- package/lib/webpack/extract/modules.js.map +1 -1
- package/lib/webpack/metrics.js +5 -5
- package/lib/webpack/metrics.js.map +1 -1
- package/lib/webpack/types.js +1 -1
- package/lib/webpack/types.js.map +1 -1
- package/lib-esm/config/component-links.js +4 -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/metrics.js +1 -1
- package/lib-esm/config/metrics.js.map +1 -1
- package/lib-esm/i18n.js +5 -0
- package/lib-esm/i18n.js.map +1 -1
- package/lib-esm/utils/component-links.js +72 -12
- package/lib-esm/utils/component-links.js.map +1 -1
- package/lib-esm/utils/index.js +1 -0
- package/lib-esm/utils/index.js.map +1 -1
- package/lib-esm/utils/insights.js +47 -0
- package/lib-esm/utils/insights.js.map +1 -0
- package/lib-esm/webpack/extract/modules-packages-duplicate.js +21 -9
- package/lib-esm/webpack/extract/modules-packages-duplicate.js.map +1 -1
- package/lib-esm/webpack/extract/modules.js +45 -23
- package/lib-esm/webpack/extract/modules.js.map +1 -1
- package/lib-esm/webpack/metrics.js +5 -5
- package/lib-esm/webpack/metrics.js.map +1 -1
- package/package.json +13 -13
- package/src/config/component-links.js +5 -0
- package/src/config/file-types.js +3 -3
- package/src/config/metrics.js +2 -6
- package/src/constants.ts +5 -0
- package/src/i18n.js +5 -0
- package/src/utils/component-links.ts +88 -15
- package/src/utils/index.js +1 -0
- package/src/utils/insights.ts +82 -0
- package/src/webpack/extract/modules-packages-duplicate.ts +31 -16
- package/src/webpack/extract/modules.ts +60 -33
- package/src/webpack/metrics.js +5 -5
- package/src/webpack/types.ts +1 -2
- package/types/browsertime/metrics.d.ts +22 -22
- package/types/config/component-links.d.ts +24 -18
- package/types/config/file-types.d.ts +17 -17
- package/types/config/metrics.d.ts +1 -30
- package/types/constants.d.ts +4 -0
- package/types/i18n.d.ts +17 -12
- package/types/lighthouse/metrics.d.ts +16 -16
- package/types/utils/component-links.d.ts +8 -2
- package/types/utils/index.d.ts +1 -0
- package/types/utils/insights.d.ts +9 -0
- package/types/webpack/constants.d.ts +1 -1
- package/types/webpack/extract/assets-size-total-insight.d.ts +1 -1
- package/types/webpack/extract/modules-packages-duplicate.d.ts +3 -3
- package/types/webpack/metrics.d.ts +51 -51
- package/types/webpack/types.d.ts +1 -2
- package/tsconfig.lib.json +0 -7
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import round from 'lodash/round';
|
|
2
|
-
import
|
|
2
|
+
import union from 'lodash/union';
|
|
3
|
+
import { WebpackStatsFiltered, WebpackStatsFilteredModule } from '@bundle-stats/plugin-webpack-filter';
|
|
3
4
|
|
|
4
5
|
import { Module, MetricsModules } from '../types';
|
|
5
6
|
import { getModuleName, normalizeChunkId } from '../utils';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
|
-
* Extract webpack modules
|
|
9
|
+
* Extract webpack modules metrics and stats
|
|
9
10
|
*/
|
|
10
11
|
export const extractModules = (webpackStats?: WebpackStatsFiltered): MetricsModules => {
|
|
11
12
|
const modulesSource = webpackStats?.modules;
|
|
@@ -22,60 +23,86 @@ export const extractModules = (webpackStats?: WebpackStatsFiltered): MetricsModu
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
// Flatten concatenated modules
|
|
25
|
-
const
|
|
26
|
-
if (!moduleEntry.modules) {
|
|
27
|
-
agg.push(moduleEntry);
|
|
26
|
+
const modulesByName: Map<string, WebpackStatsFilteredModule> = new Map();
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
modulesSource.forEach((rootModule) => {
|
|
29
|
+
// skip modules that do not belong to any chunk
|
|
30
|
+
if (!rootModule.chunks || rootModule.chunks.length === 0) {
|
|
31
|
+
return;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
// flatten concatenated modules
|
|
35
|
+
if (rootModule.modules) {
|
|
36
|
+
rootModule.modules.forEach((concatenatedModule) => {
|
|
37
|
+
const concatenatedModuleName = getModuleName(concatenatedModule.name);
|
|
38
|
+
const existingModule = modulesByName.get(concatenatedModuleName);
|
|
39
|
+
|
|
40
|
+
// Merge if the module is already available
|
|
41
|
+
// webpack adds a module entry for every concatenated module
|
|
42
|
+
if (existingModule) {
|
|
43
|
+
modulesByName.set(concatenatedModuleName, {
|
|
44
|
+
...existingModule,
|
|
45
|
+
chunks: union(existingModule.chunks, rootModule.chunks),
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
modulesByName.set(concatenatedModuleName, {
|
|
49
|
+
...concatenatedModule,
|
|
50
|
+
chunks: rootModule.chunks,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const normalizedName = getModuleName(rootModule.name);
|
|
59
|
+
const savedRootModule = modulesByName.get(normalizedName);
|
|
60
|
+
|
|
61
|
+
// Merge module data
|
|
62
|
+
// @NOTE some webpack plugins (mini-css-extract-plugin) might add a root module entry
|
|
63
|
+
// even if thee module was already concantenated in another module
|
|
64
|
+
if (savedRootModule) {
|
|
65
|
+
modulesByName.set(normalizedName, {
|
|
66
|
+
...savedRootModule,
|
|
67
|
+
chunks: union(savedRootModule.chunks, rootModule.chunks),
|
|
68
|
+
size: rootModule.size,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
40
73
|
|
|
41
|
-
|
|
42
|
-
}
|
|
74
|
+
modulesByName.set(normalizedName, rootModule);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// Normalize module entries and extract metrics
|
|
78
|
+
const modules: Record<string, Module> = {};
|
|
43
79
|
|
|
44
80
|
let moduleCount = 0;
|
|
45
81
|
let totalCodeSize = 0;
|
|
46
82
|
let duplicateCodeSize = 0;
|
|
47
83
|
let duplicateModulesCount = 0;
|
|
48
84
|
|
|
49
|
-
|
|
50
|
-
const modules = allModules.reduce((agg, moduleEntry) => {
|
|
85
|
+
modulesByName.forEach((moduleEntry, normalizedName) => {
|
|
51
86
|
const { name, size = 0, chunks } = moduleEntry;
|
|
52
|
-
const normalizedName = getModuleName(name);
|
|
53
|
-
|
|
54
|
-
// skip modules that are orphane(do not belong to any chunk)
|
|
55
|
-
if (!chunks || chunks?.length === 0) {
|
|
56
|
-
return agg;
|
|
57
|
-
}
|
|
58
87
|
|
|
59
88
|
const instances = chunks.length;
|
|
60
89
|
const duplicateInstances = instances - 1;
|
|
90
|
+
const duplicated = duplicateInstances > 0;
|
|
61
91
|
|
|
62
92
|
moduleCount += instances;
|
|
63
|
-
duplicateModulesCount += duplicateInstances;
|
|
64
|
-
duplicateCodeSize += duplicateInstances * size;
|
|
65
93
|
totalCodeSize += instances * size;
|
|
66
94
|
|
|
67
|
-
|
|
95
|
+
if (duplicated) {
|
|
96
|
+
duplicateModulesCount += duplicateInstances;
|
|
97
|
+
duplicateCodeSize += duplicateInstances * size;
|
|
98
|
+
}
|
|
68
99
|
|
|
69
|
-
|
|
70
|
-
agg[normalizedName] = {
|
|
100
|
+
modules[normalizedName] = {
|
|
71
101
|
name,
|
|
72
102
|
value: size,
|
|
73
103
|
chunkIds: chunks.map(normalizeChunkId),
|
|
74
|
-
duplicated
|
|
75
|
-
...(reasons && { reasons }),
|
|
104
|
+
...(duplicated && { duplicated }),
|
|
76
105
|
};
|
|
77
|
-
|
|
78
|
-
return agg;
|
|
79
106
|
}, {} as Record<string, Module>);
|
|
80
107
|
|
|
81
108
|
const duplicateCode = totalCodeSize ? round((duplicateCodeSize / totalCodeSize) * 100, 2) : 0;
|
package/src/webpack/metrics.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Metric } from './types';
|
|
|
9
9
|
export const metrics = {
|
|
10
10
|
[Metric.BUNDLE_SIZE]: {
|
|
11
11
|
label: 'Bundle Size',
|
|
12
|
-
description: 'The total size of the assets
|
|
12
|
+
description: 'The total size of the assets processed by the bundler',
|
|
13
13
|
url: 'https://relative-ci.com/documentation/metrics-and-data#assets',
|
|
14
14
|
type: METRIC_TYPE_FILE_SIZE,
|
|
15
15
|
},
|
|
@@ -48,14 +48,14 @@ export const metrics = {
|
|
|
48
48
|
},
|
|
49
49
|
[Metric.MODULE_COUNT]: {
|
|
50
50
|
label: 'Modules',
|
|
51
|
-
description: 'The total number of
|
|
51
|
+
description: 'The total number of bundled modules',
|
|
52
52
|
url: 'https://relative-ci.com/documentation/metrics-and-data#modules-1',
|
|
53
53
|
type: METRIC_TYPE_NUMERIC,
|
|
54
54
|
biggerIsBetter: false,
|
|
55
55
|
},
|
|
56
56
|
[Metric.DUPLICATE_MODULES_COUNT]: {
|
|
57
57
|
label: 'Duplicate Modules',
|
|
58
|
-
description: 'The total number of
|
|
58
|
+
description: 'The total number of module instances bundled into multiple chunks',
|
|
59
59
|
url: 'https://relative-ci.com/documentation/metrics-and-data#modules-1',
|
|
60
60
|
type: METRIC_TYPE_NUMERIC,
|
|
61
61
|
biggerIsBetter: false,
|
|
@@ -69,14 +69,14 @@ export const metrics = {
|
|
|
69
69
|
},
|
|
70
70
|
[Metric.PACKAGE_COUNT]: {
|
|
71
71
|
label: 'Packages',
|
|
72
|
-
description: 'The total number of
|
|
72
|
+
description: 'The total number of bundled packages',
|
|
73
73
|
url: 'https://relative-ci.com/documentation/metrics-and-data#packages',
|
|
74
74
|
type: METRIC_TYPE_NUMERIC,
|
|
75
75
|
biggerIsBetter: false,
|
|
76
76
|
},
|
|
77
77
|
[Metric.DUPLICATE_PACKAGES_COUNT]: {
|
|
78
78
|
label: 'Duplicate Packages',
|
|
79
|
-
description: 'The total number of duplicate
|
|
79
|
+
description: 'The total number of bundled duplicate package instances',
|
|
80
80
|
url: 'https://relative-ci.com/documentation/metrics-and-data#packages',
|
|
81
81
|
type: METRIC_TYPE_NUMERIC,
|
|
82
82
|
biggerIsBetter: false,
|
package/src/webpack/types.ts
CHANGED
|
@@ -51,8 +51,7 @@ export interface MetricsAssets {
|
|
|
51
51
|
export interface Module extends MetricRun {
|
|
52
52
|
name: string;
|
|
53
53
|
chunkIds: Array<string>;
|
|
54
|
-
duplicated
|
|
55
|
-
reasons?: Array<string>;
|
|
54
|
+
duplicated?: boolean;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
export type Modules = Record<string, Module>;
|
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
export namespace metrics {
|
|
2
2
|
namespace firstPaint {
|
|
3
|
-
export
|
|
3
|
+
export let label: string;
|
|
4
4
|
export { METRIC_TYPE_DURATION as type };
|
|
5
5
|
}
|
|
6
6
|
namespace fullyLoaded {
|
|
7
|
-
|
|
7
|
+
let label_1: string;
|
|
8
8
|
export { label_1 as label };
|
|
9
9
|
export { METRIC_TYPE_DURATION as type };
|
|
10
10
|
}
|
|
11
11
|
namespace backEndTime {
|
|
12
|
-
|
|
12
|
+
let label_2: string;
|
|
13
13
|
export { label_2 as label };
|
|
14
14
|
export { METRIC_TYPE_DURATION as type };
|
|
15
15
|
}
|
|
16
16
|
namespace domContentLoadedTime {
|
|
17
|
-
|
|
17
|
+
let label_3: string;
|
|
18
18
|
export { label_3 as label };
|
|
19
19
|
export { METRIC_TYPE_DURATION as type };
|
|
20
20
|
}
|
|
21
21
|
namespace domInteractiveTime {
|
|
22
|
-
|
|
22
|
+
let label_4: string;
|
|
23
23
|
export { label_4 as label };
|
|
24
24
|
export { METRIC_TYPE_DURATION as type };
|
|
25
25
|
}
|
|
26
26
|
namespace domainLookupTime {
|
|
27
|
-
|
|
27
|
+
let label_5: string;
|
|
28
28
|
export { label_5 as label };
|
|
29
29
|
export { METRIC_TYPE_DURATION as type };
|
|
30
30
|
}
|
|
31
31
|
namespace frontEndTime {
|
|
32
|
-
|
|
32
|
+
let label_6: string;
|
|
33
33
|
export { label_6 as label };
|
|
34
34
|
export { METRIC_TYPE_DURATION as type };
|
|
35
35
|
}
|
|
36
36
|
namespace pageDownloadTime {
|
|
37
|
-
|
|
37
|
+
let label_7: string;
|
|
38
38
|
export { label_7 as label };
|
|
39
39
|
export { METRIC_TYPE_DURATION as type };
|
|
40
40
|
}
|
|
41
41
|
namespace pageLoadTime {
|
|
42
|
-
|
|
42
|
+
let label_8: string;
|
|
43
43
|
export { label_8 as label };
|
|
44
44
|
export { METRIC_TYPE_DURATION as type };
|
|
45
45
|
}
|
|
46
46
|
namespace redirectionTime {
|
|
47
|
-
|
|
47
|
+
let label_9: string;
|
|
48
48
|
export { label_9 as label };
|
|
49
49
|
export { METRIC_TYPE_DURATION as type };
|
|
50
50
|
}
|
|
51
51
|
namespace serverConnectionTime {
|
|
52
|
-
|
|
52
|
+
let label_10: string;
|
|
53
53
|
export { label_10 as label };
|
|
54
54
|
export { METRIC_TYPE_DURATION as type };
|
|
55
55
|
}
|
|
56
56
|
namespace serverResponseTime {
|
|
57
|
-
|
|
57
|
+
let label_11: string;
|
|
58
58
|
export { label_11 as label };
|
|
59
59
|
export { METRIC_TYPE_DURATION as type };
|
|
60
60
|
}
|
|
61
61
|
namespace firstContentfulPaint {
|
|
62
|
-
|
|
62
|
+
let label_12: string;
|
|
63
63
|
export { label_12 as label };
|
|
64
64
|
export { METRIC_TYPE_DURATION as type };
|
|
65
65
|
}
|
|
66
66
|
namespace rumSpeedIndex {
|
|
67
|
-
|
|
67
|
+
let label_13: string;
|
|
68
68
|
export { label_13 as label };
|
|
69
69
|
export { METRIC_TYPE_DURATION as type };
|
|
70
70
|
}
|
|
71
71
|
namespace firstVisualChange {
|
|
72
|
-
|
|
72
|
+
let label_14: string;
|
|
73
73
|
export { label_14 as label };
|
|
74
74
|
export { METRIC_TYPE_DURATION as type };
|
|
75
75
|
}
|
|
76
76
|
namespace lastVisualChange {
|
|
77
|
-
|
|
77
|
+
let label_15: string;
|
|
78
78
|
export { label_15 as label };
|
|
79
79
|
export { METRIC_TYPE_DURATION as type };
|
|
80
80
|
}
|
|
81
81
|
namespace perceptualSpeedIndex {
|
|
82
|
-
|
|
82
|
+
let label_16: string;
|
|
83
83
|
export { label_16 as label };
|
|
84
84
|
export { METRIC_TYPE_DURATION as type };
|
|
85
85
|
}
|
|
86
86
|
namespace speedIndex {
|
|
87
|
-
|
|
87
|
+
let label_17: string;
|
|
88
88
|
export { label_17 as label };
|
|
89
89
|
export { METRIC_TYPE_DURATION as type };
|
|
90
90
|
}
|
|
91
91
|
namespace visualComplete85 {
|
|
92
|
-
|
|
92
|
+
let label_18: string;
|
|
93
93
|
export { label_18 as label };
|
|
94
94
|
export { METRIC_TYPE_DURATION as type };
|
|
95
95
|
}
|
|
96
96
|
namespace visualComplete95 {
|
|
97
|
-
|
|
97
|
+
let label_19: string;
|
|
98
98
|
export { label_19 as label };
|
|
99
99
|
export { METRIC_TYPE_DURATION as type };
|
|
100
100
|
}
|
|
101
101
|
namespace visualComplete99 {
|
|
102
|
-
|
|
102
|
+
let label_20: string;
|
|
103
103
|
export { label_20 as label };
|
|
104
104
|
export { METRIC_TYPE_DURATION as type };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
import { METRIC_TYPE_DURATION } from
|
|
107
|
+
import { METRIC_TYPE_DURATION } from '../config/metrics';
|
|
@@ -4,32 +4,38 @@ export const MODULE_CHUNK: "c";
|
|
|
4
4
|
export const MODULE_FILE_TYPE: "mft";
|
|
5
5
|
export const MODULE_SOURCE_TYPE: "mst";
|
|
6
6
|
export namespace ASSET_FILTERS {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
let OTHER: string;
|
|
8
|
+
let CHANGED: string;
|
|
9
|
+
let ENTRY: string;
|
|
10
|
+
let INITIAL: string;
|
|
11
|
+
let CHUNK: string;
|
|
12
12
|
}
|
|
13
13
|
export namespace MODULE_FILTERS {
|
|
14
|
-
|
|
14
|
+
let CHANGED_1: string;
|
|
15
15
|
export { CHANGED_1 as CHANGED };
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export let DUPLICATED: string;
|
|
17
|
+
export let FIRST_PARTY: string;
|
|
18
|
+
export let THIRD_PARTY: string;
|
|
19
19
|
}
|
|
20
20
|
export namespace PACKAGE_FILTERS {
|
|
21
|
-
|
|
21
|
+
let CHANGED_2: string;
|
|
22
22
|
export { CHANGED_2 as CHANGED };
|
|
23
|
-
export
|
|
23
|
+
export let DUPLICATE: string;
|
|
24
24
|
}
|
|
25
25
|
export namespace SECTIONS {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
let TOTALS: string;
|
|
27
|
+
let ASSETS: string;
|
|
28
|
+
let MODULES: string;
|
|
29
|
+
let PACKAGES: string;
|
|
30
30
|
}
|
|
31
31
|
export namespace COMPONENT {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let BUNDLE_ASSETS: string;
|
|
33
|
+
let BUNDLE_MODULES: string;
|
|
34
|
+
let BUNDLE_PACKAGES: string;
|
|
35
|
+
}
|
|
36
|
+
export namespace MODULE_SOURCE_TYPE_LABELS {
|
|
37
|
+
let FIRST_PARTY_1: string;
|
|
38
|
+
export { FIRST_PARTY_1 as FIRST_PARTY };
|
|
39
|
+
let THIRD_PARTY_1: string;
|
|
40
|
+
export { THIRD_PARTY_1 as THIRD_PARTY };
|
|
35
41
|
}
|
|
@@ -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[];
|
|
@@ -3,33 +3,4 @@ export const METRIC_TYPE_DURATION: "METRIC_TYPE_DURATION";
|
|
|
3
3
|
export const METRIC_TYPE_NUMERIC: "METRIC_TYPE_NUMERIC";
|
|
4
4
|
export const METRIC_TYPE_SCORE: "METRIC_TYPE_SCORE";
|
|
5
5
|
export const METRIC_TYPE_PERCENTAGE: "METRIC_TYPE_PERCENTAGE";
|
|
6
|
-
export
|
|
7
|
-
namespace METRIC_TYPE_NUMERIC {
|
|
8
|
-
export const biggerIsBetter: boolean;
|
|
9
|
-
export { formatNumber as formatter };
|
|
10
|
-
}
|
|
11
|
-
namespace METRIC_TYPE_SCORE {
|
|
12
|
-
const biggerIsBetter_1: boolean;
|
|
13
|
-
export { biggerIsBetter_1 as biggerIsBetter };
|
|
14
|
-
export { formatNumber as formatter };
|
|
15
|
-
}
|
|
16
|
-
namespace METRIC_TYPE_DURATION {
|
|
17
|
-
const biggerIsBetter_2: boolean;
|
|
18
|
-
export { biggerIsBetter_2 as biggerIsBetter };
|
|
19
|
-
export { formatDuration as formatter };
|
|
20
|
-
}
|
|
21
|
-
namespace METRIC_TYPE_FILE_SIZE {
|
|
22
|
-
const biggerIsBetter_3: boolean;
|
|
23
|
-
export { biggerIsBetter_3 as biggerIsBetter };
|
|
24
|
-
export { formatFileSize as formatter };
|
|
25
|
-
}
|
|
26
|
-
namespace METRIC_TYPE_PERCENTAGE {
|
|
27
|
-
const biggerIsBetter_4: boolean;
|
|
28
|
-
export { biggerIsBetter_4 as biggerIsBetter };
|
|
29
|
-
export { formatPercentage as formatter };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
import { formatNumber } from "../utils/format";
|
|
33
|
-
import { formatDuration } from "../utils/format";
|
|
34
|
-
import { formatFileSize } from "../utils/format";
|
|
35
|
-
import { formatPercentage } from "../utils/format";
|
|
6
|
+
export const METRIC_TYPES: Record<string, import('../constants').MetricType>;
|
package/types/constants.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export interface JobInsights {
|
|
|
85
85
|
newPackages?: JobInsight<JobInsightNewPackagesData>;
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
+
export interface JobInsightsInfo {
|
|
89
|
+
duplicatePackages?: JobInsights['webpack']['duplicatePackagesV3'];
|
|
90
|
+
newPackages?: JobInsights['webpack']['newPackages'];
|
|
91
|
+
}
|
|
88
92
|
export type JobMetricsSource = Record<string, MetricRun | Record<string, MetricRun>>;
|
|
89
93
|
export type JobMetrics = JobSection<JobMetricsSource>;
|
|
90
94
|
export interface JobData {
|
package/types/i18n.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
let COMPONENT_LINK_TOTALS: string;
|
|
3
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_JS: string;
|
|
4
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_CSS: string;
|
|
5
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_CACHE_INVALIDATION: string;
|
|
6
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_COUNT: string;
|
|
7
|
+
let COMPONENT_LINK_BUNDLE_ASSETS_CHUNK_COUNT: string;
|
|
8
|
+
let COMPONENT_LINK_MODULES: string;
|
|
9
|
+
let COMPONENT_LINK_MODULES_DUPLICATE: string;
|
|
10
|
+
function COMPONENT_LINK_MODULES_BY_FILE_TYPE(fileType: any): string;
|
|
11
|
+
function COMPONENT_LINK_MODULES_BY_SOURCE(source: any): string;
|
|
12
|
+
let COMPONENT_LINK_CHUNK_MODULES: string;
|
|
13
|
+
let COMPONENT_LINK_PACKAGES_COUNT: string;
|
|
14
|
+
let COMPONENT_LINK_PACKAGES_CHANGED: string;
|
|
15
|
+
let COMPONENT_LINK_PACKAGES_DUPLICATE: string;
|
|
16
|
+
let COMPONENT_LINK_PACKAGES_DUPLICATE_CHANGED: string;
|
|
17
|
+
let COMPONENT_LINK_VIEW_PACKAGE: string;
|
|
14
18
|
function COMPONENT_LINK_BUNDLE_ASSETS_BY_FILE_TYPE({ label }: {
|
|
15
19
|
label: any;
|
|
16
20
|
}): string;
|
|
21
|
+
function COMPONENT_LINK_BUNDLE_ASSETS_BY_ENTRY_TYPE(assetType: any): string;
|
|
17
22
|
}
|
|
18
23
|
export default _default;
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
export namespace metrics {
|
|
2
2
|
namespace score {
|
|
3
|
-
export
|
|
3
|
+
export let label: string;
|
|
4
4
|
export { METRIC_TYPE_SCORE as type };
|
|
5
5
|
}
|
|
6
6
|
namespace performanceScore {
|
|
7
|
-
|
|
7
|
+
let label_1: string;
|
|
8
8
|
export { label_1 as label };
|
|
9
9
|
export { METRIC_TYPE_SCORE as type };
|
|
10
10
|
}
|
|
11
11
|
namespace accessibilityScore {
|
|
12
|
-
|
|
12
|
+
let label_2: string;
|
|
13
13
|
export { label_2 as label };
|
|
14
14
|
export { METRIC_TYPE_SCORE as type };
|
|
15
15
|
}
|
|
16
16
|
namespace bestPracticesScore {
|
|
17
|
-
|
|
17
|
+
let label_3: string;
|
|
18
18
|
export { label_3 as label };
|
|
19
19
|
export { METRIC_TYPE_SCORE as type };
|
|
20
20
|
}
|
|
21
21
|
namespace seoScore {
|
|
22
|
-
|
|
22
|
+
let label_4: string;
|
|
23
23
|
export { label_4 as label };
|
|
24
24
|
export { METRIC_TYPE_SCORE as type };
|
|
25
25
|
}
|
|
26
26
|
namespace pwaScore {
|
|
27
|
-
|
|
27
|
+
let label_5: string;
|
|
28
28
|
export { label_5 as label };
|
|
29
29
|
export { METRIC_TYPE_SCORE as type };
|
|
30
30
|
}
|
|
31
31
|
namespace speedIndex {
|
|
32
|
-
|
|
32
|
+
let label_6: string;
|
|
33
33
|
export { label_6 as label };
|
|
34
34
|
export { METRIC_TYPE_DURATION as type };
|
|
35
35
|
}
|
|
36
36
|
namespace firstMeaningfulPaint {
|
|
37
|
-
|
|
37
|
+
let label_7: string;
|
|
38
38
|
export { label_7 as label };
|
|
39
39
|
export { METRIC_TYPE_DURATION as type };
|
|
40
40
|
}
|
|
41
41
|
namespace timeToFirstByte {
|
|
42
|
-
|
|
42
|
+
let label_8: string;
|
|
43
43
|
export { label_8 as label };
|
|
44
44
|
export { METRIC_TYPE_DURATION as type };
|
|
45
45
|
}
|
|
46
46
|
namespace firstInteractive {
|
|
47
|
-
|
|
47
|
+
let label_9: string;
|
|
48
48
|
export { label_9 as label };
|
|
49
49
|
export { METRIC_TYPE_DURATION as type };
|
|
50
50
|
}
|
|
51
51
|
namespace totalByteWeight {
|
|
52
|
-
|
|
52
|
+
let label_10: string;
|
|
53
53
|
export { label_10 as label };
|
|
54
54
|
export { METRIC_TYPE_FILE_SIZE as type };
|
|
55
55
|
}
|
|
56
56
|
namespace domSize {
|
|
57
|
-
|
|
57
|
+
let label_11: string;
|
|
58
58
|
export { label_11 as label };
|
|
59
59
|
export { METRIC_TYPE_NUMERIC as type };
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
import { METRIC_TYPE_SCORE } from
|
|
63
|
-
import { METRIC_TYPE_DURATION } from
|
|
64
|
-
import { METRIC_TYPE_FILE_SIZE } from
|
|
65
|
-
import { METRIC_TYPE_NUMERIC } from
|
|
62
|
+
import { METRIC_TYPE_SCORE } from '../config/metrics';
|
|
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';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type ComponentLinkFilters = Record<string, boolean>;
|
|
2
2
|
export interface ComponentLinkParams {
|
|
3
3
|
search?: string;
|
|
4
|
+
entryId?: string;
|
|
4
5
|
filters: ComponentLinkFilters;
|
|
5
6
|
}
|
|
6
7
|
export interface ComponentLink {
|
|
@@ -21,14 +22,19 @@ export declare const BUNDLE_ASSETS_INITIAL_CSS: ComponentLink;
|
|
|
21
22
|
export declare const BUNDLE_ASSETS_CACHE_INVALIDATION: ComponentLink;
|
|
22
23
|
export declare const BUNDLE_ASSETS_COUNT: ComponentLink;
|
|
23
24
|
export declare const BUNDLE_ASSETS_CHUNK_COUNT: ComponentLink;
|
|
25
|
+
export declare const getBundleAsset: (entryId: string) => ComponentLink;
|
|
26
|
+
export declare const getBundleAssetsByEntryType: (assetType: 'entry' | 'initial' | 'chunk') => ComponentLink;
|
|
27
|
+
export declare const getBundleAssetsFileTypeComponentLink: (fileType: string, label?: string) => ComponentLink;
|
|
24
28
|
export declare const BUNDLE_MODULES: ComponentLink;
|
|
25
29
|
export declare const BUNDLE_MODULES_DUPLICATE: ComponentLink;
|
|
26
30
|
export declare const getBundleModulesBySearch: (search: string) => ComponentLink;
|
|
27
31
|
export declare const getBundleModulesByChunk: (chunkIds: Array<string>, chunkId: string, fileType?: string) => ComponentLink;
|
|
32
|
+
export declare const getBundleModulesByFileTpe: (fileType: string, fileTypeLabel?: string) => ComponentLink;
|
|
33
|
+
export declare const getBundleModulesBySource: (thirdParty: boolean, label?: string) => ComponentLink;
|
|
28
34
|
export declare const BUNDLE_PACKAGES_COUNT: ComponentLink;
|
|
35
|
+
export declare const BUNDLE_PACKAGES_CHANGED: ComponentLink;
|
|
29
36
|
export declare const BUNDLE_PACKAGES_DUPLICATE: ComponentLink;
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const getBundleAssetsFileTypeComponentLink: (fileType: string, label: string) => ComponentLink;
|
|
37
|
+
export declare const BUNDLE_PACKAGES_DUPLICATE_CHANGED: ComponentLink;
|
|
32
38
|
export declare const getBundlePackagesByNameComponentLink: (search: string) => ComponentLink;
|
|
33
39
|
export declare const getComponentStateQueryString: (params?: {}) => string;
|
|
34
40
|
export declare const METRIC_COMPONENT_LINKS: Map<string, {
|
package/types/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JobInsight, JobInsightsInfo } from '../constants';
|
|
2
|
+
interface InsightListItem {
|
|
3
|
+
name: string;
|
|
4
|
+
insight: JobInsight;
|
|
5
|
+
link: any;
|
|
6
|
+
}
|
|
7
|
+
export declare const getInsightList: (insights: JobInsightsInfo) => Array<InsightListItem>;
|
|
8
|
+
export declare const getChangedInsights: (normalizedInsights: JobInsightsInfo) => JobInsightsInfo | null;
|
|
9
|
+
export {};
|