@bundle-stats/utils 3.3.0 → 3.3.1-beta.8

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.
Files changed (59) hide show
  1. package/lib/constants.js +8 -1
  2. package/lib/constants.js.map +1 -1
  3. package/lib/index.js +15 -0
  4. package/lib/index.js.map +1 -1
  5. package/lib/jobs/create-job.js +2 -2
  6. package/lib/jobs/create-job.js.map +1 -1
  7. package/lib/jobs/create-jobs.js +2 -2
  8. package/lib/jobs/create-jobs.js.map +1 -1
  9. package/lib/transformers/budgets-insights.js +85 -0
  10. package/lib/transformers/budgets-insights.js.map +1 -0
  11. package/lib/transformers/index.js +28 -0
  12. package/lib/transformers/index.js.map +1 -0
  13. package/lib/webpack/constants.js +28 -14
  14. package/lib/webpack/constants.js.map +1 -1
  15. package/lib/webpack/extract/assets-size-total-insight.js +4 -4
  16. package/lib/webpack/extract/assets-size-total-insight.js.map +1 -1
  17. package/lib/webpack/extract/assets-size.js +3 -4
  18. package/lib/webpack/extract/assets-size.js.map +1 -1
  19. package/lib/webpack/extract/index.js +26 -1
  20. package/lib/webpack/extract/index.js.map +1 -1
  21. package/lib/webpack/extract/modules-packages-duplicate.js +2 -2
  22. package/lib/webpack/extract/modules-packages-duplicate.js.map +1 -1
  23. package/lib/webpack/metrics.js +30 -19
  24. package/lib/webpack/metrics.js.map +1 -1
  25. package/lib-esm/constants.js +7 -0
  26. package/lib-esm/constants.js.map +1 -1
  27. package/lib-esm/index.js +3 -0
  28. package/lib-esm/index.js.map +1 -1
  29. package/lib-esm/jobs/create-job.js +2 -2
  30. package/lib-esm/jobs/create-job.js.map +1 -1
  31. package/lib-esm/jobs/create-jobs.js +2 -2
  32. package/lib-esm/jobs/create-jobs.js.map +1 -1
  33. package/lib-esm/transformers/budgets-insights.js +77 -0
  34. package/lib-esm/transformers/budgets-insights.js.map +1 -0
  35. package/lib-esm/transformers/index.js +3 -0
  36. package/lib-esm/transformers/index.js.map +1 -0
  37. package/lib-esm/webpack/constants.js +27 -13
  38. package/lib-esm/webpack/constants.js.map +1 -1
  39. package/lib-esm/webpack/extract/assets-size-total-insight.js +4 -4
  40. package/lib-esm/webpack/extract/assets-size-total-insight.js.map +1 -1
  41. package/lib-esm/webpack/extract/assets-size.js +3 -4
  42. package/lib-esm/webpack/extract/assets-size.js.map +1 -1
  43. package/lib-esm/webpack/extract/index.js +3 -1
  44. package/lib-esm/webpack/extract/index.js.map +1 -1
  45. package/lib-esm/webpack/extract/modules-packages-duplicate.js +2 -2
  46. package/lib-esm/webpack/extract/modules-packages-duplicate.js.map +1 -1
  47. package/lib-esm/webpack/metrics.js +30 -19
  48. package/lib-esm/webpack/metrics.js.map +1 -1
  49. package/package.json +7 -7
  50. package/types/constants.d.ts +6 -0
  51. package/types/index.d.ts +2 -0
  52. package/types/jobs/create-job.d.ts +1 -1
  53. package/types/jobs/create-jobs.d.ts +1 -1
  54. package/types/transformers/budgets-insights.d.ts +36 -0
  55. package/types/transformers/index.d.ts +1 -0
  56. package/types/webpack/constants.d.ts +33 -9
  57. package/types/webpack/extract/index.d.ts +1 -1
  58. package/types/webpack/extract/modules-packages-duplicate.d.ts +2 -1
  59. package/types/webpack/metrics.d.ts +116 -153
@@ -1,9 +1,33 @@
1
- export const SECTION_WEBPACK_STATS: "stats";
2
- export const SECTION_WEBPACK_SIZES: "sizes";
3
- export const SECTION_WEBPACK_ASSETS: "assets";
4
- export const SECTION_WEBPACK_MODULES: "modules";
5
- export const SECTION_WEBPACK_PACKAGES: "packages";
6
- export const SECTIONS: string[];
7
- export const SUMMARY_METRIC_PATHS: string[];
8
- export const MODULE_PATH_PACKAGES: RegExp;
9
- export const PACKAGE_PATH_NAME: RegExp;
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;
@@ -1 +1 @@
1
- export function extract(webpackStats: any, baseline: any): {};
1
+ export function extract(webpackStats: any, baseline: any, options: any): {};
@@ -8,7 +8,7 @@ export function extractModulesPackagesDuplicate(webpackStats: any, currentExtrac
8
8
  } | {
9
9
  insights: {
10
10
  duplicatePackages: {
11
- type: string;
11
+ type: InsightType;
12
12
  data: {};
13
13
  };
14
14
  };
@@ -18,3 +18,4 @@ export function extractModulesPackagesDuplicate(webpackStats: any, currentExtrac
18
18
  };
19
19
  };
20
20
  };
21
+ import { InsightType } from "../../constants";
@@ -1,153 +1,116 @@
1
- export namespace metrics {
2
- namespace totalSizeByTypeALL {
3
- export const label: string;
4
- export const description: string;
5
- export const url: string;
6
- export { METRIC_TYPE_FILE_SIZE as type };
7
- }
8
- namespace totalInitialSizeJS {
9
- const label_1: string;
10
- export { label_1 as label };
11
- const description_1: string;
12
- export { description_1 as description };
13
- const url_1: string;
14
- export { url_1 as url };
15
- export { METRIC_TYPE_FILE_SIZE as type };
16
- }
17
- namespace totalInitialSizeCSS {
18
- const label_2: string;
19
- export { label_2 as label };
20
- const description_2: string;
21
- export { description_2 as description };
22
- const url_2: string;
23
- export { url_2 as url };
24
- export { METRIC_TYPE_FILE_SIZE as type };
25
- }
26
- namespace cacheInvalidation {
27
- const label_3: string;
28
- export { label_3 as label };
29
- const description_3: string;
30
- export { description_3 as description };
31
- const url_3: string;
32
- export { url_3 as url };
33
- export { METRIC_TYPE_PERCENTAGE as type };
34
- export const biggerIsBetter: boolean;
35
- }
36
- namespace chunkCount {
37
- const label_4: string;
38
- export { label_4 as label };
39
- const description_4: string;
40
- export { description_4 as description };
41
- const url_4: string;
42
- export { url_4 as url };
43
- export { METRIC_TYPE_NUMERIC as type };
44
- const biggerIsBetter_1: boolean;
45
- export { biggerIsBetter_1 as biggerIsBetter };
46
- }
47
- namespace assetCount {
48
- const label_5: string;
49
- export { label_5 as label };
50
- const description_5: string;
51
- export { description_5 as description };
52
- const url_5: string;
53
- export { url_5 as url };
54
- export { METRIC_TYPE_NUMERIC as type };
55
- const biggerIsBetter_2: boolean;
56
- export { biggerIsBetter_2 as biggerIsBetter };
57
- }
58
- namespace moduleCount {
59
- const label_6: string;
60
- export { label_6 as label };
61
- const description_6: string;
62
- export { description_6 as description };
63
- const url_6: string;
64
- export { url_6 as url };
65
- export { METRIC_TYPE_NUMERIC as type };
66
- const biggerIsBetter_3: boolean;
67
- export { biggerIsBetter_3 as biggerIsBetter };
68
- }
69
- namespace duplicateModulesCount {
70
- const label_7: string;
71
- export { label_7 as label };
72
- const description_7: string;
73
- export { description_7 as description };
74
- const url_7: string;
75
- export { url_7 as url };
76
- export { METRIC_TYPE_NUMERIC as type };
77
- const biggerIsBetter_4: boolean;
78
- export { biggerIsBetter_4 as biggerIsBetter };
79
- }
80
- namespace duplicateCode {
81
- const label_8: string;
82
- export { label_8 as label };
83
- const description_8: string;
84
- export { description_8 as description };
85
- const url_8: string;
86
- export { url_8 as url };
87
- export { METRIC_TYPE_PERCENTAGE as type };
88
- const biggerIsBetter_5: boolean;
89
- export { biggerIsBetter_5 as biggerIsBetter };
90
- }
91
- namespace packageCount {
92
- const label_9: string;
93
- export { label_9 as label };
94
- const description_9: string;
95
- export { description_9 as description };
96
- const url_9: string;
97
- export { url_9 as url };
98
- export { METRIC_TYPE_NUMERIC as type };
99
- const biggerIsBetter_6: boolean;
100
- export { biggerIsBetter_6 as biggerIsBetter };
101
- }
102
- namespace duplicatePackagesCount {
103
- const label_10: string;
104
- export { label_10 as label };
105
- const description_10: string;
106
- export { description_10 as description };
107
- const url_10: string;
108
- export { url_10 as url };
109
- export { METRIC_TYPE_NUMERIC as type };
110
- const biggerIsBetter_7: boolean;
111
- export { biggerIsBetter_7 as biggerIsBetter };
112
- }
113
- namespace sizes {
114
- namespace totalSizeByTypeJS {
115
- const label_11: string;
116
- export { label_11 as label };
117
- export { METRIC_TYPE_FILE_SIZE as type };
118
- }
119
- namespace totalSizeByTypeCSS {
120
- const label_12: string;
121
- export { label_12 as label };
122
- export { METRIC_TYPE_FILE_SIZE as type };
123
- }
124
- namespace totalSizeByTypeIMG {
125
- const label_13: string;
126
- export { label_13 as label };
127
- export { METRIC_TYPE_FILE_SIZE as type };
128
- }
129
- namespace totalSizeByTypeMEDIA {
130
- const label_14: string;
131
- export { label_14 as label };
132
- export { METRIC_TYPE_FILE_SIZE as type };
133
- }
134
- namespace totalSizeByTypeFONT {
135
- const label_15: string;
136
- export { label_15 as label };
137
- export { METRIC_TYPE_FILE_SIZE as type };
138
- }
139
- namespace totalSizeByTypeHTML {
140
- const label_16: string;
141
- export { label_16 as label };
142
- export { METRIC_TYPE_FILE_SIZE as type };
143
- }
144
- namespace totalSizeByTypeOTHER {
145
- const label_17: string;
146
- export { label_17 as label };
147
- export { METRIC_TYPE_FILE_SIZE as type };
148
- }
149
- }
150
- }
151
- import { METRIC_TYPE_FILE_SIZE } from "../config/metrics";
152
- import { METRIC_TYPE_PERCENTAGE } from "../config/metrics";
153
- import { METRIC_TYPE_NUMERIC } from "../config/metrics";
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
+ };