@bundle-stats/utils 4.7.5-alpha.0 → 4.7.5-beta.2

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 (84) hide show
  1. package/lib/browsertime/metrics.js +22 -22
  2. package/lib/browsertime/metrics.js.map +1 -1
  3. package/lib/config/index.js +1 -2
  4. package/lib/config/index.js.map +1 -1
  5. package/lib/config/metric-types.js +28 -0
  6. package/lib/config/metric-types.js.map +1 -0
  7. package/lib/constants.js +9 -19
  8. package/lib/constants.js.map +1 -1
  9. package/lib/lighthouse/metrics.js +13 -13
  10. package/lib/lighthouse/metrics.js.map +1 -1
  11. package/lib/report/add-row-metric-data.js +2 -2
  12. package/lib/report/add-row-metric-data.js.map +1 -1
  13. package/lib/report/create.js.map +1 -1
  14. package/lib/utils/component-links.js +1 -7
  15. package/lib/utils/component-links.js.map +1 -1
  16. package/lib/utils/delta.js +29 -26
  17. package/lib/utils/delta.js.map +1 -1
  18. package/lib/utils/metrics.js +47 -29
  19. package/lib/utils/metrics.js.map +1 -1
  20. package/lib/webpack/compare.js +11 -11
  21. package/lib/webpack/compare.js.map +1 -1
  22. package/lib/webpack/metrics.js +25 -24
  23. package/lib/webpack/metrics.js.map +1 -1
  24. package/lib-esm/browsertime/metrics.js +22 -22
  25. package/lib-esm/browsertime/metrics.js.map +1 -1
  26. package/lib-esm/config/index.js +1 -2
  27. package/lib-esm/config/index.js.map +1 -1
  28. package/lib-esm/config/metric-types.js +25 -0
  29. package/lib-esm/config/metric-types.js.map +1 -0
  30. package/lib-esm/constants.js +8 -18
  31. package/lib-esm/constants.js.map +1 -1
  32. package/lib-esm/lighthouse/metrics.js +13 -13
  33. package/lib-esm/lighthouse/metrics.js.map +1 -1
  34. package/lib-esm/report/add-row-metric-data.js +2 -2
  35. package/lib-esm/report/add-row-metric-data.js.map +1 -1
  36. package/lib-esm/report/create.js.map +1 -1
  37. package/lib-esm/utils/component-links.js +1 -7
  38. package/lib-esm/utils/component-links.js.map +1 -1
  39. package/lib-esm/utils/delta.js +29 -26
  40. package/lib-esm/utils/delta.js.map +1 -1
  41. package/lib-esm/utils/metrics.js +44 -27
  42. package/lib-esm/utils/metrics.js.map +1 -1
  43. package/lib-esm/webpack/compare.js +4 -4
  44. package/lib-esm/webpack/compare.js.map +1 -1
  45. package/lib-esm/webpack/metrics.js +25 -24
  46. package/lib-esm/webpack/metrics.js.map +1 -1
  47. package/package.json +5 -5
  48. package/src/browsertime/metrics.js +22 -22
  49. package/src/config/index.js +1 -2
  50. package/src/config/metric-types.ts +25 -0
  51. package/src/constants.ts +64 -28
  52. package/src/lighthouse/metrics.js +13 -15
  53. package/src/report/add-row-metric-data.ts +3 -2
  54. package/src/report/create.ts +1 -1
  55. package/src/utils/component-links.ts +1 -7
  56. package/src/utils/delta.ts +91 -0
  57. package/src/utils/metrics.ts +81 -0
  58. package/src/webpack/compare.js +19 -12
  59. package/src/webpack/{metrics.js → metrics.ts} +30 -29
  60. package/types/browsertime/metrics.d.ts +43 -23
  61. package/types/config/index.d.ts +1 -2
  62. package/types/config/metric-types.d.ts +2 -0
  63. package/types/constants.d.ts +24 -22
  64. package/types/lighthouse/metrics.d.ts +25 -17
  65. package/types/report/add-row-metric-data.d.ts +4 -3
  66. package/types/utils/component-links.d.ts +0 -4
  67. package/types/utils/delta.d.ts +4 -6
  68. package/types/utils/metrics.d.ts +4 -3
  69. package/types/webpack/metrics.d.ts +7 -153
  70. package/types/webpack/utils.d.ts +1 -1
  71. package/lib/config/delta.js +0 -13
  72. package/lib/config/delta.js.map +0 -1
  73. package/lib/config/metrics.js +0 -32
  74. package/lib/config/metrics.js.map +0 -1
  75. package/lib-esm/config/delta.js +0 -10
  76. package/lib-esm/config/delta.js.map +0 -1
  77. package/lib-esm/config/metrics.js +0 -29
  78. package/lib-esm/config/metrics.js.map +0 -1
  79. package/src/config/delta.js +0 -11
  80. package/src/config/metrics.js +0 -31
  81. package/src/utils/delta.js +0 -94
  82. package/src/utils/metrics.js +0 -92
  83. package/types/config/delta.d.ts +0 -9
  84. package/types/config/metrics.d.ts +0 -6
@@ -1,107 +1,127 @@
1
1
  export namespace metrics {
2
2
  namespace firstPaint {
3
- export let label: string;
4
- export { METRIC_TYPE_DURATION as type };
3
+ let label: string;
4
+ let type: MetricTypes;
5
5
  }
6
6
  namespace fullyLoaded {
7
7
  let label_1: string;
8
8
  export { label_1 as label };
9
- export { METRIC_TYPE_DURATION as type };
9
+ let type_1: MetricTypes;
10
+ export { type_1 as type };
10
11
  }
11
12
  namespace backEndTime {
12
13
  let label_2: string;
13
14
  export { label_2 as label };
14
- export { METRIC_TYPE_DURATION as type };
15
+ let type_2: MetricTypes;
16
+ export { type_2 as type };
15
17
  }
16
18
  namespace domContentLoadedTime {
17
19
  let label_3: string;
18
20
  export { label_3 as label };
19
- export { METRIC_TYPE_DURATION as type };
21
+ let type_3: MetricTypes;
22
+ export { type_3 as type };
20
23
  }
21
24
  namespace domInteractiveTime {
22
25
  let label_4: string;
23
26
  export { label_4 as label };
24
- export { METRIC_TYPE_DURATION as type };
27
+ let type_4: MetricTypes;
28
+ export { type_4 as type };
25
29
  }
26
30
  namespace domainLookupTime {
27
31
  let label_5: string;
28
32
  export { label_5 as label };
29
- export { METRIC_TYPE_DURATION as type };
33
+ let type_5: MetricTypes;
34
+ export { type_5 as type };
30
35
  }
31
36
  namespace frontEndTime {
32
37
  let label_6: string;
33
38
  export { label_6 as label };
34
- export { METRIC_TYPE_DURATION as type };
39
+ let type_6: MetricTypes;
40
+ export { type_6 as type };
35
41
  }
36
42
  namespace pageDownloadTime {
37
43
  let label_7: string;
38
44
  export { label_7 as label };
39
- export { METRIC_TYPE_DURATION as type };
45
+ let type_7: MetricTypes;
46
+ export { type_7 as type };
40
47
  }
41
48
  namespace pageLoadTime {
42
49
  let label_8: string;
43
50
  export { label_8 as label };
44
- export { METRIC_TYPE_DURATION as type };
51
+ let type_8: MetricTypes;
52
+ export { type_8 as type };
45
53
  }
46
54
  namespace redirectionTime {
47
55
  let label_9: string;
48
56
  export { label_9 as label };
49
- export { METRIC_TYPE_DURATION as type };
57
+ let type_9: MetricTypes;
58
+ export { type_9 as type };
50
59
  }
51
60
  namespace serverConnectionTime {
52
61
  let label_10: string;
53
62
  export { label_10 as label };
54
- export { METRIC_TYPE_DURATION as type };
63
+ let type_10: MetricTypes;
64
+ export { type_10 as type };
55
65
  }
56
66
  namespace serverResponseTime {
57
67
  let label_11: string;
58
68
  export { label_11 as label };
59
- export { METRIC_TYPE_DURATION as type };
69
+ let type_11: MetricTypes;
70
+ export { type_11 as type };
60
71
  }
61
72
  namespace firstContentfulPaint {
62
73
  let label_12: string;
63
74
  export { label_12 as label };
64
- export { METRIC_TYPE_DURATION as type };
75
+ let type_12: MetricTypes;
76
+ export { type_12 as type };
65
77
  }
66
78
  namespace rumSpeedIndex {
67
79
  let label_13: string;
68
80
  export { label_13 as label };
69
- export { METRIC_TYPE_DURATION as type };
81
+ let type_13: MetricTypes;
82
+ export { type_13 as type };
70
83
  }
71
84
  namespace firstVisualChange {
72
85
  let label_14: string;
73
86
  export { label_14 as label };
74
- export { METRIC_TYPE_DURATION as type };
87
+ let type_14: MetricTypes;
88
+ export { type_14 as type };
75
89
  }
76
90
  namespace lastVisualChange {
77
91
  let label_15: string;
78
92
  export { label_15 as label };
79
- export { METRIC_TYPE_DURATION as type };
93
+ let type_15: MetricTypes;
94
+ export { type_15 as type };
80
95
  }
81
96
  namespace perceptualSpeedIndex {
82
97
  let label_16: string;
83
98
  export { label_16 as label };
84
- export { METRIC_TYPE_DURATION as type };
99
+ let type_16: MetricTypes;
100
+ export { type_16 as type };
85
101
  }
86
102
  namespace speedIndex {
87
103
  let label_17: string;
88
104
  export { label_17 as label };
89
- export { METRIC_TYPE_DURATION as type };
105
+ let type_17: MetricTypes;
106
+ export { type_17 as type };
90
107
  }
91
108
  namespace visualComplete85 {
92
109
  let label_18: string;
93
110
  export { label_18 as label };
94
- export { METRIC_TYPE_DURATION as type };
111
+ let type_18: MetricTypes;
112
+ export { type_18 as type };
95
113
  }
96
114
  namespace visualComplete95 {
97
115
  let label_19: string;
98
116
  export { label_19 as label };
99
- export { METRIC_TYPE_DURATION as type };
117
+ let type_19: MetricTypes;
118
+ export { type_19 as type };
100
119
  }
101
120
  namespace visualComplete99 {
102
121
  let label_20: string;
103
122
  export { label_20 as label };
104
- export { METRIC_TYPE_DURATION as type };
123
+ let type_20: MetricTypes;
124
+ export { type_20 as type };
105
125
  }
106
126
  }
107
- import { METRIC_TYPE_DURATION } from '../config/metrics';
127
+ import { MetricTypes } from '../constants';
@@ -1,6 +1,5 @@
1
1
  export * from "./component-links";
2
2
  export * from "./file-types";
3
- export * from "./metrics";
4
- export * from "./delta";
3
+ export * from "./metric-types";
5
4
  export const PACKAGES_SEPARATOR: ":";
6
5
  export const PACKAGE_ID_SEPARATOR: "~";
@@ -0,0 +1,2 @@
1
+ import { MetricTypes, MetricTypeConfig } from '../constants';
2
+ export declare const METRIC_TYPE_CONFIGS: Record<MetricTypes, MetricTypeConfig>;
@@ -9,34 +9,34 @@ export declare enum InsightType {
9
9
  INFO = "info",
10
10
  WARNING = "warning"
11
11
  }
12
- export declare enum MetricTypeType {
13
- METRIC_TYPE_NUMERIC = "METRIC_TYPE_NUMERIC",
14
- METRIC_TYPE_SCORE = "METRIC_TYPE_SCORE",
15
- METRIC_TYPE_FILE_SIZE = "METRIC_TYPE_FILE_SIZE",
16
- METRIC_TYPE_DURATION = "METRIC_TYPE_DURATION",
17
- METRIC_TYPE_PERCENTAGE = "METRIC_TYPE_PERCENTAGE"
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
- label: string;
21
- description: string;
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 type MetricRunInfoDeltaType = 'HIGH_NEGATIVE' | 'NEGATIVE' | 'LOW_NEGATIVE' | 'NO_CHANGE' | 'LOW_POSITIVE' | 'POSITIVE' | 'HIGH_POSITIVE';
37
33
  export interface MetricRun {
38
34
  value: number;
39
35
  }
36
+ export interface MetricRunDelta {
37
+ delta: number;
38
+ deltaPercentage: number;
39
+ }
40
40
  export interface MetricRunInfo {
41
41
  value: number;
42
42
  displayValue: string;
@@ -45,6 +45,7 @@ export interface MetricRunInfo {
45
45
  deltaType?: MetricRunInfoDeltaType;
46
46
  displayDelta?: string;
47
47
  displayDeltaPercentage?: string;
48
+ regression?: boolean | null;
48
49
  }
49
50
  export type JobSection<T = object> = Record<Source, T>;
50
51
  export declare enum JobSectionId {
@@ -66,6 +67,7 @@ export interface JobInsight<T = object> {
66
67
  }
67
68
  export interface JobInsightAssetsSizeTotalData {
68
69
  md: string;
70
+ text: string;
69
71
  info: MetricRunInfo;
70
72
  }
71
73
  export type JobInsightDuplicatePackagesData = Record<string, Array<string>>;
@@ -1,65 +1,73 @@
1
1
  export namespace metrics {
2
2
  namespace score {
3
- export let label: string;
4
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_SCORE as type };
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
- export { METRIC_TYPE_DURATION as type };
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
- export { METRIC_TYPE_DURATION as type };
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
- export { METRIC_TYPE_DURATION as type };
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
- export { METRIC_TYPE_DURATION as type };
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
- export { METRIC_TYPE_FILE_SIZE as type };
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
- export { METRIC_TYPE_NUMERIC as type };
69
+ let type_11: MetricTypes;
70
+ export { type_11 as type };
60
71
  }
61
72
  }
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';
73
+ import { MetricTypes } from '../constants';
@@ -1,16 +1,17 @@
1
1
  import * as types from './types';
2
2
  export declare const getAddRowMetricData: (metricType?: string) => (row: types.ReportRow) => {
3
- biggerIsBetter: any;
4
- label: any;
3
+ biggerIsBetter: boolean | null | undefined;
4
+ label: string;
5
5
  changed: boolean;
6
6
  runs: ({
7
7
  value: number;
8
8
  displayValue: string;
9
9
  delta?: number | undefined;
10
10
  deltaPercentage?: number | undefined;
11
- deltaType?: import("..").MetricRunInfoDeltaType | undefined;
11
+ deltaType?: import("../constants").MetricRunInfoDeltaType | undefined;
12
12
  displayDelta?: string | undefined;
13
13
  displayDeltaPercentage?: string | undefined;
14
+ regression?: boolean | null | undefined;
14
15
  name?: string | undefined;
15
16
  } | null)[];
16
17
  key: string;
@@ -39,8 +39,4 @@ export declare const getBundlePackagesByNameComponentLink: (search: string) => C
39
39
  export declare const getComponentStateQueryString: (params?: {}) => string;
40
40
  export declare const METRIC_COMPONENT_LINKS: Map<string, {
41
41
  link: ComponentLink;
42
- showDelta?: undefined;
43
- } | {
44
- link: ComponentLink;
45
- showDelta: boolean;
46
42
  }>;
@@ -1,6 +1,4 @@
1
- export function getDelta(baseline: any, current: any): {
2
- delta: any;
3
- deltaPercentage: number;
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;
@@ -1,3 +1,4 @@
1
- export function createGetMetricType(metrics: Object): Function;
2
- export const getGlobalMetricType: Function;
3
- export function getMetricRunInfo(metric: import('../constants').MetricType, currentValue: number, baselineValue: number): import('../constants').MetricRunInfo;
1
+ import { MetricRunInfo, 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;
@@ -1,153 +1,7 @@
1
- export namespace metrics {
2
- namespace totalSizeByTypeALL {
3
- export let label: string;
4
- export let description: string;
5
- export let url: string;
6
- export { METRIC_TYPE_FILE_SIZE as type };
7
- }
8
- namespace totalInitialSizeJS {
9
- let label_1: string;
10
- export { label_1 as label };
11
- let description_1: string;
12
- export { description_1 as description };
13
- let url_1: string;
14
- export { url_1 as url };
15
- export { METRIC_TYPE_FILE_SIZE as type };
16
- }
17
- namespace totalInitialSizeCSS {
18
- let label_2: string;
19
- export { label_2 as label };
20
- let description_2: string;
21
- export { description_2 as description };
22
- let url_2: string;
23
- export { url_2 as url };
24
- export { METRIC_TYPE_FILE_SIZE as type };
25
- }
26
- namespace cacheInvalidation {
27
- let label_3: string;
28
- export { label_3 as label };
29
- let description_3: string;
30
- export { description_3 as description };
31
- let url_3: string;
32
- export { url_3 as url };
33
- export { METRIC_TYPE_PERCENTAGE as type };
34
- export let biggerIsBetter: boolean;
35
- }
36
- namespace chunkCount {
37
- let label_4: string;
38
- export { label_4 as label };
39
- let description_4: string;
40
- export { description_4 as description };
41
- let url_4: string;
42
- export { url_4 as url };
43
- export { METRIC_TYPE_NUMERIC as type };
44
- let biggerIsBetter_1: boolean;
45
- export { biggerIsBetter_1 as biggerIsBetter };
46
- }
47
- namespace assetCount {
48
- let label_5: string;
49
- export { label_5 as label };
50
- let description_5: string;
51
- export { description_5 as description };
52
- let url_5: string;
53
- export { url_5 as url };
54
- export { METRIC_TYPE_NUMERIC as type };
55
- let biggerIsBetter_2: boolean;
56
- export { biggerIsBetter_2 as biggerIsBetter };
57
- }
58
- namespace moduleCount {
59
- let label_6: string;
60
- export { label_6 as label };
61
- let description_6: string;
62
- export { description_6 as description };
63
- let url_6: string;
64
- export { url_6 as url };
65
- export { METRIC_TYPE_NUMERIC as type };
66
- let biggerIsBetter_3: boolean;
67
- export { biggerIsBetter_3 as biggerIsBetter };
68
- }
69
- namespace duplicateModulesCount {
70
- let label_7: string;
71
- export { label_7 as label };
72
- let description_7: string;
73
- export { description_7 as description };
74
- let url_7: string;
75
- export { url_7 as url };
76
- export { METRIC_TYPE_NUMERIC as type };
77
- let biggerIsBetter_4: boolean;
78
- export { biggerIsBetter_4 as biggerIsBetter };
79
- }
80
- namespace duplicateCode {
81
- let label_8: string;
82
- export { label_8 as label };
83
- let description_8: string;
84
- export { description_8 as description };
85
- let url_8: string;
86
- export { url_8 as url };
87
- export { METRIC_TYPE_PERCENTAGE as type };
88
- let biggerIsBetter_5: boolean;
89
- export { biggerIsBetter_5 as biggerIsBetter };
90
- }
91
- namespace packageCount {
92
- let label_9: string;
93
- export { label_9 as label };
94
- let description_9: string;
95
- export { description_9 as description };
96
- let url_9: string;
97
- export { url_9 as url };
98
- export { METRIC_TYPE_NUMERIC as type };
99
- let biggerIsBetter_6: boolean;
100
- export { biggerIsBetter_6 as biggerIsBetter };
101
- }
102
- namespace duplicatePackagesCount {
103
- let label_10: string;
104
- export { label_10 as label };
105
- let description_10: string;
106
- export { description_10 as description };
107
- let url_10: string;
108
- export { url_10 as url };
109
- export { METRIC_TYPE_NUMERIC as type };
110
- let biggerIsBetter_7: boolean;
111
- export { biggerIsBetter_7 as biggerIsBetter };
112
- }
113
- namespace sizes {
114
- namespace totalSizeByTypeJS {
115
- let label_11: string;
116
- export { label_11 as label };
117
- export { METRIC_TYPE_FILE_SIZE as type };
118
- }
119
- namespace totalSizeByTypeCSS {
120
- let label_12: string;
121
- export { label_12 as label };
122
- export { METRIC_TYPE_FILE_SIZE as type };
123
- }
124
- namespace totalSizeByTypeIMG {
125
- let label_13: string;
126
- export { label_13 as label };
127
- export { METRIC_TYPE_FILE_SIZE as type };
128
- }
129
- namespace totalSizeByTypeMEDIA {
130
- let label_14: string;
131
- export { label_14 as label };
132
- export { METRIC_TYPE_FILE_SIZE as type };
133
- }
134
- namespace totalSizeByTypeFONT {
135
- let label_15: string;
136
- export { label_15 as label };
137
- export { METRIC_TYPE_FILE_SIZE as type };
138
- }
139
- namespace totalSizeByTypeHTML {
140
- let label_16: string;
141
- export { label_16 as label };
142
- export { METRIC_TYPE_FILE_SIZE as type };
143
- }
144
- namespace totalSizeByTypeOTHER {
145
- let 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
+ import { Metric } from './types';
2
+ import { MetricConfig } from '../constants';
3
+ type WebpackMetrics = Partial<Record<Metric, MetricConfig>> & {
4
+ sizes: Partial<Record<Metric, MetricConfig>>;
5
+ };
6
+ export declare const metrics: WebpackMetrics;
7
+ export {};
@@ -3,6 +3,6 @@ export function getModuleName(name: any): any;
3
3
  export function calculateCacheInvalidation(rows: any): number;
4
4
  export function getMetricAdded(runs: any): boolean;
5
5
  export function getMetricDeleted(runs: any): boolean;
6
- export const getMetricType: Function;
6
+ export const getMetricType: (key: string, type?: import("..").MetricTypes | undefined) => import("..").Metric;
7
7
  export function getPackagePublicName(packageId: string): string;
8
8
  export function normalizeChunkId(chunkId: string | number): string;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DELTA_TYPE_HIGH_POSITIVE = exports.DELTA_TYPE_LOW_POSITIVE = exports.DELTA_TYPE_HIGH_NEGATIVE = exports.DELTA_TYPE_LOW_NEGATIVE = exports.DELTA_TYPE_LEVEL_HIGH = exports.DELTA_TYPE_LEVEL_LOW = exports.DELTA_TYPE_POSITIVE = exports.DELTA_TYPE_NO_CHANGE = exports.DELTA_TYPE_NEGATIVE = void 0;
4
- exports.DELTA_TYPE_NEGATIVE = 'NEGATIVE';
5
- exports.DELTA_TYPE_NO_CHANGE = 'NO_CHANGE';
6
- exports.DELTA_TYPE_POSITIVE = 'POSITIVE';
7
- exports.DELTA_TYPE_LEVEL_LOW = 'LOW';
8
- exports.DELTA_TYPE_LEVEL_HIGH = 'HIGH';
9
- exports.DELTA_TYPE_LOW_NEGATIVE = `${exports.DELTA_TYPE_LEVEL_LOW}_${exports.DELTA_TYPE_NEGATIVE}`;
10
- exports.DELTA_TYPE_HIGH_NEGATIVE = `${exports.DELTA_TYPE_LEVEL_HIGH}_${exports.DELTA_TYPE_NEGATIVE}`;
11
- exports.DELTA_TYPE_LOW_POSITIVE = `${exports.DELTA_TYPE_LEVEL_LOW}_${exports.DELTA_TYPE_POSITIVE}`;
12
- exports.DELTA_TYPE_HIGH_POSITIVE = `${exports.DELTA_TYPE_LEVEL_HIGH}_${exports.DELTA_TYPE_POSITIVE}`;
13
- //# sourceMappingURL=delta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../src/config/delta.js"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,UAAU,CAAC;AACjC,QAAA,oBAAoB,GAAG,WAAW,CAAC;AACnC,QAAA,mBAAmB,GAAG,UAAU,CAAC;AAEjC,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAC7B,QAAA,qBAAqB,GAAG,MAAM,CAAC;AAE/B,QAAA,uBAAuB,GAAG,GAAG,4BAAoB,IAAI,2BAAmB,EAAE,CAAC;AAC3E,QAAA,wBAAwB,GAAG,GAAG,6BAAqB,IAAI,2BAAmB,EAAE,CAAC;AAC7E,QAAA,uBAAuB,GAAG,GAAG,4BAAoB,IAAI,2BAAmB,EAAE,CAAC;AAC3E,QAAA,wBAAwB,GAAG,GAAG,6BAAqB,IAAI,2BAAmB,EAAE,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.METRIC_TYPES = exports.METRIC_TYPE_PERCENTAGE = exports.METRIC_TYPE_SCORE = exports.METRIC_TYPE_NUMERIC = exports.METRIC_TYPE_DURATION = exports.METRIC_TYPE_FILE_SIZE = void 0;
4
- const format_1 = require("../utils/format");
5
- exports.METRIC_TYPE_FILE_SIZE = 'METRIC_TYPE_FILE_SIZE';
6
- exports.METRIC_TYPE_DURATION = 'METRIC_TYPE_DURATION';
7
- exports.METRIC_TYPE_NUMERIC = 'METRIC_TYPE_NUMERIC';
8
- exports.METRIC_TYPE_SCORE = 'METRIC_TYPE_SCORE';
9
- exports.METRIC_TYPE_PERCENTAGE = 'METRIC_TYPE_PERCENTAGE';
10
- exports.METRIC_TYPES = {
11
- [exports.METRIC_TYPE_NUMERIC]: {
12
- biggerIsBetter: false,
13
- formatter: format_1.formatNumber,
14
- },
15
- [exports.METRIC_TYPE_SCORE]: {
16
- biggerIsBetter: true,
17
- formatter: format_1.formatNumber,
18
- },
19
- [exports.METRIC_TYPE_DURATION]: {
20
- biggerIsBetter: false,
21
- formatter: format_1.formatDuration,
22
- },
23
- [exports.METRIC_TYPE_FILE_SIZE]: {
24
- biggerIsBetter: false,
25
- formatter: format_1.formatFileSize,
26
- },
27
- [exports.METRIC_TYPE_PERCENTAGE]: {
28
- biggerIsBetter: true,
29
- formatter: format_1.formatPercentage,
30
- },
31
- };
32
- //# sourceMappingURL=metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/config/metrics.js"],"names":[],"mappings":";;;AAAA,4CAAiG;AAEpF,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAChD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAGlD,QAAA,YAAY,GAAG;IAC1B,CAAC,2BAAmB,CAAC,EAAE;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,qBAAY;KACxB;IACD,CAAC,yBAAiB,CAAC,EAAE;QACnB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,qBAAY;KACxB;IACD,CAAC,4BAAoB,CAAC,EAAE;QACtB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,uBAAc;KAC1B;IACD,CAAC,6BAAqB,CAAC,EAAE;QACvB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,uBAAc;KAC1B;IACD,CAAC,8BAAsB,CAAC,EAAE;QACxB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,yBAAgB;KAC5B;CACF,CAAC"}
@@ -1,10 +0,0 @@
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 = `${DELTA_TYPE_LEVEL_LOW}_${DELTA_TYPE_NEGATIVE}`;
7
- export const DELTA_TYPE_HIGH_NEGATIVE = `${DELTA_TYPE_LEVEL_HIGH}_${DELTA_TYPE_NEGATIVE}`;
8
- export const DELTA_TYPE_LOW_POSITIVE = `${DELTA_TYPE_LEVEL_LOW}_${DELTA_TYPE_POSITIVE}`;
9
- export const DELTA_TYPE_HIGH_POSITIVE = `${DELTA_TYPE_LEVEL_HIGH}_${DELTA_TYPE_POSITIVE}`;
10
- //# sourceMappingURL=delta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../src/config/delta.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,oBAAoB,IAAI,mBAAmB,EAAE,CAAC;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,qBAAqB,IAAI,mBAAmB,EAAE,CAAC;AAC1F,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,oBAAoB,IAAI,mBAAmB,EAAE,CAAC;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,qBAAqB,IAAI,mBAAmB,EAAE,CAAC"}
@@ -1,29 +0,0 @@
1
- import { formatNumber, formatDuration, formatFileSize, formatPercentage } from '../utils/format';
2
- export const METRIC_TYPE_FILE_SIZE = 'METRIC_TYPE_FILE_SIZE';
3
- export const METRIC_TYPE_DURATION = 'METRIC_TYPE_DURATION';
4
- export const METRIC_TYPE_NUMERIC = 'METRIC_TYPE_NUMERIC';
5
- export const METRIC_TYPE_SCORE = 'METRIC_TYPE_SCORE';
6
- export const METRIC_TYPE_PERCENTAGE = 'METRIC_TYPE_PERCENTAGE';
7
- export const METRIC_TYPES = {
8
- [METRIC_TYPE_NUMERIC]: {
9
- biggerIsBetter: false,
10
- formatter: formatNumber,
11
- },
12
- [METRIC_TYPE_SCORE]: {
13
- biggerIsBetter: true,
14
- formatter: formatNumber,
15
- },
16
- [METRIC_TYPE_DURATION]: {
17
- biggerIsBetter: false,
18
- formatter: formatDuration,
19
- },
20
- [METRIC_TYPE_FILE_SIZE]: {
21
- biggerIsBetter: false,
22
- formatter: formatFileSize,
23
- },
24
- [METRIC_TYPE_PERCENTAGE]: {
25
- biggerIsBetter: true,
26
- formatter: formatPercentage,
27
- },
28
- };
29
- //# sourceMappingURL=metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/config/metrics.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjG,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAG/D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,mBAAmB,CAAC,EAAE;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,YAAY;KACxB;IACD,CAAC,iBAAiB,CAAC,EAAE;QACnB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,YAAY;KACxB;IACD,CAAC,oBAAoB,CAAC,EAAE;QACtB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,cAAc;KAC1B;IACD,CAAC,qBAAqB,CAAC,EAAE;QACvB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,cAAc;KAC1B;IACD,CAAC,sBAAsB,CAAC,EAAE;QACxB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,gBAAgB;KAC5B;CACF,CAAC"}