@bundle-stats/ui 3.4.0-beta.0 → 4.0.0-alpha.9
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/app/app.js +6 -21
- package/lib/app/app.stories.js +1 -22
- package/lib/assets/icons.svg +0 -8
- package/lib/components/asset-info/asset-info.js +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +1 -1
- package/lib/components/bundle-assets/index.js +1 -1
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -43
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +1 -20
- package/lib/components/bundle-modules/bundle-modules.js +1 -1
- package/lib/components/bundle-modules/index.js +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +1 -1
- package/lib/components/bundle-packages/index.js +1 -1
- package/lib/components/component-link.js +1 -1
- package/lib/components/index.js +0 -8
- package/lib/components/job-meta/job-meta.js +1 -1
- package/lib/components/job-name/job-name.js +1 -1
- package/lib/components/metrics-table/metrics-table.js +1 -1
- package/lib/components/metrics-table-options/metrics-table-options.js +1 -1
- package/lib/components/module-info/module-info.js +1 -1
- package/lib/components/summary/summary.js +8 -13
- package/lib/components/summary/summary.stories.js +1 -58
- package/lib/components/summary-item/summary-item.js +6 -21
- package/lib/components/summary-item/summary-item.module.css +0 -6
- package/lib/components/summary-item/summary-item.stories.js +53 -65
- package/lib/constants.js +4 -4
- package/lib/layout/box/box.js +1 -1
- package/lib/layout/flex-stack/flex-stack.js +1 -1
- package/lib/layout/footer/footer.js +1 -1
- package/lib/layout/separator.js +1 -1
- package/lib/layout/stack/stack.js +1 -1
- package/lib/query-state.js +1 -1
- package/lib/ui/alert/alert.js +3 -13
- package/lib/ui/container/container.js +1 -1
- package/lib/ui/filters/filters.container.js +3 -3
- package/lib/ui/filters/filters.js +1 -1
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +2 -2
- package/lib/ui/hover-card/hover-card.js +1 -1
- package/lib/ui/hover-card/hover-card.stories.js +1 -1
- package/lib/ui/icon/icon.js +1 -3
- package/lib/ui/input/input.js +1 -1
- package/lib/ui/loader/loader.js +1 -1
- package/lib/ui/logo/logo.js +1 -1
- package/lib/ui/panels/panels.js +1 -1
- package/lib/ui/skeleton/skeleton.js +1 -1
- package/lib/ui/sort-dropdown/sort-dropdown.js +1 -1
- package/lib/ui/tag/tag.js +1 -1
- package/lib/ui/tooltip/tooltip.js +1 -1
- package/lib-esm/app/app.js +6 -20
- package/lib-esm/app/app.stories.js +1 -22
- package/lib-esm/assets/icons.svg +0 -8
- package/lib-esm/components/asset-info/asset-info.js +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +1 -0
- package/lib-esm/components/bundle-assets/index.js +1 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -24
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -18
- package/lib-esm/components/bundle-modules/bundle-modules.js +1 -1
- package/lib-esm/components/bundle-modules/index.js +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +1 -0
- package/lib-esm/components/bundle-packages/index.js +1 -1
- package/lib-esm/components/component-link.js +1 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/job-meta/job-meta.js +1 -1
- package/lib-esm/components/job-name/job-name.js +1 -1
- package/lib-esm/components/metrics-table/metrics-table.js +1 -1
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +1 -1
- package/lib-esm/components/module-info/module-info.js +1 -1
- package/lib-esm/components/summary/summary.js +9 -12
- package/lib-esm/components/summary/summary.stories.js +1 -56
- package/lib-esm/components/summary-item/summary-item.js +5 -18
- package/lib-esm/components/summary-item/summary-item.module.css +0 -6
- package/lib-esm/components/summary-item/summary-item.stories.js +38 -64
- package/lib-esm/constants.js +4 -4
- package/lib-esm/layout/box/box.js +1 -1
- package/lib-esm/layout/flex-stack/flex-stack.js +1 -1
- package/lib-esm/layout/footer/footer.js +1 -1
- package/lib-esm/layout/separator.js +1 -1
- package/lib-esm/layout/stack/stack.js +1 -1
- package/lib-esm/query-state.js +1 -1
- package/lib-esm/ui/alert/alert.js +3 -6
- package/lib-esm/ui/container/container.js +1 -1
- package/lib-esm/ui/filters/filters.container.js +1 -1
- package/lib-esm/ui/filters/filters.js +2 -1
- package/lib-esm/ui/hover-card/hover-card.js +1 -1
- package/lib-esm/ui/hover-card/hover-card.stories.js +1 -1
- package/lib-esm/ui/icon/icon.js +1 -3
- package/lib-esm/ui/input/input.js +1 -1
- package/lib-esm/ui/loader/loader.js +1 -1
- package/lib-esm/ui/logo/logo.js +1 -1
- package/lib-esm/ui/panels/panels.js +1 -1
- package/lib-esm/ui/skeleton/skeleton.js +1 -1
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +1 -1
- package/lib-esm/ui/tag/tag.js +1 -1
- package/lib-esm/ui/tooltip/tooltip.js +1 -1
- package/package.json +22 -22
- package/src/app/app.jsx +5 -12
- package/src/assets/icons.svg +0 -8
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +13 -27
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/src/components/index.js +0 -1
- package/src/components/summary/summary.jsx +7 -8
- package/src/components/summary-item/summary-item.jsx +3 -10
- package/src/components/summary-item/summary-item.module.css +0 -6
- package/src/constants.js +11 -7
- package/src/ui/alert/alert.jsx +2 -7
- package/src/ui/icon/icon.jsx +0 -2
- package/lib/assets/icons/alert-circle.svg +0 -1
- package/lib/assets/icons/check-circle.svg +0 -1
- package/lib/components/budget-info/budget-info.js +0 -74
- package/lib/components/budget-info/budget-info.module.css +0 -40
- package/lib/components/budget-info/budget-info.stories.js +0 -59
- package/lib/components/budget-info/index.js +0 -18
- package/lib/components/budget-insights/budget-insights.js +0 -162
- package/lib/components/budget-insights/budget-insights.module.css +0 -61
- package/lib/components/budget-insights/budget-insights.stories.js +0 -165
- package/lib/components/budget-insights/index.js +0 -18
- package/lib-esm/assets/icons/alert-circle.svg +0 -1
- package/lib-esm/assets/icons/check-circle.svg +0 -1
- package/lib-esm/components/budget-info/budget-info.js +0 -57
- package/lib-esm/components/budget-info/budget-info.module.css +0 -40
- package/lib-esm/components/budget-info/budget-info.stories.js +0 -45
- package/lib-esm/components/budget-info/index.js +0 -1
- package/lib-esm/components/budget-insights/budget-insights.js +0 -112
- package/lib-esm/components/budget-insights/budget-insights.module.css +0 -61
- package/lib-esm/components/budget-insights/budget-insights.stories.js +0 -144
- package/lib-esm/components/budget-insights/index.js +0 -1
- package/src/assets/icons/alert-circle.svg +0 -1
- package/src/assets/icons/check-circle.svg +0 -1
- package/src/components/budget-info/budget-info.jsx +0 -55
- package/src/components/budget-info/budget-info.module.css +0 -40
- package/src/components/budget-info/index.js +0 -1
- package/src/components/budget-insights/budget-insights.jsx +0 -124
- package/src/components/budget-insights/budget-insights.module.css +0 -61
- package/src/components/budget-insights/index.js +0 -1
|
@@ -2,70 +2,44 @@ import React from 'react';
|
|
|
2
2
|
import { SummaryItem } from './summary-item';
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/SummaryItem',
|
|
5
|
-
component: SummaryItem
|
|
6
|
-
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
style: {
|
|
8
|
-
maxWidth: '320px'
|
|
9
|
-
}
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Story, null))],
|
|
11
|
-
args: {
|
|
12
|
-
loading: false,
|
|
13
|
-
id: 'webpack.totalSizeByTypeALL',
|
|
14
|
-
data: {
|
|
15
|
-
current: 120 * 1000,
|
|
16
|
-
baseline: 100 * 1000
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const Template = args => /*#__PURE__*/React.createElement(SummaryItem, args);
|
|
22
|
-
|
|
23
|
-
export const Standard = Template.bind();
|
|
24
|
-
export const SizeLarge = Template.bind();
|
|
25
|
-
SizeLarge.args = {
|
|
26
|
-
size: 'large'
|
|
27
|
-
};
|
|
28
|
-
export const ShowMetricDescription = Template.bind();
|
|
29
|
-
ShowMetricDescription.args = {
|
|
30
|
-
showMetricDescription: true
|
|
31
|
-
};
|
|
32
|
-
export const ShowDeltaFalse = Template.bind();
|
|
33
|
-
ShowDeltaFalse.args = {
|
|
34
|
-
showDelta: false
|
|
5
|
+
component: SummaryItem
|
|
35
6
|
};
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
text: 'Metric is over the budget',
|
|
43
|
-
md: 'Metric is over the budget'
|
|
44
|
-
},
|
|
45
|
-
data: {
|
|
46
|
-
currentValue: 120 * 1000,
|
|
47
|
-
budgetValue: 100 * 1000,
|
|
48
|
-
failed: true
|
|
49
|
-
}
|
|
7
|
+
export const Standard = () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
8
|
+
loading: false,
|
|
9
|
+
id: "webpack.totalSizeByTypeALL",
|
|
10
|
+
data: {
|
|
11
|
+
current: 120 * 1000,
|
|
12
|
+
baseline: 100 * 1000
|
|
50
13
|
}
|
|
51
|
-
};
|
|
52
|
-
export const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
md: 'Metric is under the budget'
|
|
60
|
-
},
|
|
61
|
-
data: {
|
|
62
|
-
currentValue: 120 * 1000,
|
|
63
|
-
budgetValue: 120 * 1024,
|
|
64
|
-
failed: false
|
|
65
|
-
}
|
|
14
|
+
});
|
|
15
|
+
export const SizeLarge = () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
16
|
+
size: "large",
|
|
17
|
+
loading: false,
|
|
18
|
+
id: "webpack.totalSizeByTypeALL",
|
|
19
|
+
data: {
|
|
20
|
+
current: 120 * 1000,
|
|
21
|
+
baseline: 100 * 1000
|
|
66
22
|
}
|
|
67
|
-
};
|
|
68
|
-
export const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
23
|
+
});
|
|
24
|
+
export const ShowMetricDescription = () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
25
|
+
loading: false,
|
|
26
|
+
id: "webpack.totalSizeByTypeALL",
|
|
27
|
+
data: {
|
|
28
|
+
current: 120 * 1000,
|
|
29
|
+
baseline: 100 * 1000
|
|
30
|
+
},
|
|
31
|
+
showMetricDescription: true
|
|
32
|
+
});
|
|
33
|
+
export const ShowDeltaFalse = () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
34
|
+
loading: false,
|
|
35
|
+
id: "webpack.totalSizeByTypeALL",
|
|
36
|
+
data: {
|
|
37
|
+
current: 120 * 1000,
|
|
38
|
+
baseline: 0
|
|
39
|
+
},
|
|
40
|
+
showDelta: false
|
|
41
|
+
});
|
|
42
|
+
export const Loading = () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
43
|
+
loading: true,
|
|
44
|
+
id: "webpack.totalSizeByTypeALL"
|
|
45
|
+
});
|
package/lib-esm/constants.js
CHANGED
|
@@ -25,7 +25,7 @@ export const SECTION_URLS = {
|
|
|
25
25
|
export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({ ...agg,
|
|
26
26
|
[`webpack.sizes.totalSizeByType${fileType}`]: fileType
|
|
27
27
|
}), {});
|
|
28
|
-
export const METRICS_WEBPACK_GENERAL = ['totalSizeByTypeALL', 'totalInitialSizeJS', 'totalInitialSizeCSS', 'cacheInvalidation'];
|
|
29
|
-
export const METRICS_WEBPACK_ASSETS = ['assetCount', 'chunkCount'];
|
|
30
|
-
export const METRICS_WEBPACK_MODULES = ['moduleCount', 'duplicateModulesCount', 'duplicateCode'];
|
|
31
|
-
export const METRICS_WEBPACK_PACKAGES = ['packageCount', 'duplicatePackagesCount'];
|
|
28
|
+
export const METRICS_WEBPACK_GENERAL = ['webpack.totalSizeByTypeALL', 'webpack.totalInitialSizeJS', 'webpack.totalInitialSizeCSS', 'webpack.cacheInvalidation'];
|
|
29
|
+
export const METRICS_WEBPACK_ASSETS = ['webpack.assetCount', 'webpack.chunkCount'];
|
|
30
|
+
export const METRICS_WEBPACK_MODULES = ['webpack.moduleCount', 'webpack.duplicateModulesCount', 'webpack.duplicateCode'];
|
|
31
|
+
export const METRICS_WEBPACK_PACKAGES = ['webpack.packageCount', 'webpack.duplicatePackagesCount'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
package/lib-esm/query-state.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
2
|
import _isEqual from "lodash/isEqual";
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
import { Route, useHistory, useLocation } from 'react-router-dom';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import cx from 'classnames';
|
|
5
3
|
import PropTypes from 'prop-types';
|
|
@@ -9,14 +7,13 @@ export const Alert = props => {
|
|
|
9
7
|
const {
|
|
10
8
|
className,
|
|
11
9
|
kind,
|
|
12
|
-
children
|
|
13
|
-
...restProps
|
|
10
|
+
children
|
|
14
11
|
} = props;
|
|
15
|
-
return /*#__PURE__*/React.createElement(Box,
|
|
12
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
16
13
|
padding: ['xsmall', 'small'],
|
|
17
14
|
outline: true,
|
|
18
15
|
className: cx(css.root, className, css[kind])
|
|
19
|
-
},
|
|
16
|
+
}, children);
|
|
20
17
|
};
|
|
21
18
|
Alert.propTypes = {
|
|
22
19
|
className: PropTypes.string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
+
import "core-js/modules/es.array.includes.js";
|
|
2
3
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
5
|
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { HoverCard } from '.';
|
package/lib-esm/ui/icon/icon.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import css from './icon.module.css';
|
|
7
7
|
const ICONS = {
|
|
8
|
-
ALERT_CIRCLE: 'alert-circle',
|
|
9
8
|
ARROW: 'arrow',
|
|
10
9
|
ARROW_RIGHT_CIRLCE: 'arrow-right-circle',
|
|
11
10
|
CANCEL: 'cancel',
|
|
12
11
|
CLOSE: 'close',
|
|
13
12
|
CLOCK: 'clock',
|
|
14
|
-
CHECK_CIRCLE: 'check-circle',
|
|
15
13
|
COMMIT: 'commit',
|
|
16
14
|
FILTER: 'filter',
|
|
17
15
|
HELP: 'help',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import cx from 'classnames';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
package/lib-esm/ui/logo/logo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
package/lib-esm/ui/tag/tag.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.9",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/cli": "7.17.
|
|
40
|
-
"@babel/core": "7.
|
|
41
|
-
"@babel/plugin-proposal-class-properties": "7.
|
|
42
|
-
"@babel/preset-env": "7.
|
|
43
|
-
"@babel/preset-react": "7.
|
|
39
|
+
"@babel/cli": "7.17.10",
|
|
40
|
+
"@babel/core": "7.18.5",
|
|
41
|
+
"@babel/plugin-proposal-class-properties": "7.17.12",
|
|
42
|
+
"@babel/preset-env": "7.18.2",
|
|
43
|
+
"@babel/preset-react": "7.17.12",
|
|
44
44
|
"@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
|
|
45
|
-
"@storybook/addon-essentials": "6.
|
|
45
|
+
"@storybook/addon-essentials": "6.5.9",
|
|
46
46
|
"@storybook/addon-knobs": "6.4.0",
|
|
47
47
|
"@storybook/addon-postcss": "2.0.0",
|
|
48
|
-
"@storybook/addon-storyshots": "6.
|
|
49
|
-
"@storybook/addons": "6.
|
|
50
|
-
"@storybook/builder-webpack5": "6.
|
|
51
|
-
"@storybook/manager-webpack5": "6.
|
|
52
|
-
"@storybook/react": "6.
|
|
48
|
+
"@storybook/addon-storyshots": "6.5.9",
|
|
49
|
+
"@storybook/addons": "6.5.9",
|
|
50
|
+
"@storybook/builder-webpack5": "6.5.9",
|
|
51
|
+
"@storybook/manager-webpack5": "6.5.9",
|
|
52
|
+
"@storybook/react": "6.5.9",
|
|
53
53
|
"babel-core": "7.0.0-bridge.0",
|
|
54
|
-
"babel-jest": "
|
|
54
|
+
"babel-jest": "28.1.1",
|
|
55
55
|
"babel-plugin-lodash": "3.3.4",
|
|
56
56
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
57
|
-
"chromatic": "6.
|
|
57
|
+
"chromatic": "6.6.3",
|
|
58
58
|
"classnames": "2.3.1",
|
|
59
59
|
"colormap": "2.3.2",
|
|
60
|
-
"core-js": "3.
|
|
60
|
+
"core-js": "3.23.1",
|
|
61
61
|
"cross-env": "7.0.3",
|
|
62
62
|
"enzyme": "3.11.0",
|
|
63
63
|
"enzyme-adapter-react-16": "1.15.6",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"jest": "27.5.1",
|
|
68
68
|
"jest-date-mock": "1.0.8",
|
|
69
69
|
"lodash": "4.17.21",
|
|
70
|
-
"postcss": "8.4.
|
|
70
|
+
"postcss": "8.4.14",
|
|
71
71
|
"prop-types": "15.8.1",
|
|
72
72
|
"react": "16.14.0",
|
|
73
73
|
"react-dom": "16.14.0",
|
|
74
|
-
"react-router-dom": "5.3.
|
|
74
|
+
"react-router-dom": "5.3.1",
|
|
75
75
|
"react-test-renderer": "16.14.0",
|
|
76
76
|
"rimraf": "3.0.2"
|
|
77
77
|
},
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
"core-js": "^3.0.0",
|
|
81
81
|
"lodash": "^4.0.0",
|
|
82
82
|
"prop-types": "^15.0.0",
|
|
83
|
-
"react": "^16.0.0",
|
|
84
|
-
"react-dom": "^16.0.0",
|
|
83
|
+
"react": "^16.0.0 || ^17.0.0",
|
|
84
|
+
"react-dom": "^16.0.0 || ^17.0.0",
|
|
85
85
|
"react-router-dom": "^5.0.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@bundle-stats/utils": "^
|
|
89
|
-
"ariakit": "2.0.0-
|
|
88
|
+
"@bundle-stats/utils": "^4.0.0-alpha.9",
|
|
89
|
+
"ariakit": "2.0.0-next.30",
|
|
90
90
|
"date-fns": "^2.28.0",
|
|
91
91
|
"modern-css-reset": "^1.4.0",
|
|
92
92
|
"query-string": "^7.1.0",
|
|
93
93
|
"use-query-params": "^1.2.3"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "2efc8ee51f6b58a9fb5e1528902ad0b5f9b659a8"
|
|
96
96
|
}
|
package/src/app/app.jsx
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
import { Box } from '../layout/box';
|
|
14
14
|
import { Container } from '../ui/container';
|
|
15
15
|
import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
|
|
16
|
-
import { BudgetInsights } from '../components/budget-insights';
|
|
17
16
|
import { Summary } from '../components/summary';
|
|
18
17
|
import { BundleAssets } from '../components/bundle-assets';
|
|
19
18
|
import { BundleAssetsTotalsChartBars } from '../components/bundle-assets-totals-chart-bars';
|
|
@@ -78,13 +77,10 @@ const OverviewContent = () => {
|
|
|
78
77
|
<Stack space="medium">
|
|
79
78
|
{duplicatePackagesInsights && (
|
|
80
79
|
<Container>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/>
|
|
86
|
-
<BudgetInsights source="webpack" budgets={jobs[0].insights?.webpack?.budgets} />
|
|
87
|
-
</Stack>
|
|
80
|
+
<DuplicatePackagesWarning
|
|
81
|
+
duplicatePackagesCount={duplicatePackagesCount}
|
|
82
|
+
showDelta={jobs.length > 1}
|
|
83
|
+
/>
|
|
88
84
|
</Container>
|
|
89
85
|
)}
|
|
90
86
|
<Container>
|
|
@@ -108,7 +104,6 @@ const AssetsContent = () => {
|
|
|
108
104
|
<Summary
|
|
109
105
|
keys={METRICS_WEBPACK_ASSETS}
|
|
110
106
|
data={jobs?.[0]?.summary}
|
|
111
|
-
budgets={jobs[0].insights?.webpack?.budgets}
|
|
112
107
|
showSummaryItemDelta={jobs?.length !== 1}
|
|
113
108
|
/>
|
|
114
109
|
<Box outline>
|
|
@@ -131,7 +126,6 @@ const ModulesContent = () => {
|
|
|
131
126
|
<Summary
|
|
132
127
|
keys={METRICS_WEBPACK_MODULES}
|
|
133
128
|
data={jobs?.[0]?.summary}
|
|
134
|
-
budgets={jobs[0].insights?.webpack?.budgets}
|
|
135
129
|
showSummaryItemDelta={jobs?.length !== 1}
|
|
136
130
|
/>
|
|
137
131
|
<Box outline>
|
|
@@ -154,7 +148,6 @@ const PackagesContent = () => {
|
|
|
154
148
|
<Summary
|
|
155
149
|
keys={METRICS_WEBPACK_PACKAGES}
|
|
156
150
|
data={jobs?.[0]?.summary}
|
|
157
|
-
budgets={jobs[0].insights?.webpack?.budgets}
|
|
158
151
|
showSummaryItemDelta={jobs?.length !== 1}
|
|
159
152
|
/>
|
|
160
153
|
<Box outline>
|
|
@@ -184,10 +177,10 @@ const AppComponent = ({ version, jobs }) => {
|
|
|
184
177
|
size="large"
|
|
185
178
|
keys={METRICS_WEBPACK_GENERAL}
|
|
186
179
|
data={jobs[0].summary}
|
|
187
|
-
budgets={jobs[0].insights?.webpack?.budgets}
|
|
188
180
|
showSummaryItemDelta={jobs.length !== 1}
|
|
189
181
|
/>
|
|
190
182
|
</Container>
|
|
183
|
+
|
|
191
184
|
<Container className={css.tabsContainer}>
|
|
192
185
|
<Tabs className={css.tabs}>
|
|
193
186
|
<NavLink exact to={URLS.OVERVIEW} activeClassName={css.tabActive}>
|
package/src/assets/icons.svg
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
<svg width="16" height="16">
|
|
2
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-circle" viewBox="0 0 24 24" id="alert-circle" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<circle cx="12" cy="12" r="10"/>
|
|
4
|
-
<path d="M12 8v4M12 16h.01"/>
|
|
5
|
-
</symbol>
|
|
6
2
|
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg">
|
|
7
3
|
<path d="M12 5v14M19 12l-7 7-7-7"/>
|
|
8
4
|
</symbol>
|
|
@@ -14,10 +10,6 @@
|
|
|
14
10
|
<circle cx="12" cy="12" r="10"/>
|
|
15
11
|
<path d="M15 9l-6 6M9 9l6 6"/>
|
|
16
12
|
</symbol>
|
|
17
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle" viewBox="0 0 24 24" id="check-circle" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
-
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"/>
|
|
19
|
-
<path d="M22 4L12 14.01l-3-3"/>
|
|
20
|
-
</symbol>
|
|
21
13
|
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock" id="clock" xmlns="http://www.w3.org/2000/svg">
|
|
22
14
|
<circle cx="12" cy="12" r="10"/>
|
|
23
15
|
<path d="M12 6v6l4 2"/>
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { get } from 'lodash';
|
|
4
3
|
import { getBundleAssetsFileTypeComponentLink } from '@bundle-stats/utils';
|
|
5
4
|
import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
|
|
6
5
|
|
|
7
6
|
import { ASSETS_SIZES_FILE_TYPE_MAP } from '../../constants';
|
|
8
|
-
import { FlexStack } from '../../layout/flex-stack';
|
|
9
7
|
import { MetricsTable } from '../metrics-table';
|
|
10
8
|
import { ComponentLink } from '../component-link';
|
|
11
|
-
import { BudgetInfo } from '../budget-info';
|
|
12
|
-
import css from './bundle-assets-totals-table.module.css';
|
|
13
9
|
|
|
14
10
|
export const BundleAssetsTotalsTable = ({
|
|
15
11
|
className,
|
|
@@ -17,28 +13,18 @@ export const BundleAssetsTotalsTable = ({
|
|
|
17
13
|
customComponentLink: CustomComponentLink,
|
|
18
14
|
...restProps
|
|
19
15
|
}) => {
|
|
20
|
-
const items =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(item)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<CustomComponentLink section={section} title={title} params={params}>
|
|
33
|
-
<FlexStack space="xxxsmall" className={css.itemTitleText}>
|
|
34
|
-
<span>{item.label}</span>
|
|
35
|
-
{budget && <BudgetInfo budgetInsight={budget} />}
|
|
36
|
-
</FlexStack>
|
|
37
|
-
</CustomComponentLink>
|
|
38
|
-
);
|
|
39
|
-
},
|
|
40
|
-
[CustomComponentLink],
|
|
41
|
-
);
|
|
16
|
+
const items = webpack.compareBySection.sizes(jobs);
|
|
17
|
+
|
|
18
|
+
const renderRowHeader = (item) => {
|
|
19
|
+
const fileType = ASSETS_SIZES_FILE_TYPE_MAP[item.key];
|
|
20
|
+
const { section, title, params } = getBundleAssetsFileTypeComponentLink(fileType, item.label);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<CustomComponentLink section={section} title={title} params={params}>
|
|
24
|
+
{item.label}
|
|
25
|
+
</CustomComponentLink>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
42
28
|
|
|
43
29
|
return (
|
|
44
30
|
<MetricsTable
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.title {
|
|
2
|
+
color: var(--color-text-light);
|
|
3
3
|
}
|
package/src/components/index.js
CHANGED
|
@@ -4,7 +4,6 @@ export { BundleAssetsTotalsTable } from './bundle-assets-totals-table';
|
|
|
4
4
|
export { BundleAssetsTotalsChartBars } from './bundle-assets-totals-chart-bars';
|
|
5
5
|
export { BundlePackages } from './bundle-packages';
|
|
6
6
|
export { BundleModules } from './bundle-modules';
|
|
7
|
-
export { BudgetInsights } from './budget-insights';
|
|
8
7
|
export { ComponentLink } from './component-link';
|
|
9
8
|
export { DuplicatePackagesWarning } from './duplicate-packages-warning';
|
|
10
9
|
export { Delta } from './delta';
|
|
@@ -11,14 +11,11 @@ import { ComponentLink } from '../component-link';
|
|
|
11
11
|
import { SummaryItem } from '../summary-item';
|
|
12
12
|
import css from './summary.module.css';
|
|
13
13
|
|
|
14
|
-
const getSourceMetricId = (fullMetricId) => fullMetricId.split('.').slice(1).join('.');
|
|
15
|
-
|
|
16
14
|
export const Summary = ({
|
|
17
15
|
className,
|
|
18
16
|
size,
|
|
19
17
|
keys,
|
|
20
18
|
data,
|
|
21
|
-
budgets,
|
|
22
19
|
loading,
|
|
23
20
|
showSummaryItemDelta,
|
|
24
21
|
summaryItemLink: SummaryItemCustomLink,
|
|
@@ -26,7 +23,7 @@ export const Summary = ({
|
|
|
26
23
|
<Box outline className={cx(css.root, className)}>
|
|
27
24
|
<FlexStack className={css.items}>
|
|
28
25
|
{Array.from(METRIC_COMPONENT_LINKS)
|
|
29
|
-
.filter(([metricId]) => keys.includes(
|
|
26
|
+
.filter(([metricId]) => keys.includes(metricId))
|
|
30
27
|
.map(([metricId, metricOptions]) => (
|
|
31
28
|
<SummaryItem
|
|
32
29
|
key={metricId}
|
|
@@ -36,7 +33,6 @@ export const Summary = ({
|
|
|
36
33
|
size={size}
|
|
37
34
|
id={metricId}
|
|
38
35
|
data={get(data, metricId)}
|
|
39
|
-
budget={get(budgets, ['data', getSourceMetricId(metricId)])}
|
|
40
36
|
loading={loading}
|
|
41
37
|
showMetricDescription
|
|
42
38
|
showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
|
|
@@ -49,7 +45,6 @@ export const Summary = ({
|
|
|
49
45
|
Summary.defaultProps = {
|
|
50
46
|
className: '',
|
|
51
47
|
data: null,
|
|
52
|
-
budgets: null,
|
|
53
48
|
loading: false,
|
|
54
49
|
size: '',
|
|
55
50
|
keys: METRICS_WEBPACK_GENERAL,
|
|
@@ -61,8 +56,12 @@ Summary.propTypes = {
|
|
|
61
56
|
className: PropTypes.string,
|
|
62
57
|
size: PropTypes.string,
|
|
63
58
|
keys: PropTypes.arrayOf(PropTypes.string),
|
|
64
|
-
data: PropTypes.
|
|
65
|
-
|
|
59
|
+
data: PropTypes.shape({
|
|
60
|
+
[PropTypes.string]: PropTypes.shape({
|
|
61
|
+
baseline: PropTypes.number,
|
|
62
|
+
current: PropTypes.number,
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
66
65
|
loading: PropTypes.bool,
|
|
67
66
|
showSummaryItemDelta: PropTypes.bool,
|
|
68
67
|
summaryItemLink: PropTypes.elementType,
|