@bundle-stats/utils 3.3.0-beta.1 → 3.4.0-alpha.4

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 (127) 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 +29 -18
  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 +29 -18
  48. package/lib-esm/webpack/metrics.js.map +1 -1
  49. package/package.json +4 -4
  50. package/src/constants.ts +7 -0
  51. package/src/index.js +2 -0
  52. package/src/jobs/create-job.js +2 -2
  53. package/src/jobs/create-jobs.js +2 -2
  54. package/src/transformers/budgets-insights.ts +143 -0
  55. package/src/transformers/index.ts +1 -0
  56. package/src/webpack/{constants.js → constants.ts} +28 -13
  57. package/src/webpack/extract/assets-size-total-insight.js +4 -4
  58. package/src/webpack/extract/assets-size.js +3 -5
  59. package/src/webpack/extract/index.js +7 -5
  60. package/src/webpack/extract/modules-packages-duplicate.js +2 -2
  61. package/src/webpack/{metrics.js → metrics.ts} +29 -18
  62. package/types/browsertime/compare.d.ts +1 -0
  63. package/types/browsertime/constants.d.ts +1 -0
  64. package/types/browsertime/extract.d.ts +6 -0
  65. package/types/browsertime/filter.d.ts +1 -0
  66. package/types/browsertime/index.d.ts +6 -0
  67. package/types/browsertime/metrics.d.ts +107 -0
  68. package/types/browsertime/selectors.d.ts +1 -0
  69. package/types/config/component-links.d.ts +35 -0
  70. package/types/config/delta.d.ts +9 -0
  71. package/types/config/file-types.d.ts +45 -0
  72. package/types/config/index.d.ts +11 -0
  73. package/types/config/insights.d.ts +4 -0
  74. package/types/config/metrics.d.ts +35 -0
  75. package/types/constants.d.ts +165 -0
  76. package/types/i18n.d.ts +16 -0
  77. package/types/index.d.ts +7 -0
  78. package/types/jobs/create-job.d.ts +1 -0
  79. package/types/jobs/create-jobs.d.ts +1 -0
  80. package/types/jobs/create-summary.d.ts +1 -0
  81. package/types/jobs/index.d.ts +2 -0
  82. package/types/lighthouse/compare.d.ts +1 -0
  83. package/types/lighthouse/constants.d.ts +1 -0
  84. package/types/lighthouse/extract/audits.d.ts +6 -0
  85. package/types/lighthouse/extract/category-scores.d.ts +6 -0
  86. package/types/lighthouse/extract/index.d.ts +1 -0
  87. package/types/lighthouse/extract/score-category-scores.d.ts +10 -0
  88. package/types/lighthouse/filter.d.ts +1 -0
  89. package/types/lighthouse/index.d.ts +6 -0
  90. package/types/lighthouse/metrics.d.ts +65 -0
  91. package/types/lighthouse/selectors.d.ts +1 -0
  92. package/types/polyfills.d.ts +1 -0
  93. package/types/report/add-row-metric-data.d.ts +8 -0
  94. package/types/report/compare-metrics.d.ts +2 -0
  95. package/types/report/create.d.ts +14 -0
  96. package/types/report/get-metric-changed.d.ts +2 -0
  97. package/types/report/index.d.ts +5 -0
  98. package/types/report/merge-metrics-by-key.d.ts +4 -0
  99. package/types/report/types.d.ts +8 -0
  100. package/types/transformers/budgets-insights.d.ts +36 -0
  101. package/types/transformers/index.d.ts +1 -0
  102. package/types/utils/component-links.d.ts +193 -0
  103. package/types/utils/date.d.ts +2 -0
  104. package/types/utils/delta.d.ts +6 -0
  105. package/types/utils/file-types.d.ts +4 -0
  106. package/types/utils/format.d.ts +5 -0
  107. package/types/utils/index.d.ts +6 -0
  108. package/types/utils/metrics.d.ts +3 -0
  109. package/types/webpack/compare.d.ts +14 -0
  110. package/types/webpack/constants.d.ts +33 -0
  111. package/types/webpack/extract/assets-cache-invalidation.d.ts +7 -0
  112. package/types/webpack/extract/assets-chunk-count.d.ts +7 -0
  113. package/types/webpack/extract/assets-count.d.ts +7 -0
  114. package/types/webpack/extract/assets-size-total-insight.d.ts +12 -0
  115. package/types/webpack/extract/assets-size.d.ts +11 -0
  116. package/types/webpack/extract/assets.d.ts +8 -0
  117. package/types/webpack/extract/index.d.ts +1 -0
  118. package/types/webpack/extract/meta.d.ts +6 -0
  119. package/types/webpack/extract/modules-count.d.ts +7 -0
  120. package/types/webpack/extract/modules-packages-count.d.ts +7 -0
  121. package/types/webpack/extract/modules-packages-duplicate.d.ts +21 -0
  122. package/types/webpack/extract/modules-packages.d.ts +7 -0
  123. package/types/webpack/extract/modules.d.ts +2 -0
  124. package/types/webpack/index.d.ts +8 -0
  125. package/types/webpack/metrics.d.ts +116 -0
  126. package/types/webpack/selectors.d.ts +41 -0
  127. package/types/webpack/utils.d.ts +8 -0
@@ -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";
@@ -0,0 +1,165 @@
1
+ export declare enum MetricTypeType {
2
+ 'METRIC_TYPE_NUMERIC' = 0,
3
+ 'METRIC_TYPE_SCORE' = 1,
4
+ 'METRIC_TYPE_FILE_SIZE' = 2,
5
+ 'METRIC_TYPE_DURATION' = 3,
6
+ 'METRIC_TYPE_PERCENTAGE' = 4
7
+ }
8
+ export interface MetricTypeConfig {
9
+ label: string;
10
+ description: string;
11
+ type: MetricTypeType;
12
+ }
13
+ export interface MetricType extends MetricTypeConfig {
14
+ formatter: Function;
15
+ biggerIsBetter: boolean;
16
+ }
17
+ export declare enum MetricRunInfoDeltaType {
18
+ 'HIGH_NEGATIVE' = 0,
19
+ 'NEGATIVE' = 1,
20
+ 'LOW_NEGATIVE' = 2,
21
+ 'NO_CHANGE' = 3,
22
+ 'LOW_POSITIVE' = 4,
23
+ 'POSITIVE' = 5,
24
+ 'HIGH_POSITIVE' = 6
25
+ }
26
+ export interface MetricRun {
27
+ value: number;
28
+ }
29
+ export interface MetricRunInfo {
30
+ value: number;
31
+ displayValue: string;
32
+ delta?: number;
33
+ displayDelta?: string;
34
+ displayDeltaPercentage?: string;
35
+ deltaType?: MetricRunInfoDeltaType;
36
+ }
37
+ export interface Metric {
38
+ value: number;
39
+ }
40
+ export interface ModuleMetric extends Metric {
41
+ name: string;
42
+ chunkIds: Array<String>;
43
+ duplicated: boolean;
44
+ }
45
+ export interface PackageMetric extends Metric {
46
+ path: string;
47
+ }
48
+ export interface WebpackMetricsModules {
49
+ metrics: {
50
+ duplicateCode: MetricRun;
51
+ duplicateModulesCount: MetricRun;
52
+ modules: Record<string, ModuleMetric>;
53
+ };
54
+ }
55
+ export interface WebpackMetricsPackages {
56
+ metrics: {
57
+ packages: Record<string, PackageMetric>;
58
+ };
59
+ }
60
+ export interface LighthouseSource {
61
+ lighthouseVersion: string;
62
+ fetchTime: string;
63
+ requestedUrl: string;
64
+ categories: {
65
+ [key: string]: {
66
+ score: number;
67
+ };
68
+ };
69
+ audits: {
70
+ [key: string]: {
71
+ score: number;
72
+ numericValue: number;
73
+ };
74
+ };
75
+ }
76
+ export interface LighthouseMetricsCategoryScores {
77
+ performanceScore: MetricRun;
78
+ accessibilityScore: MetricRun;
79
+ bestPracticesScore: MetricRun;
80
+ seoScore: MetricRun;
81
+ pwaScore: MetricRun;
82
+ }
83
+ export interface LighthouseMetricsScore {
84
+ score: MetricRun;
85
+ }
86
+ export interface LighthouseMetricsAudits {
87
+ speedIndex: MetricRun;
88
+ firstMeaningfulPaint: MetricRun;
89
+ timeToFirstByte: MetricRun;
90
+ firstInteractive: MetricRun;
91
+ totalByteWeight: MetricRun;
92
+ domSize: MetricRun;
93
+ }
94
+ export interface BrowsertimeSourceMetric {
95
+ median: number;
96
+ }
97
+ export interface BrowsertimeSource {
98
+ info?: {
99
+ browsertime: {
100
+ version: string;
101
+ };
102
+ timestamp: string;
103
+ url: string;
104
+ };
105
+ statistics?: {
106
+ timings: {
107
+ firstPaint: BrowsertimeSourceMetric;
108
+ fullyLoaded: BrowsertimeSourceMetric;
109
+ pageTimings: {
110
+ backEndTime: BrowsertimeSourceMetric;
111
+ domContentLoadedTime: BrowsertimeSourceMetric;
112
+ domInteractiveTime: BrowsertimeSourceMetric;
113
+ domainLookupTime: BrowsertimeSourceMetric;
114
+ frontEndTime: BrowsertimeSourceMetric;
115
+ pageDownloadTime: BrowsertimeSourceMetric;
116
+ pageLoadTime: BrowsertimeSourceMetric;
117
+ redirectionTime: BrowsertimeSourceMetric;
118
+ serverConnectionTime: BrowsertimeSourceMetric;
119
+ serverResponseTime: BrowsertimeSourceMetric;
120
+ };
121
+ paintTiming: {
122
+ 'first-contentful-paint': BrowsertimeSourceMetric;
123
+ };
124
+ rumSpeedIndex: BrowsertimeSourceMetric;
125
+ };
126
+ visualmetrics: {
127
+ FirstVisualChange: BrowsertimeSourceMetric;
128
+ LastVisualChange: BrowsertimeSourceMetric;
129
+ PerceptualSpeedIndex: BrowsertimeSourceMetric;
130
+ SpeedIndex: BrowsertimeSourceMetric;
131
+ VisualComplete85: BrowsertimeSourceMetric;
132
+ VisualComplete95: BrowsertimeSourceMetric;
133
+ VisualComplete99: BrowsertimeSourceMetric;
134
+ };
135
+ };
136
+ }
137
+ export interface BrowsertimeMetrics {
138
+ firstPaint: MetricRun;
139
+ fullyLoaded: MetricRun;
140
+ backEndTime: MetricRun;
141
+ domContentLoadedTime: MetricRun;
142
+ domInteractiveTime: MetricRun;
143
+ domainLookupTime: MetricRun;
144
+ frontEndTime: MetricRun;
145
+ pageDownloadTime: MetricRun;
146
+ pageLoadTime: MetricRun;
147
+ redirectionTime: MetricRun;
148
+ serverConnectionTime: MetricRun;
149
+ serverResponseTime: MetricRun;
150
+ firstContentfulPaint: MetricRun;
151
+ rumSpeedIndex: MetricRun;
152
+ firstVisualChange: MetricRun;
153
+ lastVisualChange: MetricRun;
154
+ perceptualSpeedIndex: MetricRun;
155
+ speedIndex: MetricRun;
156
+ visualComplete85: MetricRun;
157
+ visualComplete95: MetricRun;
158
+ visualComplete99: MetricRun;
159
+ }
160
+ export declare enum InsightType {
161
+ ERROR = "ERROR",
162
+ WARNING = "WARNING",
163
+ INFO = "INFO",
164
+ SUCCESS = "SUCCESS"
165
+ }
@@ -0,0 +1,16 @@
1
+ declare namespace _default {
2
+ const COMPONENT_LINK_TOTALS: string;
3
+ const COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_JS: string;
4
+ const COMPONENT_LINK_BUNDLE_ASSETS_INITIAL_CSS: string;
5
+ const COMPONENT_LINK_BUNDLE_ASSETS_CACHE_INVALIDATION: string;
6
+ const COMPONENT_LINK_BUNDLE_ASSETS_COUNT: string;
7
+ const COMPONENT_LINK_BUNDLE_ASSETS_CHUNK_COUNT: string;
8
+ const COMPONENT_LINK_MODULES: string;
9
+ const COMPONENT_LINK_MODULES_DUPLICATE: string;
10
+ const COMPONENT_LINK_CHUNK_MODULES: string;
11
+ const COMPONENT_LINK_PACKAGES_COUNT: string;
12
+ const COMPONENT_LINK_PACKAGES_DUPLICATE: string;
13
+ const COMPONENT_LINK_VIEW_PACKAGE: string;
14
+ const COMPONENT_LINK_BUNDLE_ASSETS_BY_FILE_TYPE: string;
15
+ }
16
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export * from "./browsertime";
2
+ export * from "./config";
3
+ export * from "./constants";
4
+ export * from "./jobs";
5
+ export * from "./report";
6
+ export * from "./utils";
7
+ export * as transformers from "./transformers";
@@ -0,0 +1 @@
1
+ export function createJob(source: any, baseline: any, options?: {}): {};
@@ -0,0 +1 @@
1
+ export function createJobs(sources: any, options: any): any;
@@ -0,0 +1 @@
1
+ export function createSummary(metricPaths: any, baselineSourceMetrics: any, currentSourceMetrics: any): any;
@@ -0,0 +1,2 @@
1
+ export * from "./create-job";
2
+ export * from "./create-jobs";
@@ -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,6 @@
1
+ export function extractAudits(lighthouseSource: any): {
2
+ metrics: {};
3
+ };
4
+ export type CategoryAuditMetrics = {
5
+ metrics: any;
6
+ };
@@ -0,0 +1,6 @@
1
+ export function extractCategoryScores(lighthouseSource: any): {
2
+ metrics: {};
3
+ };
4
+ export type CategoryScoresMetrics = {
5
+ metrics: any;
6
+ };
@@ -0,0 +1 @@
1
+ export function extract(webpackStats: any, baseline: any): {};
@@ -0,0 +1,10 @@
1
+ export function extractScoreCategoryScores(lighthouseSource: any, currentExtractedData?: {}): {
2
+ metrics: {
3
+ score: {
4
+ value: number;
5
+ };
6
+ };
7
+ };
8
+ export type CategoryScoresMetrics = {
9
+ metrics: any;
10
+ };
@@ -0,0 +1 @@
1
+ export function filter(source: Object): any;
@@ -0,0 +1,6 @@
1
+ export * from "./compare";
2
+ export * from "./constants";
3
+ export * from "./extract";
4
+ export * from "./filter";
5
+ export * from "./metrics";
6
+ export * from "./selectors";
@@ -0,0 +1,65 @@
1
+ export namespace metrics {
2
+ namespace score {
3
+ export const label: string;
4
+ export { METRIC_TYPE_SCORE as type };
5
+ }
6
+ namespace performanceScore {
7
+ const label_1: string;
8
+ export { label_1 as label };
9
+ export { METRIC_TYPE_SCORE as type };
10
+ }
11
+ namespace accessibilityScore {
12
+ const label_2: string;
13
+ export { label_2 as label };
14
+ export { METRIC_TYPE_SCORE as type };
15
+ }
16
+ namespace bestPracticesScore {
17
+ const label_3: string;
18
+ export { label_3 as label };
19
+ export { METRIC_TYPE_SCORE as type };
20
+ }
21
+ namespace seoScore {
22
+ const label_4: string;
23
+ export { label_4 as label };
24
+ export { METRIC_TYPE_SCORE as type };
25
+ }
26
+ namespace pwaScore {
27
+ const label_5: string;
28
+ export { label_5 as label };
29
+ export { METRIC_TYPE_SCORE as type };
30
+ }
31
+ namespace speedIndex {
32
+ const label_6: string;
33
+ export { label_6 as label };
34
+ export { METRIC_TYPE_DURATION as type };
35
+ }
36
+ namespace firstMeaningfulPaint {
37
+ const label_7: string;
38
+ export { label_7 as label };
39
+ export { METRIC_TYPE_DURATION as type };
40
+ }
41
+ namespace timeToFirstByte {
42
+ const label_8: string;
43
+ export { label_8 as label };
44
+ export { METRIC_TYPE_DURATION as type };
45
+ }
46
+ namespace firstInteractive {
47
+ const label_9: string;
48
+ export { label_9 as label };
49
+ export { METRIC_TYPE_DURATION as type };
50
+ }
51
+ namespace totalByteWeight {
52
+ const label_10: string;
53
+ export { label_10 as label };
54
+ export { METRIC_TYPE_FILE_SIZE as type };
55
+ }
56
+ namespace domSize {
57
+ const label_11: string;
58
+ export { label_11 as label };
59
+ export { METRIC_TYPE_NUMERIC as type };
60
+ }
61
+ }
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";
@@ -0,0 +1 @@
1
+ export function selectors(job: any): {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as types from './types';
2
+ export declare const getAddRowMetricData: (metricType?: string | undefined) => (row: types.ReportRow) => {
3
+ biggerIsBetter: any;
4
+ label: any;
5
+ changed: boolean;
6
+ runs: any[];
7
+ key: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ import * as types from './types';
2
+ export declare const compareMetrics: (jobs: Array<any>, selectMetrics: (job: any) => any, metricType: string, rowTransformers?: ((row: types.ReportRow) => types.ReportRow)[] | undefined) => types.ReportRow[];
@@ -0,0 +1,14 @@
1
+ export declare const createReport: (jobs: Array<any>) => {
2
+ constructor: Function;
3
+ toString(): string;
4
+ toLocaleString(): string;
5
+ valueOf(): Object;
6
+ hasOwnProperty(v: PropertyKey): boolean;
7
+ isPrototypeOf(v: Object): boolean;
8
+ propertyIsEnumerable(v: PropertyKey): boolean;
9
+ insights?: any;
10
+ createdAt: string;
11
+ version: string;
12
+ runs: any[];
13
+ summary: {};
14
+ };
@@ -0,0 +1,2 @@
1
+ import * as types from './types';
2
+ export declare const getMetricChanged: (runs: Array<types.MetricValue | null>) => boolean;
@@ -0,0 +1,5 @@
1
+ export * from "./add-row-metric-data";
2
+ export * from "./compare-metrics";
3
+ export * from "./create";
4
+ export * from "./get-metric-changed";
5
+ export * from "./merge-metrics-by-key";
@@ -0,0 +1,4 @@
1
+ import * as types from './types';
2
+ declare type RunMetrics = Record<string, types.MetricValue>;
3
+ export declare const mergeMetricsByKey: (runs: Array<RunMetrics>, rowTransformers?: ((row: types.ReportRow) => types.ReportRow)[] | undefined) => Array<types.ReportRow>;
4
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface MetricValue {
2
+ value: number;
3
+ name?: string;
4
+ }
5
+ export interface ReportRow {
6
+ key: string;
7
+ runs: Array<MetricValue | null>;
8
+ }
@@ -0,0 +1,36 @@
1
+ import { InsightType } from '../constants';
2
+ interface OptionBudgetMetric {
3
+ metric: string;
4
+ value: number;
5
+ }
6
+ interface Options {
7
+ budgets?: Array<OptionBudgetMetric>;
8
+ }
9
+ interface BudgetInsight {
10
+ currentValue: number;
11
+ budgetValue: number;
12
+ failed: boolean;
13
+ }
14
+ interface BudgetInsightInfo {
15
+ type: InsightType;
16
+ message: {
17
+ template: string;
18
+ data: Record<string, unknown>;
19
+ };
20
+ source: {
21
+ metricId: string;
22
+ budgetInsight: BudgetInsight;
23
+ };
24
+ }
25
+ interface BudgetInsights {
26
+ [metricId: string]: BudgetInsight;
27
+ }
28
+ interface BudgetsInsightsOutput {
29
+ insights: {
30
+ budgets: BudgetInsights;
31
+ };
32
+ }
33
+ export declare const getExtract: (source: string) => (_: unknown, currentExtractedData: any, __: unknown, options?: Options) => BudgetsInsightsOutput | null;
34
+ export declare const INFO_MESSAGE_TEMPLATE = "<%= metricLabel %> value (<%= currentValue %>) is <%= diffLabel %> <%= budgetValue %> budget";
35
+ export declare const getInfo: (globalMetricId: string, budgetInsight: BudgetInsight) => BudgetInsightInfo;
36
+ export {};
@@ -0,0 +1 @@
1
+ export * as budgetInsights from './budgets-insights';
@@ -0,0 +1,193 @@
1
+ export function getAssetFileTypeFilters(value?: boolean): {};
2
+ export function getAssetEntryTypeFilters(value?: boolean): {};
3
+ export function getModuleSourceTypeFilters(value?: boolean): {
4
+ [x: string]: boolean;
5
+ };
6
+ export function getModuleChunkFilters(chunkIds: any, value: any): any;
7
+ export function getModuleFileTypeFilters(value?: boolean): {};
8
+ export namespace TOTALS {
9
+ const section: string;
10
+ const title: string;
11
+ }
12
+ export namespace BUNDLE_ASSETS_INITIAL_JS {
13
+ const section_1: string;
14
+ export { section_1 as section };
15
+ const title_1: string;
16
+ export { title_1 as title };
17
+ export const params: {
18
+ [x: string]: {
19
+ filters: {};
20
+ };
21
+ };
22
+ }
23
+ export namespace BUNDLE_ASSETS_INITIAL_CSS {
24
+ const section_2: string;
25
+ export { section_2 as section };
26
+ const title_2: string;
27
+ export { title_2 as title };
28
+ const params_1: {
29
+ [x: string]: {
30
+ filters: {};
31
+ };
32
+ };
33
+ export { params_1 as params };
34
+ }
35
+ export namespace BUNDLE_ASSETS_CACHE_INVALIDATION {
36
+ const section_3: string;
37
+ export { section_3 as section };
38
+ const title_3: string;
39
+ export { title_3 as title };
40
+ const params_2: {
41
+ [x: string]: {
42
+ filters: {
43
+ [x: string]: boolean;
44
+ };
45
+ };
46
+ };
47
+ export { params_2 as params };
48
+ }
49
+ export namespace BUNDLE_ASSETS_COUNT {
50
+ const section_4: string;
51
+ export { section_4 as section };
52
+ const title_4: string;
53
+ export { title_4 as title };
54
+ const params_3: {
55
+ [x: string]: {
56
+ filters: {
57
+ [x: string]: boolean;
58
+ };
59
+ };
60
+ };
61
+ export { params_3 as params };
62
+ }
63
+ export namespace BUNDLE_ASSETS_CHUNK_COUNT {
64
+ const section_5: string;
65
+ export { section_5 as section };
66
+ const title_5: string;
67
+ export { title_5 as title };
68
+ const params_4: {
69
+ [x: string]: {
70
+ filters: {};
71
+ };
72
+ };
73
+ export { params_4 as params };
74
+ }
75
+ export namespace BUNDLE_MODULES {
76
+ const section_6: string;
77
+ export { section_6 as section };
78
+ const title_6: string;
79
+ export { title_6 as title };
80
+ const params_5: {
81
+ [x: string]: {
82
+ filters: {
83
+ [x: string]: boolean;
84
+ };
85
+ };
86
+ };
87
+ export { params_5 as params };
88
+ }
89
+ export namespace BUNDLE_MODULES_DUPLICATE {
90
+ const section_7: string;
91
+ export { section_7 as section };
92
+ const title_7: string;
93
+ export { title_7 as title };
94
+ const params_6: {
95
+ [x: string]: {
96
+ filters: {
97
+ [x: string]: boolean;
98
+ };
99
+ };
100
+ };
101
+ export { params_6 as params };
102
+ }
103
+ export function getBundleModulesBySearch(search: any): {
104
+ section: string;
105
+ title: string;
106
+ params: {
107
+ [x: string]: {
108
+ search: any;
109
+ filters: {
110
+ [x: string]: boolean;
111
+ };
112
+ };
113
+ };
114
+ };
115
+ export function getBundleModulesByChunk(chunkIds: any, chunkId: any, fileType?: string): {
116
+ section: string;
117
+ title: string;
118
+ params: {
119
+ [x: string]: {
120
+ filters: any;
121
+ };
122
+ };
123
+ };
124
+ export namespace BUNLDE_PACKAGES_COUNT {
125
+ const section_8: string;
126
+ export { section_8 as section };
127
+ const title_8: string;
128
+ export { title_8 as title };
129
+ const params_7: {
130
+ [x: string]: {
131
+ filters: {
132
+ [x: string]: boolean;
133
+ };
134
+ };
135
+ };
136
+ export { params_7 as params };
137
+ }
138
+ export namespace BUNDLE_PACKAGES_DUPLICATE {
139
+ const section_9: string;
140
+ export { section_9 as section };
141
+ const title_9: string;
142
+ export { title_9 as title };
143
+ const params_8: {
144
+ [x: string]: {
145
+ filters: {
146
+ [x: string]: boolean;
147
+ };
148
+ };
149
+ };
150
+ export { params_8 as params };
151
+ }
152
+ export function getBundleAssetsFileTypeComponentLink(fileType: any, label: any): {
153
+ section: string;
154
+ title: string;
155
+ params: {
156
+ [x: string]: {
157
+ filters: {};
158
+ };
159
+ };
160
+ };
161
+ export function getBundlePackagesByNameComponentLink(search: any): {
162
+ section: string;
163
+ title: string;
164
+ params: {
165
+ [x: string]: {
166
+ search: any;
167
+ filters: {
168
+ [x: string]: boolean;
169
+ };
170
+ };
171
+ };
172
+ };
173
+ export function getComponentStateQueryString(params?: {}): string;
174
+ export const METRIC_COMPONENT_LINKS: Map<string, {
175
+ link: {
176
+ section: string;
177
+ title: string;
178
+ };
179
+ showDelta?: undefined;
180
+ } | {
181
+ link: {
182
+ section: string;
183
+ title: string;
184
+ params: {
185
+ [x: string]: {
186
+ filters: {
187
+ [x: string]: boolean;
188
+ };
189
+ };
190
+ };
191
+ };
192
+ showDelta: boolean;
193
+ }>;
@@ -0,0 +1,2 @@
1
+ export function formatDate(value: any): string;
2
+ export function formatTime(value: any): string;
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,4 @@
1
+ export function getFilenameFileType(filename: string, patterns: Object): string;
2
+ export function getFileType(filename: any): string;
3
+ export function getModuleSourceFileType(moduleSourceFilename: string): string;
4
+ export function getModuleFileType(moduleFilename: string): string;
@@ -0,0 +1,5 @@
1
+ export function formatFileSize(val: any): string;
2
+ export function formatDuration(val: any): string;
3
+ export function formatNumber(val: any): string;
4
+ export function formatCommit(commitSha: any): any;
5
+ export function formatPercentage(val: any): string;