@bundle-stats/utils 3.4.0-alpha.3 → 3.4.0-beta.0
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/transformers/budgets-insights.js +100 -52
- package/lib/transformers/budgets-insights.js.map +1 -1
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/webpack/extract/assets.js +11 -7
- package/lib/webpack/extract/assets.js.map +1 -1
- package/lib/webpack/metrics.js +1 -1
- package/lib/webpack/metrics.js.map +1 -1
- package/lib-esm/transformers/budgets-insights.js +98 -49
- package/lib-esm/transformers/budgets-insights.js.map +1 -1
- package/lib-esm/types.js +2 -0
- package/lib-esm/types.js.map +1 -0
- package/lib-esm/webpack/extract/assets.js +11 -7
- package/lib-esm/webpack/extract/assets.js.map +1 -1
- package/lib-esm/webpack/metrics.js +1 -1
- package/lib-esm/webpack/metrics.js.map +1 -1
- package/package.json +12 -12
- package/src/transformers/budgets-insights.ts +144 -75
- package/src/types.ts +14 -0
- package/src/webpack/extract/{assets.js → assets.ts} +41 -12
- package/src/webpack/metrics.ts +1 -1
- 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 +34 -0
- package/types/transformers/index.d.ts +1 -0
- package/types/types.d.ts +9 -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 +11 -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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const SECTION_WEBPACK_STATS = "stats";
|
|
2
|
+
export declare const SECTION_WEBPACK_SIZES = "sizes";
|
|
3
|
+
export declare const SECTION_WEBPACK_ASSETS = "assets";
|
|
4
|
+
export declare const SECTION_WEBPACK_MODULES = "modules";
|
|
5
|
+
export declare const SECTION_WEBPACK_PACKAGES = "packages";
|
|
6
|
+
export declare const SECTIONS: string[];
|
|
7
|
+
export declare enum MetricId {
|
|
8
|
+
BundleSize = "totalSizeByTypeALL",
|
|
9
|
+
TotalInitialSizeJS = "totalInitialSizeJS",
|
|
10
|
+
TotalInitialSizeCSS = "totalInitialSizeCSS",
|
|
11
|
+
CacheInvalidation = "cacheInvalidation",
|
|
12
|
+
ModuleName = "moduleCount",
|
|
13
|
+
DuplicateModulesCount = "duplicateModulesCount",
|
|
14
|
+
DuplicateCode = "duplicateCode",
|
|
15
|
+
ChunkCount = "chunkCount",
|
|
16
|
+
AssetCount = "assetCount",
|
|
17
|
+
PackageCount = "packageCount",
|
|
18
|
+
DuplicatePackagesCount = "duplicatePackagesCount"
|
|
19
|
+
}
|
|
20
|
+
export declare const SIZE_BY_TYPE_METRIC_ID_ALL = "ALL";
|
|
21
|
+
export declare const SIZE_BY_TYPE_METRIC_ID_PREFIX = "totalSizeByType";
|
|
22
|
+
export declare enum SizeByTypeMetricId {
|
|
23
|
+
JS = "totalSizeByTypeJS",
|
|
24
|
+
CSS = "totalSizeByTypeCSS",
|
|
25
|
+
IMG = "totalSizeByTypeIMG",
|
|
26
|
+
Media = "totalSizeByTypeMEDIA",
|
|
27
|
+
Font = "totalSizeByTypeFONT",
|
|
28
|
+
HTML = "totalSizeByTypeHTML",
|
|
29
|
+
Other = "totalSizeByTypeOTHER"
|
|
30
|
+
}
|
|
31
|
+
export declare const SUMMARY_METRIC_PATHS: MetricId[];
|
|
32
|
+
export declare const MODULE_PATH_PACKAGES: RegExp;
|
|
33
|
+
export declare const PACKAGE_PATH_NAME: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function extract(webpackStats: any, baseline: any, options: any): {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function extractModulesPackagesDuplicate(webpackStats: any, currentExtractedData: any): {
|
|
2
|
+
metrics: {
|
|
3
|
+
duplicatePackagesCount: {
|
|
4
|
+
value: any;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
insights?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
insights: {
|
|
10
|
+
duplicatePackages: {
|
|
11
|
+
type: InsightType;
|
|
12
|
+
data: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
metrics: {
|
|
16
|
+
duplicatePackagesCount: {
|
|
17
|
+
value: any;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
import { InsightType } from "../../constants";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WebpackMetricsModules, WebpackMetricsPackages } from '../../constants';
|
|
2
|
+
export declare const getPackageMetaFromModulePath: (modulePath: string) => {
|
|
3
|
+
id: string;
|
|
4
|
+
name: unknown;
|
|
5
|
+
path: string;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare const extractModulesPackages: (webpackStats?: any, currentExtractedData?: WebpackMetricsModules | undefined) => WebpackMetricsPackages;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as filter } from "@bundle-stats/plugin-webpack-filter";
|
|
2
|
+
export { default as validate } from "@bundle-stats/plugin-webpack-validate";
|
|
3
|
+
export * from "./compare";
|
|
4
|
+
export * from "./constants";
|
|
5
|
+
export * from "./extract";
|
|
6
|
+
export * from "./metrics";
|
|
7
|
+
export * from "./selectors";
|
|
8
|
+
export * from "./utils";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export declare const metrics: {
|
|
2
|
+
totalSizeByTypeALL: {
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
url: string;
|
|
6
|
+
type: string;
|
|
7
|
+
biggerIsBetter: boolean;
|
|
8
|
+
};
|
|
9
|
+
totalInitialSizeJS: {
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
url: string;
|
|
13
|
+
type: string;
|
|
14
|
+
biggerIsBetter: boolean;
|
|
15
|
+
};
|
|
16
|
+
totalInitialSizeCSS: {
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
url: string;
|
|
20
|
+
type: string;
|
|
21
|
+
biggerIsBetter: boolean;
|
|
22
|
+
};
|
|
23
|
+
cacheInvalidation: {
|
|
24
|
+
label: string;
|
|
25
|
+
description: string;
|
|
26
|
+
url: string;
|
|
27
|
+
type: string;
|
|
28
|
+
biggerIsBetter: boolean;
|
|
29
|
+
};
|
|
30
|
+
chunkCount: {
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
33
|
+
url: string;
|
|
34
|
+
type: string;
|
|
35
|
+
biggerIsBetter: boolean;
|
|
36
|
+
};
|
|
37
|
+
assetCount: {
|
|
38
|
+
label: string;
|
|
39
|
+
description: string;
|
|
40
|
+
url: string;
|
|
41
|
+
type: string;
|
|
42
|
+
biggerIsBetter: boolean;
|
|
43
|
+
};
|
|
44
|
+
moduleCount: {
|
|
45
|
+
label: string;
|
|
46
|
+
description: string;
|
|
47
|
+
url: string;
|
|
48
|
+
type: string;
|
|
49
|
+
biggerIsBetter: boolean;
|
|
50
|
+
};
|
|
51
|
+
duplicateModulesCount: {
|
|
52
|
+
label: string;
|
|
53
|
+
description: string;
|
|
54
|
+
url: string;
|
|
55
|
+
type: string;
|
|
56
|
+
biggerIsBetter: boolean;
|
|
57
|
+
};
|
|
58
|
+
duplicateCode: {
|
|
59
|
+
label: string;
|
|
60
|
+
description: string;
|
|
61
|
+
url: string;
|
|
62
|
+
type: string;
|
|
63
|
+
biggerIsBetter: boolean;
|
|
64
|
+
};
|
|
65
|
+
packageCount: {
|
|
66
|
+
label: string;
|
|
67
|
+
description: string;
|
|
68
|
+
url: string;
|
|
69
|
+
type: string;
|
|
70
|
+
biggerIsBetter: boolean;
|
|
71
|
+
};
|
|
72
|
+
duplicatePackagesCount: {
|
|
73
|
+
label: string;
|
|
74
|
+
description: string;
|
|
75
|
+
url: string;
|
|
76
|
+
type: string;
|
|
77
|
+
biggerIsBetter: boolean;
|
|
78
|
+
};
|
|
79
|
+
sizes: {
|
|
80
|
+
totalSizeByTypeJS: {
|
|
81
|
+
label: string;
|
|
82
|
+
type: string;
|
|
83
|
+
biggerIsBetter: boolean;
|
|
84
|
+
};
|
|
85
|
+
totalSizeByTypeCSS: {
|
|
86
|
+
label: string;
|
|
87
|
+
type: string;
|
|
88
|
+
biggerIsBetter: boolean;
|
|
89
|
+
};
|
|
90
|
+
totalSizeByTypeIMG: {
|
|
91
|
+
label: string;
|
|
92
|
+
type: string;
|
|
93
|
+
biggerIsBetter: boolean;
|
|
94
|
+
};
|
|
95
|
+
totalSizeByTypeMEDIA: {
|
|
96
|
+
label: string;
|
|
97
|
+
type: string;
|
|
98
|
+
biggerIsBetter: boolean;
|
|
99
|
+
};
|
|
100
|
+
totalSizeByTypeFONT: {
|
|
101
|
+
label: string;
|
|
102
|
+
type: string;
|
|
103
|
+
biggerIsBetter: boolean;
|
|
104
|
+
};
|
|
105
|
+
totalSizeByTypeHTML: {
|
|
106
|
+
label: string;
|
|
107
|
+
type: string;
|
|
108
|
+
biggerIsBetter: boolean;
|
|
109
|
+
};
|
|
110
|
+
totalSizeByTypeOTHER: {
|
|
111
|
+
label: string;
|
|
112
|
+
type: string;
|
|
113
|
+
biggerIsBetter: boolean;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export namespace selectors {
|
|
2
|
+
export { getStatsMetrics as stats };
|
|
3
|
+
export { getSizeMetrics as sizes };
|
|
4
|
+
export { getAssetsMetrics as assets };
|
|
5
|
+
export { getModulesMetrics as modules };
|
|
6
|
+
export { getPackageMetrics as packages };
|
|
7
|
+
}
|
|
8
|
+
declare function getStatsMetrics(job: {
|
|
9
|
+
metrics: {
|
|
10
|
+
webpack: Object;
|
|
11
|
+
};
|
|
12
|
+
}): Object;
|
|
13
|
+
declare function getSizeMetrics(job: {
|
|
14
|
+
metrics: {
|
|
15
|
+
webpack: {
|
|
16
|
+
sizes: Object;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}): Object;
|
|
20
|
+
declare function getAssetsMetrics(job: {
|
|
21
|
+
metrics: {
|
|
22
|
+
webpack: {
|
|
23
|
+
assets: Object;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}): Object;
|
|
27
|
+
declare function getModulesMetrics(job: {
|
|
28
|
+
metrics: {
|
|
29
|
+
webpack: {
|
|
30
|
+
modules: Object;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}): Object;
|
|
34
|
+
declare function getPackageMetrics(job: {
|
|
35
|
+
metrics: {
|
|
36
|
+
webpack: {
|
|
37
|
+
packages: Object;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}): Object;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getAssetName(assetFilepath: any): any;
|
|
2
|
+
export function getModuleName(name: any): any;
|
|
3
|
+
export function calculateCacheInvalidation(rows: any): number;
|
|
4
|
+
export function getMetricAdded(runs: any): boolean;
|
|
5
|
+
export function getMetricDeleted(runs: any): boolean;
|
|
6
|
+
export const getMetricType: Function;
|
|
7
|
+
export function getPackagePublicName(packageId: string): string;
|
|
8
|
+
export function normalizeChunkId(chunkId: string | number): string;
|