@bundle-stats/utils 3.4.0-alpha.1 → 3.4.0-alpha.5
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/CHANGELOG.md +0 -20
- package/lib/config/component-links.js +1 -0
- package/lib/config/component-links.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/i18n.js +2 -1
- package/lib/i18n.js.map +1 -1
- package/lib/utils/component-links.js +15 -1
- package/lib/utils/component-links.js.map +1 -1
- package/lib/webpack/constants.js +2 -0
- package/lib/webpack/constants.js.map +1 -1
- package/lib/webpack/extract/modules.js +29 -2
- package/lib/webpack/extract/modules.js.map +1 -1
- package/lib/webpack/metrics.js +14 -0
- package/lib/webpack/metrics.js.map +1 -1
- package/lib-esm/config/component-links.js +1 -0
- package/lib-esm/config/component-links.js.map +1 -1
- package/lib-esm/constants.js.map +1 -1
- package/lib-esm/i18n.js +2 -1
- package/lib-esm/i18n.js.map +1 -1
- package/lib-esm/utils/component-links.js +14 -0
- package/lib-esm/utils/component-links.js.map +1 -1
- package/lib-esm/webpack/constants.js +2 -0
- package/lib-esm/webpack/constants.js.map +1 -1
- package/lib-esm/webpack/extract/modules.js +29 -2
- package/lib-esm/webpack/extract/modules.js.map +1 -1
- package/lib-esm/webpack/metrics.js +14 -0
- package/lib-esm/webpack/metrics.js.map +1 -1
- package/package.json +7 -7
- package/src/config/component-links.js +1 -0
- package/src/constants.ts +3 -0
- package/src/i18n.js +2 -1
- package/src/utils/component-links.js +23 -7
- package/src/webpack/constants.ts +38 -28
- package/src/webpack/extract/modules.ts +35 -4
- package/src/webpack/metrics.ts +14 -0
- package/types/browsertime/compare.d.ts +1 -0
- package/types/browsertime/constants.d.ts +1 -0
- package/types/browsertime/extract.d.ts +6 -0
- package/types/browsertime/filter.d.ts +1 -0
- package/types/browsertime/index.d.ts +6 -0
- package/types/browsertime/metrics.d.ts +107 -0
- package/types/browsertime/selectors.d.ts +1 -0
- package/types/config/component-links.d.ts +35 -0
- package/types/config/delta.d.ts +9 -0
- package/types/config/file-types.d.ts +45 -0
- package/types/config/index.d.ts +11 -0
- package/types/config/insights.d.ts +4 -0
- package/types/config/metrics.d.ts +35 -0
- package/types/constants.d.ts +165 -0
- package/types/i18n.d.ts +16 -0
- package/types/index.d.ts +7 -0
- package/types/jobs/create-job.d.ts +1 -0
- package/types/jobs/create-jobs.d.ts +1 -0
- package/types/jobs/create-summary.d.ts +1 -0
- package/types/jobs/index.d.ts +2 -0
- package/types/lighthouse/compare.d.ts +1 -0
- package/types/lighthouse/constants.d.ts +1 -0
- package/types/lighthouse/extract/audits.d.ts +6 -0
- package/types/lighthouse/extract/category-scores.d.ts +6 -0
- package/types/lighthouse/extract/index.d.ts +1 -0
- package/types/lighthouse/extract/score-category-scores.d.ts +10 -0
- package/types/lighthouse/filter.d.ts +1 -0
- package/types/lighthouse/index.d.ts +6 -0
- package/types/lighthouse/metrics.d.ts +65 -0
- package/types/lighthouse/selectors.d.ts +1 -0
- package/types/polyfills.d.ts +1 -0
- package/types/report/add-row-metric-data.d.ts +8 -0
- package/types/report/compare-metrics.d.ts +2 -0
- package/types/report/create.d.ts +14 -0
- package/types/report/get-metric-changed.d.ts +2 -0
- package/types/report/index.d.ts +5 -0
- package/types/report/merge-metrics-by-key.d.ts +4 -0
- package/types/report/types.d.ts +8 -0
- package/types/transformers/budgets-insights.d.ts +36 -0
- package/types/transformers/index.d.ts +1 -0
- package/types/utils/component-links.d.ts +193 -0
- package/types/utils/date.d.ts +2 -0
- package/types/utils/delta.d.ts +6 -0
- package/types/utils/file-types.d.ts +4 -0
- package/types/utils/format.d.ts +5 -0
- package/types/utils/index.d.ts +6 -0
- package/types/utils/metrics.d.ts +3 -0
- package/types/webpack/compare.d.ts +14 -0
- package/types/webpack/constants.d.ts +33 -0
- package/types/webpack/extract/assets-cache-invalidation.d.ts +7 -0
- package/types/webpack/extract/assets-chunk-count.d.ts +7 -0
- package/types/webpack/extract/assets-count.d.ts +7 -0
- package/types/webpack/extract/assets-size-total-insight.d.ts +12 -0
- package/types/webpack/extract/assets-size.d.ts +11 -0
- package/types/webpack/extract/assets.d.ts +8 -0
- package/types/webpack/extract/index.d.ts +1 -0
- package/types/webpack/extract/meta.d.ts +6 -0
- package/types/webpack/extract/modules-count.d.ts +7 -0
- package/types/webpack/extract/modules-packages-count.d.ts +7 -0
- package/types/webpack/extract/modules-packages-duplicate.d.ts +21 -0
- package/types/webpack/extract/modules-packages.d.ts +7 -0
- package/types/webpack/extract/modules.d.ts +2 -0
- package/types/webpack/index.d.ts +8 -0
- package/types/webpack/metrics.d.ts +116 -0
- package/types/webpack/selectors.d.ts +41 -0
- package/types/webpack/utils.d.ts +8 -0
|
@@ -45,13 +45,14 @@ export const getModuleSourceTypeFilters = (value = true) => ({
|
|
|
45
45
|
[`${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.THIRD_PARTY}`]: value,
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
export const getModuleChunkFilters = (chunkIds, value) =>
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
export const getModuleChunkFilters = (chunkIds, value) =>
|
|
49
|
+
chunkIds.reduce(
|
|
50
|
+
(agg, chunkId) => ({
|
|
51
|
+
...agg,
|
|
52
|
+
[`${MODULE_CHUNK}.${chunkId}`]: value,
|
|
53
|
+
}),
|
|
54
|
+
{},
|
|
55
|
+
);
|
|
55
56
|
|
|
56
57
|
export const getModuleFileTypeFilters = (value = true) =>
|
|
57
58
|
MODULE_SOURCE_FILE_TYPES.reduce(
|
|
@@ -148,6 +149,19 @@ export const BUNDLE_MODULES = {
|
|
|
148
149
|
},
|
|
149
150
|
};
|
|
150
151
|
|
|
152
|
+
export const BUNDLE_MODULES_DUPLICATE = {
|
|
153
|
+
section: SECTIONS.MODULES,
|
|
154
|
+
title: I18N.COMPONENT_LINK_MODULES_DUPLICATE,
|
|
155
|
+
params: {
|
|
156
|
+
[COMPONENT.BUNDLE_MODULES]: {
|
|
157
|
+
filters: {
|
|
158
|
+
[MODULE_FILTERS.CHANGED]: false,
|
|
159
|
+
[MODULE_FILTERS.DUPLICATED]: true,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
151
165
|
export const getBundleModulesBySearch = (search) => ({
|
|
152
166
|
section: SECTIONS.MODULES,
|
|
153
167
|
title: I18N.COMPONENT_LINK_MODULES,
|
|
@@ -257,6 +271,8 @@ export const METRIC_COMPONENT_LINKS = new Map([
|
|
|
257
271
|
['webpack.assetCount', { link: BUNDLE_ASSETS_COUNT }],
|
|
258
272
|
['webpack.chunkCount', { link: BUNDLE_ASSETS_CHUNK_COUNT }],
|
|
259
273
|
['webpack.moduleCount', { link: BUNDLE_MODULES }],
|
|
274
|
+
['webpack.duplicateModulesCount', { link: BUNDLE_MODULES_DUPLICATE }],
|
|
275
|
+
['webpack.duplicateCode', { link: BUNDLE_MODULES_DUPLICATE }],
|
|
260
276
|
['webpack.packageCount', { link: BUNLDE_PACKAGES_COUNT }],
|
|
261
277
|
['webpack.duplicatePackagesCount', { link: BUNDLE_PACKAGES_DUPLICATE }],
|
|
262
278
|
]);
|
package/src/webpack/constants.ts
CHANGED
|
@@ -18,6 +18,8 @@ export enum MetricId {
|
|
|
18
18
|
TotalInitialSizeCSS = 'totalInitialSizeCSS',
|
|
19
19
|
CacheInvalidation = 'cacheInvalidation',
|
|
20
20
|
ModuleName = 'moduleCount',
|
|
21
|
+
DuplicateModulesCount = 'duplicateModulesCount',
|
|
22
|
+
DuplicateCode = 'duplicateCode',
|
|
21
23
|
ChunkCount = 'chunkCount',
|
|
22
24
|
AssetCount = 'assetCount',
|
|
23
25
|
PackageCount = 'packageCount',
|
|
@@ -45,12 +47,13 @@ const VERSION = /@[\w|\-|_|.]+/;
|
|
|
45
47
|
|
|
46
48
|
// Extract package paths from module path
|
|
47
49
|
// https://regex101.com/r/22Leep/6
|
|
48
|
-
/* eslint-disable prettier/prettier
|
|
49
|
-
export const MODULE_PATH_PACKAGES = new RegExp(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
/* eslint-disable prettier/prettier */
|
|
51
|
+
export const MODULE_PATH_PACKAGES = new RegExp(
|
|
52
|
+
[
|
|
53
|
+
// match dependency directory (eg: `node_modules/`, `node_modules/.pnpm/`)
|
|
54
|
+
`(?:${PACKAGE_PREFIX.source}/)`,
|
|
55
|
+
// match package name
|
|
56
|
+
'(?:',
|
|
54
57
|
// match `@organization/` or `@organization+`(pnpm)
|
|
55
58
|
`(?:@${PACKAGE_SLUG.source}[/|+])?`,
|
|
56
59
|
// match github.com+organization+
|
|
@@ -59,38 +62,45 @@ export const MODULE_PATH_PACKAGES = new RegExp([
|
|
|
59
62
|
`(?:${PACKAGE_SLUG.source})`,
|
|
60
63
|
// match version
|
|
61
64
|
`(?:${VERSION.source})?`,
|
|
62
|
-
|
|
65
|
+
')',
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
// Match pnpm peer dependencies (eg: package-a@version_package-b@version)
|
|
68
|
+
'(?:_',
|
|
66
69
|
`(?:@${PACKAGE_SLUG.source}[/|+])?`,
|
|
67
70
|
`(?:${PACKAGE_SLUG.source})`,
|
|
68
71
|
`(?:@${PACKAGE_SLUG.source})?`,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
].join(''),
|
|
72
|
+
')*',
|
|
73
|
+
'/',
|
|
74
|
+
].join(''),
|
|
75
|
+
'g',
|
|
76
|
+
);
|
|
77
|
+
/* eslint-enable prettier/prettier */
|
|
72
78
|
|
|
73
79
|
// Extract package name from package path
|
|
74
80
|
// https://regex101.com/r/tTlU0W/6
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
/* eslint-disable prettier/prettier */
|
|
82
|
+
export const PACKAGE_PATH_NAME = new RegExp(
|
|
83
|
+
[
|
|
84
|
+
`(?:${PACKAGE_PREFIX.source}/)`,
|
|
85
|
+
// match dependency
|
|
86
|
+
'(?:',
|
|
79
87
|
'(',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
`(?:@${PACKAGE_SLUG.source}[/|+])?`,
|
|
89
|
+
`(?:(?:${PACKAGE_SLUG.source}\\+)*)`,
|
|
90
|
+
`(?:${PACKAGE_SLUG.source})`,
|
|
83
91
|
')',
|
|
84
92
|
`(?:${VERSION.source})?`,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
')',
|
|
94
|
+
// match peer dependency
|
|
95
|
+
'(?:_',
|
|
88
96
|
'(',
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
`(?:@${PACKAGE_SLUG.source}[/|+])?`,
|
|
98
|
+
`(?:${PACKAGE_SLUG.source})`,
|
|
91
99
|
')',
|
|
92
100
|
`(?:@${PACKAGE_SLUG.source})`,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
].join(''),
|
|
96
|
-
|
|
101
|
+
')*',
|
|
102
|
+
'/',
|
|
103
|
+
].join(''),
|
|
104
|
+
'g',
|
|
105
|
+
);
|
|
106
|
+
/* eslint-enable prettier/prettier */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
|
+
import round from 'lodash/round';
|
|
2
3
|
|
|
3
4
|
import { ModuleMetric, WebpackMetricsModules } from '../../constants';
|
|
4
5
|
import { getModuleName, normalizeChunkId } from '../utils';
|
|
@@ -10,7 +11,7 @@ interface WebpackModule {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
interface WebpackModuleWithConcatenatedModules extends WebpackModule {
|
|
13
|
-
modules
|
|
14
|
+
modules: Array<Pick<WebpackModule, 'name' | 'size'>>;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/*
|
|
@@ -20,7 +21,13 @@ export const extractModules = (webpackStats?: any): WebpackMetricsModules => {
|
|
|
20
21
|
const modulesSource: Array<WebpackModuleWithConcatenatedModules> = webpackStats?.modules || [];
|
|
21
22
|
|
|
22
23
|
if (!modulesSource) {
|
|
23
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
metrics: {
|
|
26
|
+
duplicateCode: { value: 0 },
|
|
27
|
+
duplicateModulesCount: { value: 0 },
|
|
28
|
+
modules: {},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
// Flatten concatenated modules
|
|
@@ -43,25 +50,49 @@ export const extractModules = (webpackStats?: any): WebpackMetricsModules => {
|
|
|
43
50
|
return agg;
|
|
44
51
|
}, [] as Array<WebpackModule>);
|
|
45
52
|
|
|
53
|
+
let totalCodeSize = 0;
|
|
54
|
+
let duplicateCodeSize = 0;
|
|
55
|
+
let duplicateModulesCount = 0;
|
|
56
|
+
|
|
46
57
|
// Normalize module entries
|
|
47
58
|
const modules = allModules.reduce((agg, moduleEntry) => {
|
|
48
59
|
const { name, size, chunks } = moduleEntry;
|
|
49
60
|
const normalizedName = getModuleName(name);
|
|
50
61
|
|
|
51
|
-
// skip modules
|
|
62
|
+
// skip modules that do not belong to any chunk
|
|
52
63
|
if (isEmpty(chunks)) {
|
|
53
64
|
return agg;
|
|
54
65
|
}
|
|
55
66
|
|
|
67
|
+
const instances = chunks.length;
|
|
68
|
+
const duplicateInstances = instances - 1;
|
|
69
|
+
|
|
70
|
+
duplicateModulesCount += duplicateInstances;
|
|
71
|
+
duplicateCodeSize += duplicateInstances * size;
|
|
72
|
+
totalCodeSize += instances * size;
|
|
73
|
+
|
|
56
74
|
// eslint-disable-next-line no-param-reassign
|
|
57
75
|
agg[normalizedName] = {
|
|
58
76
|
name,
|
|
59
77
|
value: size,
|
|
60
78
|
chunkIds: chunks.map(normalizeChunkId),
|
|
79
|
+
duplicated: Boolean(duplicateInstances),
|
|
61
80
|
};
|
|
62
81
|
|
|
63
82
|
return agg;
|
|
64
83
|
}, {} as Record<string, ModuleMetric>);
|
|
65
84
|
|
|
66
|
-
|
|
85
|
+
const duplicateCode = totalCodeSize ? round((duplicateCodeSize / totalCodeSize) * 100, 2) : 0;
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
metrics: {
|
|
89
|
+
modules,
|
|
90
|
+
duplicateCode: {
|
|
91
|
+
value: duplicateCode,
|
|
92
|
+
},
|
|
93
|
+
duplicateModulesCount: {
|
|
94
|
+
value: duplicateModulesCount,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
67
98
|
};
|
package/src/webpack/metrics.ts
CHANGED
|
@@ -55,6 +55,20 @@ export const metrics = {
|
|
|
55
55
|
type: METRIC_TYPE_NUMERIC,
|
|
56
56
|
biggerIsBetter: false,
|
|
57
57
|
},
|
|
58
|
+
[MetricId.DuplicateModulesCount]: {
|
|
59
|
+
label: 'Duplicate Modules',
|
|
60
|
+
description: 'Total number of modules that belong to more than one chunk.',
|
|
61
|
+
url: 'https://relative-ci.com/documentation/metrics-and-data#modules-1',
|
|
62
|
+
type: METRIC_TYPE_NUMERIC,
|
|
63
|
+
biggerIsBetter: false,
|
|
64
|
+
},
|
|
65
|
+
[MetricId.DuplicateCode]: {
|
|
66
|
+
label: 'Duplicate Code',
|
|
67
|
+
description: 'The percentage of total duplicate module size from the total module size.',
|
|
68
|
+
url: 'https://relative-ci.com/documentation/metrics-and-data#modules-1',
|
|
69
|
+
type: METRIC_TYPE_PERCENTAGE,
|
|
70
|
+
biggerIsBetter: false,
|
|
71
|
+
},
|
|
58
72
|
[MetricId.PackageCount]: {
|
|
59
73
|
label: 'Packages',
|
|
60
74
|
description: 'Total number of packages bundled by webpack.',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function compare(jobs: any): import("../report/types").ReportRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SUMMARY_METRIC_PATHS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function filter(browsertimeSource: Object): any;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export namespace metrics {
|
|
2
|
+
namespace firstPaint {
|
|
3
|
+
export const label: string;
|
|
4
|
+
export { METRIC_TYPE_DURATION as type };
|
|
5
|
+
}
|
|
6
|
+
namespace fullyLoaded {
|
|
7
|
+
const label_1: string;
|
|
8
|
+
export { label_1 as label };
|
|
9
|
+
export { METRIC_TYPE_DURATION as type };
|
|
10
|
+
}
|
|
11
|
+
namespace backEndTime {
|
|
12
|
+
const label_2: string;
|
|
13
|
+
export { label_2 as label };
|
|
14
|
+
export { METRIC_TYPE_DURATION as type };
|
|
15
|
+
}
|
|
16
|
+
namespace domContentLoadedTime {
|
|
17
|
+
const label_3: string;
|
|
18
|
+
export { label_3 as label };
|
|
19
|
+
export { METRIC_TYPE_DURATION as type };
|
|
20
|
+
}
|
|
21
|
+
namespace domInteractiveTime {
|
|
22
|
+
const label_4: string;
|
|
23
|
+
export { label_4 as label };
|
|
24
|
+
export { METRIC_TYPE_DURATION as type };
|
|
25
|
+
}
|
|
26
|
+
namespace domainLookupTime {
|
|
27
|
+
const label_5: string;
|
|
28
|
+
export { label_5 as label };
|
|
29
|
+
export { METRIC_TYPE_DURATION as type };
|
|
30
|
+
}
|
|
31
|
+
namespace frontEndTime {
|
|
32
|
+
const label_6: string;
|
|
33
|
+
export { label_6 as label };
|
|
34
|
+
export { METRIC_TYPE_DURATION as type };
|
|
35
|
+
}
|
|
36
|
+
namespace pageDownloadTime {
|
|
37
|
+
const label_7: string;
|
|
38
|
+
export { label_7 as label };
|
|
39
|
+
export { METRIC_TYPE_DURATION as type };
|
|
40
|
+
}
|
|
41
|
+
namespace pageLoadTime {
|
|
42
|
+
const label_8: string;
|
|
43
|
+
export { label_8 as label };
|
|
44
|
+
export { METRIC_TYPE_DURATION as type };
|
|
45
|
+
}
|
|
46
|
+
namespace redirectionTime {
|
|
47
|
+
const label_9: string;
|
|
48
|
+
export { label_9 as label };
|
|
49
|
+
export { METRIC_TYPE_DURATION as type };
|
|
50
|
+
}
|
|
51
|
+
namespace serverConnectionTime {
|
|
52
|
+
const label_10: string;
|
|
53
|
+
export { label_10 as label };
|
|
54
|
+
export { METRIC_TYPE_DURATION as type };
|
|
55
|
+
}
|
|
56
|
+
namespace serverResponseTime {
|
|
57
|
+
const label_11: string;
|
|
58
|
+
export { label_11 as label };
|
|
59
|
+
export { METRIC_TYPE_DURATION as type };
|
|
60
|
+
}
|
|
61
|
+
namespace firstContentfulPaint {
|
|
62
|
+
const label_12: string;
|
|
63
|
+
export { label_12 as label };
|
|
64
|
+
export { METRIC_TYPE_DURATION as type };
|
|
65
|
+
}
|
|
66
|
+
namespace rumSpeedIndex {
|
|
67
|
+
const label_13: string;
|
|
68
|
+
export { label_13 as label };
|
|
69
|
+
export { METRIC_TYPE_DURATION as type };
|
|
70
|
+
}
|
|
71
|
+
namespace firstVisualChange {
|
|
72
|
+
const label_14: string;
|
|
73
|
+
export { label_14 as label };
|
|
74
|
+
export { METRIC_TYPE_DURATION as type };
|
|
75
|
+
}
|
|
76
|
+
namespace lastVisualChange {
|
|
77
|
+
const label_15: string;
|
|
78
|
+
export { label_15 as label };
|
|
79
|
+
export { METRIC_TYPE_DURATION as type };
|
|
80
|
+
}
|
|
81
|
+
namespace perceptualSpeedIndex {
|
|
82
|
+
const label_16: string;
|
|
83
|
+
export { label_16 as label };
|
|
84
|
+
export { METRIC_TYPE_DURATION as type };
|
|
85
|
+
}
|
|
86
|
+
namespace speedIndex {
|
|
87
|
+
const label_17: string;
|
|
88
|
+
export { label_17 as label };
|
|
89
|
+
export { METRIC_TYPE_DURATION as type };
|
|
90
|
+
}
|
|
91
|
+
namespace visualComplete85 {
|
|
92
|
+
const label_18: string;
|
|
93
|
+
export { label_18 as label };
|
|
94
|
+
export { METRIC_TYPE_DURATION as type };
|
|
95
|
+
}
|
|
96
|
+
namespace visualComplete95 {
|
|
97
|
+
const label_19: string;
|
|
98
|
+
export { label_19 as label };
|
|
99
|
+
export { METRIC_TYPE_DURATION as type };
|
|
100
|
+
}
|
|
101
|
+
namespace visualComplete99 {
|
|
102
|
+
const label_20: string;
|
|
103
|
+
export { label_20 as label };
|
|
104
|
+
export { METRIC_TYPE_DURATION as type };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
import { METRIC_TYPE_DURATION } from "../config/metrics";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function selectors(job: any): {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const ASSET_ENTRY_TYPE: "et";
|
|
2
|
+
export const ASSET_FILE_TYPE: "ft";
|
|
3
|
+
export const MODULE_CHUNK: "c";
|
|
4
|
+
export const MODULE_FILE_TYPE: "mft";
|
|
5
|
+
export const MODULE_SOURCE_TYPE: "mst";
|
|
6
|
+
export namespace ASSET_FILTERS {
|
|
7
|
+
const ASSET: string;
|
|
8
|
+
const CHANGED: string;
|
|
9
|
+
const ENTRY: string;
|
|
10
|
+
const INITIAL: string;
|
|
11
|
+
const CHUNK: string;
|
|
12
|
+
}
|
|
13
|
+
export namespace MODULE_FILTERS {
|
|
14
|
+
const CHANGED_1: string;
|
|
15
|
+
export { CHANGED_1 as CHANGED };
|
|
16
|
+
export const DUPLICATED: string;
|
|
17
|
+
export const FIRST_PARTY: string;
|
|
18
|
+
export const THIRD_PARTY: string;
|
|
19
|
+
}
|
|
20
|
+
export namespace PACKAGE_FILTERS {
|
|
21
|
+
const CHANGED_2: string;
|
|
22
|
+
export { CHANGED_2 as CHANGED };
|
|
23
|
+
export const DUPLICATE: string;
|
|
24
|
+
}
|
|
25
|
+
export namespace SECTIONS {
|
|
26
|
+
const TOTALS: string;
|
|
27
|
+
const ASSETS: string;
|
|
28
|
+
const MODULES: string;
|
|
29
|
+
const PACKAGES: string;
|
|
30
|
+
}
|
|
31
|
+
export namespace COMPONENT {
|
|
32
|
+
const BUNDLE_ASSETS: string;
|
|
33
|
+
const BUNDLE_MODULES: string;
|
|
34
|
+
const BUNDLE_PACKAGES: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const DELTA_TYPE_NEGATIVE: "NEGATIVE";
|
|
2
|
+
export const DELTA_TYPE_NO_CHANGE: "NO_CHANGE";
|
|
3
|
+
export const DELTA_TYPE_POSITIVE: "POSITIVE";
|
|
4
|
+
export const DELTA_TYPE_LEVEL_LOW: "LOW";
|
|
5
|
+
export const DELTA_TYPE_LEVEL_HIGH: "HIGH";
|
|
6
|
+
export const DELTA_TYPE_LOW_NEGATIVE: string;
|
|
7
|
+
export const DELTA_TYPE_HIGH_NEGATIVE: string;
|
|
8
|
+
export const DELTA_TYPE_LOW_POSITIVE: string;
|
|
9
|
+
export const DELTA_TYPE_HIGH_POSITIVE: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const FILE_TYPE_CSS: "CSS";
|
|
2
|
+
export const FILE_TYPE_JS: "JS";
|
|
3
|
+
export const FILE_TYPE_IMG: "IMG";
|
|
4
|
+
export const FILE_TYPE_MEDIA: "MEDIA";
|
|
5
|
+
export const FILE_TYPE_FONT: "FONT";
|
|
6
|
+
export const FILE_TYPE_HTML: "HTML";
|
|
7
|
+
export const FILE_TYPE_OTHER: "OTHER";
|
|
8
|
+
export namespace FILE_TYPE_PATTERNS {
|
|
9
|
+
const CSS: RegExp;
|
|
10
|
+
const JS: RegExp;
|
|
11
|
+
const IMG: RegExp;
|
|
12
|
+
const MEDIA: RegExp;
|
|
13
|
+
const FONT: RegExp;
|
|
14
|
+
const HTML: RegExp;
|
|
15
|
+
}
|
|
16
|
+
export namespace FILE_TYPE_LABELS {
|
|
17
|
+
const CSS_1: string;
|
|
18
|
+
export { CSS_1 as CSS };
|
|
19
|
+
const JS_1: string;
|
|
20
|
+
export { JS_1 as JS };
|
|
21
|
+
const IMG_1: string;
|
|
22
|
+
export { IMG_1 as IMG };
|
|
23
|
+
const MEDIA_1: string;
|
|
24
|
+
export { MEDIA_1 as MEDIA };
|
|
25
|
+
const FONT_1: string;
|
|
26
|
+
export { FONT_1 as FONT };
|
|
27
|
+
const HTML_1: string;
|
|
28
|
+
export { HTML_1 as HTML };
|
|
29
|
+
export const OTHER: string;
|
|
30
|
+
}
|
|
31
|
+
export const FILE_TYPES: string[];
|
|
32
|
+
export namespace MODULE_SOURCE_PATTERNS {
|
|
33
|
+
const CSS_2: RegExp;
|
|
34
|
+
export { CSS_2 as CSS };
|
|
35
|
+
const JS_2: RegExp;
|
|
36
|
+
export { JS_2 as JS };
|
|
37
|
+
}
|
|
38
|
+
export const MODULE_SOURCE_FILE_TYPES: string[];
|
|
39
|
+
export namespace MODULE_DESTINATION_PATTERNS {
|
|
40
|
+
const CSS_3: RegExp;
|
|
41
|
+
export { CSS_3 as CSS };
|
|
42
|
+
const JS_3: RegExp;
|
|
43
|
+
export { JS_3 as JS };
|
|
44
|
+
}
|
|
45
|
+
export const MODULE_DESTINATION_FILE_TYPES: string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./component-links";
|
|
2
|
+
export * from "./file-types";
|
|
3
|
+
export * from "./insights";
|
|
4
|
+
export * from "./metrics";
|
|
5
|
+
export * from "./delta";
|
|
6
|
+
export const PACKAGES_SEPARATOR: ":";
|
|
7
|
+
export const PACKAGE_ID_SEPARATOR: "~";
|
|
8
|
+
export const SOURCE_PATH_WEBPACK_STATS: "webpack";
|
|
9
|
+
export const SOURCE_PATH_LIGHTHOUSE: "lighthouse";
|
|
10
|
+
export const SOURCE_PATH_BROWSERTIME: "browsertime";
|
|
11
|
+
export const SOURCE_PATHS: string[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const METRIC_TYPE_FILE_SIZE: "METRIC_TYPE_FILE_SIZE";
|
|
2
|
+
export const METRIC_TYPE_DURATION: "METRIC_TYPE_DURATION";
|
|
3
|
+
export const METRIC_TYPE_NUMERIC: "METRIC_TYPE_NUMERIC";
|
|
4
|
+
export const METRIC_TYPE_SCORE: "METRIC_TYPE_SCORE";
|
|
5
|
+
export const METRIC_TYPE_PERCENTAGE: "METRIC_TYPE_PERCENTAGE";
|
|
6
|
+
export namespace METRIC_TYPES {
|
|
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";
|