@bundle-stats/ui 3.1.4-alpha.0 → 3.2.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.js +3 -3
- package/CHANGELOG.md +18 -1
- package/lib/app/app.js +2 -1
- package/lib/app/app.stories.js +2 -1
- package/lib/assets/icons/arrow.svg +1 -0
- package/lib/assets/icons/cancel.svg +1 -0
- package/lib/assets/icons/clock.svg +1 -0
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/commit.svg +1 -0
- package/lib/assets/icons/filter.svg +1 -0
- package/lib/assets/icons/help.svg +1 -0
- package/lib/assets/icons/menu.svg +1 -0
- package/lib/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib/assets/icons/warning.svg +1 -0
- package/lib/assets/icons.svg +1 -0
- package/lib/components/bundle-assets/bundle-assets.constants.js +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +3 -3
- package/lib/components/bundle-assets/bundle-assets.stories.js +19 -7
- package/lib/components/bundle-assets/bundle-assets.utils.js +95 -28
- package/lib/components/bundle-assets/index.js +115 -4
- package/lib/components/bundle-modules/bundle-modules.constants.js +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +3 -3
- package/lib/components/bundle-modules/bundle-modules.utils.js +152 -0
- package/lib/components/bundle-modules/index.js +135 -4
- package/lib/components/bundle-packages/bundle-packages.constants.js +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +27 -7
- package/lib/components/bundle-packages/bundle-packages.module.css +5 -0
- package/lib/components/bundle-packages/{bundle-packages.container.js → bundle-packages.utils.js} +8 -42
- package/lib/components/bundle-packages/index.js +111 -3
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +7 -4
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +4 -3
- package/lib/components/index.js +18 -18
- package/lib/components/metrics-table/metrics-table.js +3 -7
- package/lib/components/metrics-table-search/metrics-table-search.js +2 -1
- package/lib/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib/constants.js +1 -1
- package/lib/hooks/rows-filter.js +28 -0
- package/lib/hooks/rows-sort.js +54 -0
- package/lib/{hocs/with-search.js → hooks/search-params.js} +15 -64
- package/lib/layout/index.js +8 -8
- package/lib/ui/icon/icon.js +4 -191
- package/lib/ui/logo/logo.constants.js +1 -1
- package/lib/ui/popover/popover.js +3 -1
- package/lib/ui/popover/popover.module.css +3 -3
- package/lib/ui/sort-dropdown/sort-dropdown.js +12 -13
- package/lib/ui/sort-dropdown/sort-dropdown.stories.js +2 -2
- package/lib/ui/tooltip/tooltip.js +2 -1
- package/lib-esm/app/app.js +89 -108
- package/lib-esm/app/app.stories.js +50 -70
- package/lib-esm/app/header/header.js +19 -20
- package/lib-esm/assets/icons/arrow.svg +1 -0
- package/lib-esm/assets/icons/cancel.svg +1 -0
- package/lib-esm/assets/icons/clock.svg +1 -0
- package/lib-esm/assets/icons/close.svg +1 -0
- package/lib-esm/assets/icons/commit.svg +1 -0
- package/lib-esm/assets/icons/filter.svg +1 -0
- package/lib-esm/assets/icons/help.svg +1 -0
- package/lib-esm/assets/icons/menu.svg +1 -0
- package/lib-esm/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib-esm/assets/icons/warning.svg +1 -0
- package/lib-esm/assets/icons.svg +1 -0
- package/lib-esm/components/asset-info/asset-info.js +20 -18
- package/lib-esm/components/asset-info/asset-info.stories.js +29 -33
- package/lib-esm/components/browsertime-table/browsertime-table.js +6 -4
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +9 -13
- package/lib-esm/components/bundle-assets/bundle-assets.constants.js +17 -15
- package/lib-esm/components/bundle-assets/bundle-assets.js +148 -151
- package/lib-esm/components/bundle-assets/bundle-assets.stories.js +58 -63
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +65 -21
- package/lib-esm/components/bundle-assets/index.js +89 -2
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +46 -51
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +9 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +13 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +13 -19
- package/lib-esm/components/bundle-modules/bundle-modules.constants.js +17 -15
- package/lib-esm/components/bundle-modules/bundle-modules.js +120 -133
- package/lib-esm/components/bundle-modules/bundle-modules.stories.js +46 -58
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +95 -0
- package/lib-esm/components/bundle-modules/index.js +111 -3
- package/lib-esm/components/bundle-packages/bundle-packages.constants.js +17 -15
- package/lib-esm/components/bundle-packages/bundle-packages.js +81 -77
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +5 -0
- package/lib-esm/components/bundle-packages/bundle-packages.stories.js +34 -46
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +44 -0
- package/lib-esm/components/bundle-packages/index.js +87 -2
- package/lib-esm/components/component-link.js +9 -13
- package/lib-esm/components/delta/delta.js +7 -6
- package/lib-esm/components/delta/delta.stories.js +26 -38
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +15 -10
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +20 -25
- package/lib-esm/components/job-header/job-header.js +14 -11
- package/lib-esm/components/job-header/job-header.stories.js +12 -18
- package/lib-esm/components/job-meta/job-meta.js +14 -18
- package/lib-esm/components/job-meta/job-meta.stories.js +10 -12
- package/lib-esm/components/job-name/job-name.js +11 -17
- package/lib-esm/components/job-name/job-name.stories.js +15 -23
- package/lib-esm/components/jobs-header/jobs-header.js +12 -12
- package/lib-esm/components/jobs-header/jobs-header.stories.js +80 -86
- package/lib-esm/components/lighthouse-table/lighthouse-table.js +6 -4
- package/lib-esm/components/lighthouse-table/lighthouse-table.stories.js +10 -14
- package/lib-esm/components/metric/metric.js +14 -19
- package/lib-esm/components/metric/metric.stories.js +36 -58
- package/lib-esm/components/metrics-table/metrics-table.js +128 -143
- package/lib-esm/components/metrics-table/metrics-table.stories.js +27 -35
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +15 -20
- package/lib-esm/components/metrics-table-options/metrics-table-options.stories.js +6 -12
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +17 -18
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +4 -9
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +9 -7
- package/lib-esm/components/module-info/module-info.js +15 -13
- package/lib-esm/components/module-info/module-info.stories.js +20 -22
- package/lib-esm/components/summary/summary.js +38 -52
- package/lib-esm/components/summary/summary.stories.js +28 -46
- package/lib-esm/components/summary-item/summary-item.js +25 -29
- package/lib-esm/components/summary-item/summary-item.stories.js +40 -50
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +14 -15
- package/lib-esm/constants.js +25 -30
- package/lib-esm/hooks/rows-filter.js +19 -0
- package/lib-esm/hooks/rows-sort.js +21 -0
- package/lib-esm/hooks/search-params.js +166 -0
- package/lib-esm/layout/box/box.js +12 -19
- package/lib-esm/layout/box/box.stories.js +34 -46
- package/lib-esm/layout/flex-stack/flex-stack.js +9 -12
- package/lib-esm/layout/flex-stack/flex-stack.stories.js +39 -49
- package/lib-esm/layout/footer/footer.js +34 -37
- package/lib-esm/layout/footer/footer.stories.js +7 -11
- package/lib-esm/layout/header/header.js +17 -24
- package/lib-esm/layout/header/header.stories.js +34 -43
- package/lib-esm/layout/stack/stack.js +8 -6
- package/lib-esm/layout/stack/stack.stories.js +39 -49
- package/lib-esm/layout/sub-header/sub-header.js +14 -12
- package/lib-esm/layout/sub-header/sub-header.stories.js +57 -69
- package/lib-esm/prototypes/typography.stories.js +48 -58
- package/lib-esm/query-state.js +13 -16
- package/lib-esm/stories/wrapper.js +14 -26
- package/lib-esm/ui/alert/alert.js +6 -4
- package/lib-esm/ui/alert/alert.stories.js +14 -24
- package/lib-esm/ui/container/container.js +9 -15
- package/lib-esm/ui/container/container.stories.js +15 -17
- package/lib-esm/ui/dropdown/dropdown.js +13 -11
- package/lib-esm/ui/dropdown/dropdown.stories.js +19 -26
- package/lib-esm/ui/empty-set/empty-set.js +12 -12
- package/lib-esm/ui/empty-set/empty-set.stories.js +11 -19
- package/lib-esm/ui/file-name/file-name.js +7 -8
- package/lib-esm/ui/file-name/file-name.stories.js +12 -16
- package/lib-esm/ui/filters/filters.container.js +52 -77
- package/lib-esm/ui/filters/filters.js +61 -89
- package/lib-esm/ui/filters/filters.stories.js +81 -100
- package/lib-esm/ui/filters/filters.utils.js +24 -28
- package/lib-esm/ui/filters/index.js +1 -1
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +67 -78
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +67 -77
- package/lib-esm/ui/icon/icon.js +14 -206
- package/lib-esm/ui/icon/icon.stories.js +16 -24
- package/lib-esm/ui/input/input.js +6 -10
- package/lib-esm/ui/input/input.stories.js +8 -12
- package/lib-esm/ui/loader/loader.js +7 -13
- package/lib-esm/ui/loader/loader.stories.js +5 -9
- package/lib-esm/ui/logo/logo.constants.js +6 -6
- package/lib-esm/ui/logo/logo.js +14 -15
- package/lib-esm/ui/logo/logo.stories.js +14 -28
- package/lib-esm/ui/panels/panels.js +14 -27
- package/lib-esm/ui/panels/panels.stories.js +14 -16
- package/lib-esm/ui/popover/popover.js +13 -10
- package/lib-esm/ui/popover/popover.module.css +3 -3
- package/lib-esm/ui/popover/popover.stories.js +7 -11
- package/lib-esm/ui/skeleton/skeleton.js +6 -9
- package/lib-esm/ui/skeleton/skeleton.stories.js +2 -4
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +36 -39
- package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +14 -16
- package/lib-esm/ui/table/table.js +25 -31
- package/lib-esm/ui/table/table.stories.js +84 -102
- package/lib-esm/ui/tabs/tabs.js +14 -25
- package/lib-esm/ui/tabs/tabs.stories.js +4 -6
- package/lib-esm/ui/toolbar/toolbar.js +7 -5
- package/lib-esm/ui/toolbar/toolbar.stories.js +11 -16
- package/lib-esm/ui/tooltip/tooltip.js +15 -17
- package/lib-esm/ui/tooltip/tooltip.stories.js +8 -12
- package/lib-esm/utils.js +15 -28
- package/package.json +19 -27
- package/src/app/app.jsx +4 -1
- package/src/assets/icons/arrow.svg +1 -0
- package/src/assets/icons/cancel.svg +1 -0
- package/src/assets/icons/clock.svg +1 -0
- package/src/assets/icons/close.svg +1 -0
- package/src/assets/icons/commit.svg +1 -0
- package/src/assets/icons/filter.svg +1 -0
- package/src/assets/icons/help.svg +1 -0
- package/src/assets/icons/menu.svg +1 -0
- package/src/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/src/assets/icons/warning.svg +1 -0
- package/src/assets/icons.svg +1 -0
- package/src/components/bundle-assets/bundle-assets.jsx +3 -3
- package/src/components/bundle-assets/bundle-assets.utils.js +96 -17
- package/src/components/bundle-assets/index.jsx +89 -0
- package/src/components/bundle-modules/bundle-modules.jsx +3 -3
- package/src/components/bundle-modules/bundle-modules.utils.js +101 -0
- package/src/components/bundle-modules/index.jsx +107 -0
- package/src/components/bundle-packages/bundle-packages.jsx +21 -8
- package/src/components/bundle-packages/bundle-packages.module.css +5 -0
- package/src/components/bundle-packages/bundle-packages.utils.js +47 -0
- package/src/components/bundle-packages/index.jsx +84 -0
- package/src/components/duplicate-packages-warning/duplicate-packages-warning.jsx +9 -2
- package/src/components/metrics-table/metrics-table.jsx +2 -7
- package/src/components/metrics-table-search/metrics-table-search.jsx +1 -0
- package/src/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/src/hooks/rows-filter.js +16 -0
- package/src/hooks/rows-sort.js +24 -0
- package/src/hooks/search-params.js +153 -0
- package/src/ui/icon/icon.jsx +7 -42
- package/src/ui/popover/popover.jsx +1 -1
- package/src/ui/popover/popover.module.css +3 -3
- package/src/ui/sort-dropdown/sort-dropdown.jsx +11 -11
- package/src/ui/tooltip/tooltip.jsx +1 -1
- package/lib/components/bundle-assets/bundle-assets.container.js +0 -140
- package/lib/components/bundle-modules/bundle-modules.container.js +0 -222
- package/lib/hocs/with-custom-sort.js +0 -75
- package/lib/hocs/with-filtered-items.js +0 -54
- package/lib/ui/icon/assets/arrow.svg +0 -4
- package/lib/ui/icon/assets/branch.svg +0 -3
- package/lib/ui/icon/assets/cancel.svg +0 -4
- package/lib/ui/icon/assets/clock.svg +0 -3
- package/lib/ui/icon/assets/close.svg +0 -4
- package/lib/ui/icon/assets/commit.svg +0 -3
- package/lib/ui/icon/assets/filter.svg +0 -4
- package/lib/ui/icon/assets/help.svg +0 -4
- package/lib/ui/icon/assets/job.svg +0 -3
- package/lib/ui/icon/assets/menu.svg +0 -4
- package/lib/ui/icon/assets/package.svg +0 -3
- package/lib/ui/icon/assets/pull-request.svg +0 -3
- package/lib/ui/icon/assets/repository.svg +0 -3
- package/lib/ui/icon/assets/warning.svg +0 -4
- package/lib-esm/components/bundle-assets/bundle-assets.container.js +0 -119
- package/lib-esm/components/bundle-modules/bundle-modules.container.js +0 -175
- package/lib-esm/components/bundle-packages/bundle-packages.container.js +0 -91
- package/lib-esm/hocs/with-custom-sort.js +0 -43
- package/lib-esm/hocs/with-filtered-items.js +0 -35
- package/lib-esm/hocs/with-search.js +0 -214
- package/lib-esm/ui/icon/assets/arrow.svg +0 -4
- package/lib-esm/ui/icon/assets/branch.svg +0 -3
- package/lib-esm/ui/icon/assets/cancel.svg +0 -4
- package/lib-esm/ui/icon/assets/clock.svg +0 -3
- package/lib-esm/ui/icon/assets/close.svg +0 -4
- package/lib-esm/ui/icon/assets/commit.svg +0 -3
- package/lib-esm/ui/icon/assets/filter.svg +0 -4
- package/lib-esm/ui/icon/assets/help.svg +0 -4
- package/lib-esm/ui/icon/assets/job.svg +0 -3
- package/lib-esm/ui/icon/assets/menu.svg +0 -4
- package/lib-esm/ui/icon/assets/package.svg +0 -3
- package/lib-esm/ui/icon/assets/pull-request.svg +0 -3
- package/lib-esm/ui/icon/assets/repository.svg +0 -3
- package/lib-esm/ui/icon/assets/warning.svg +0 -4
- package/src/components/bundle-assets/bundle-assets.container.js +0 -146
- package/src/components/bundle-assets/index.js +0 -4
- package/src/components/bundle-modules/bundle-modules.container.js +0 -158
- package/src/components/bundle-modules/index.js +0 -4
- package/src/components/bundle-packages/bundle-packages.container.js +0 -93
- package/src/components/bundle-packages/index.js +0 -4
- package/src/hocs/with-custom-sort.jsx +0 -35
- package/src/hocs/with-filtered-items.jsx +0 -34
- package/src/hocs/with-search.jsx +0 -184
- package/src/ui/icon/assets/arrow.svg +0 -4
- package/src/ui/icon/assets/branch.svg +0 -3
- package/src/ui/icon/assets/cancel.svg +0 -4
- package/src/ui/icon/assets/clock.svg +0 -3
- package/src/ui/icon/assets/close.svg +0 -4
- package/src/ui/icon/assets/commit.svg +0 -3
- package/src/ui/icon/assets/filter.svg +0 -4
- package/src/ui/icon/assets/help.svg +0 -4
- package/src/ui/icon/assets/job.svg +0 -3
- package/src/ui/icon/assets/menu.svg +0 -4
- package/src/ui/icon/assets/package.svg +0 -3
- package/src/ui/icon/assets/pull-request.svg +0 -3
- package/src/ui/icon/assets/repository.svg +0 -3
- package/src/ui/icon/assets/warning.svg +0 -4
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
import React from 'react';
|
|
8
2
|
import { storiesOf } from '@storybook/react';
|
|
9
3
|
import { createJobs } from '@bundle-stats/utils';
|
|
@@ -16,78 +10,64 @@ import baselineData from '../../../../fixtures/job.baseline.json'; // eslint-dis
|
|
|
16
10
|
/* eslint-enable */
|
|
17
11
|
|
|
18
12
|
import { App } from '.';
|
|
19
|
-
|
|
20
|
-
webpack:
|
|
13
|
+
const CURRENT_SOURCE = {
|
|
14
|
+
webpack: {
|
|
21
15
|
builtAt: currentData.builtAt,
|
|
22
|
-
hash: currentData.hash
|
|
23
|
-
|
|
16
|
+
hash: currentData.hash,
|
|
17
|
+
...currentData.rawData.webpack
|
|
18
|
+
}
|
|
24
19
|
};
|
|
25
|
-
|
|
26
|
-
webpack:
|
|
20
|
+
const BASELINE_SOURCE = {
|
|
21
|
+
webpack: {
|
|
27
22
|
builtAt: baselineData.builtAt,
|
|
28
|
-
hash: baselineData.hash
|
|
29
|
-
|
|
23
|
+
hash: baselineData.hash,
|
|
24
|
+
...baselineData.rawData.webpack
|
|
25
|
+
}
|
|
30
26
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
const JOBS = createJobs([CURRENT_SOURCE, BASELINE_SOURCE]);
|
|
28
|
+
const NO_BASELINE_JOBS = createJobs([CURRENT_SOURCE]);
|
|
29
|
+
const MULTIPLE_JOBS = createJobs([CURRENT_SOURCE, BASELINE_SOURCE, {
|
|
30
|
+
webpack: {
|
|
34
31
|
builtAt: baselineData.builtAt,
|
|
35
|
-
hash: 'aaaa1111'
|
|
36
|
-
|
|
37
|
-
assets: baselineData.rawData.webpack.assets.filter(
|
|
38
|
-
return asset.name.match(/.(css|js)$/);
|
|
39
|
-
}),
|
|
32
|
+
hash: 'aaaa1111',
|
|
33
|
+
...baselineData.rawData.webpack,
|
|
34
|
+
assets: baselineData.rawData.webpack.assets.filter(asset => asset.name.match(/.(css|js)$/)),
|
|
40
35
|
modules: baselineData.rawData.webpack.modules.slice(0, 100)
|
|
41
|
-
}
|
|
36
|
+
}
|
|
42
37
|
}]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var EMPTY_BASELINE = createJobs([{
|
|
38
|
+
const [CURRENT_JOB, BASELINE_JOB] = JOBS;
|
|
39
|
+
const EMPTY_BASELINE = createJobs([{
|
|
46
40
|
webpack: currentData.rawData.webpack
|
|
47
41
|
}, {
|
|
48
42
|
webpack: null
|
|
49
43
|
}]);
|
|
50
|
-
|
|
51
|
-
stories.addDecorator(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
stories.add('empty
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
version: "1.0"
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
stories.add('multiple baselines', function () {
|
|
84
|
-
return /*#__PURE__*/React.createElement(App, {
|
|
85
|
-
jobs: MULTIPLE_JOBS,
|
|
86
|
-
version: "1.0"
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
stories.add('empty', function () {
|
|
90
|
-
return /*#__PURE__*/React.createElement(App, {
|
|
91
|
-
verison: "1.0"
|
|
92
|
-
});
|
|
93
|
-
});
|
|
44
|
+
const stories = storiesOf('App', module);
|
|
45
|
+
stories.addDecorator(storyFn => /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
style: {
|
|
47
|
+
margin: '-1rem'
|
|
48
|
+
}
|
|
49
|
+
}, storyFn()));
|
|
50
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(App, {
|
|
51
|
+
jobs: [CURRENT_JOB, BASELINE_JOB],
|
|
52
|
+
version: "1.0"
|
|
53
|
+
}));
|
|
54
|
+
stories.add('no insights', () => /*#__PURE__*/React.createElement(App, {
|
|
55
|
+
jobs: [{ ...CURRENT_JOB,
|
|
56
|
+
insights: undefined
|
|
57
|
+
}, BASELINE_JOB]
|
|
58
|
+
}));
|
|
59
|
+
stories.add('no baseline', () => /*#__PURE__*/React.createElement(App, {
|
|
60
|
+
jobs: NO_BASELINE_JOBS,
|
|
61
|
+
version: "1.0"
|
|
62
|
+
}));
|
|
63
|
+
stories.add('empty baseline', () => /*#__PURE__*/React.createElement(App, {
|
|
64
|
+
jobs: EMPTY_BASELINE,
|
|
65
|
+
version: "1.0"
|
|
66
|
+
}));
|
|
67
|
+
stories.add('multiple baselines', () => /*#__PURE__*/React.createElement(App, {
|
|
68
|
+
jobs: MULTIPLE_JOBS,
|
|
69
|
+
version: "1.0"
|
|
70
|
+
}));
|
|
71
|
+
stories.add('empty', () => /*#__PURE__*/React.createElement(App, {
|
|
72
|
+
verison: "1.0"
|
|
73
|
+
}));
|
|
@@ -5,26 +5,25 @@ import { Container } from '../../ui/container';
|
|
|
5
5
|
import { JobsHeader } from '../../components/jobs-header';
|
|
6
6
|
import { Logo } from '../../ui/logo';
|
|
7
7
|
import css from './header.module.css';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
8
|
+
export const Header = ({
|
|
9
|
+
className,
|
|
10
|
+
jobs
|
|
11
|
+
}) => /*#__PURE__*/React.createElement(Container, {
|
|
12
|
+
as: "header",
|
|
13
|
+
className: cx(css.root, className)
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: css.inner
|
|
16
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
17
|
+
className: css.branding,
|
|
18
|
+
href: "https://github.com/relative-ci/bundle-stats",
|
|
19
|
+
target: "_blank",
|
|
20
|
+
rel: "noopener noreferrer nofollow"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Logo, {
|
|
22
|
+
className: css.brandingLogo
|
|
23
|
+
}, "BundleStats")), /*#__PURE__*/React.createElement(JobsHeader, {
|
|
24
|
+
className: css.jobs,
|
|
25
|
+
jobs: jobs
|
|
26
|
+
})));
|
|
28
27
|
Header.propTypes = {
|
|
29
28
|
className: PropTypes.string,
|
|
30
29
|
jobs: PropTypes.arrayOf(PropTypes.object)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down"><line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" transform="rotate(-90deg)"><line x1="12" y1="20" x2="12" y2="10"></line><line x1="18" y1="20" x2="18" y2="4"></line><line x1="6" y1="20" x2="6" y2="16"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-triangle"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16"><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="afeather afeather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg"><path d="M12 5v14M19 12l-7 7-7-7"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="bfeather bfeather-x-circle" id="cancel" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M15 9l-6 6M9 9l6 6"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="cfeather cfeather-clock" id="clock" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="dfeather dfeather-x" id="close" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="efeather efeather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="4"/><path d="M1.05 12H7M17.01 12h5.95"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ffeather ffeather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg"><path d="M12 20V10M18 20V4M6 20v-4"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="gfeather gfeather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="hfeather hfeather-menu" id="menu" xmlns="http://www.w3.org/2000/svg"><path d="M3 12h18M3 6h18M3 18h18"/></symbol><symbol viewBox="0 0 24 24" fill="currentColor" id="sort" xmlns="http://www.w3.org/2000/svg"><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/><path d="M0 0h24v24H0z" fill="none"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="jfeather jfeather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"/></symbol></svg>
|
|
@@ -12,13 +12,13 @@ import { FileName } from '../../ui/file-name';
|
|
|
12
12
|
import { ComponentLink } from '../component-link';
|
|
13
13
|
import css from './asset-info.module.css';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const ChunkModulesLink = ({
|
|
16
|
+
as: Component,
|
|
17
|
+
chunks,
|
|
18
|
+
chunkId,
|
|
19
|
+
name
|
|
20
|
+
}) => {
|
|
21
|
+
const chunk = _find(chunks, {
|
|
22
22
|
id: chunkId
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -26,9 +26,9 @@ var ChunkModulesLink = function ChunkModulesLink(_ref) {
|
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const chunkIds = _map(chunks, 'id');
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const fileType = getModuleFileType(name);
|
|
32
32
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
33
33
|
className: css.viewModules
|
|
34
34
|
}, getBundleModulesByChunk(chunkIds, chunkId, fileType)), "View chunk modules");
|
|
@@ -46,18 +46,20 @@ ChunkModulesLink.defaultProps = {
|
|
|
46
46
|
chunkId: '',
|
|
47
47
|
name: ''
|
|
48
48
|
};
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
export const AssetInfo = props => {
|
|
50
|
+
const {
|
|
51
|
+
className,
|
|
52
|
+
chunks,
|
|
53
|
+
item,
|
|
54
|
+
labels,
|
|
55
|
+
CustomComponentLink
|
|
56
|
+
} = props;
|
|
55
57
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
56
58
|
space: "xsmall",
|
|
57
59
|
className: cx(css.root, className)
|
|
58
|
-
}, item.runs.map(
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
}, item.runs.map((run, index) => {
|
|
61
|
+
const Title = index !== 0 ? 'h4' : 'h3';
|
|
62
|
+
const key = `asset-info-${(run == null ? void 0 : run.name) || index}-${index}`;
|
|
61
63
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
62
64
|
space: "xxxsmall",
|
|
63
65
|
key: key
|
|
@@ -2,38 +2,34 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { AssetInfo } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('Components/AssetInfo', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: 'static/vendor.abcd1234.js'
|
|
12
|
-
}, {
|
|
13
|
-
name: 'static/vendor.defg5678.js'
|
|
14
|
-
}]
|
|
15
|
-
},
|
|
16
|
-
labels: ['Job #2', 'Job #1']
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
stories.add('with chunks', function () {
|
|
20
|
-
return /*#__PURE__*/React.createElement(AssetInfo, {
|
|
21
|
-
item: {
|
|
22
|
-
runs: [{
|
|
23
|
-
name: 'static/vendor.abcd1234.js',
|
|
24
|
-
chunkId: '1'
|
|
25
|
-
}, {
|
|
26
|
-
name: 'static/vendor.defg5678.js',
|
|
27
|
-
chunkId: '2'
|
|
28
|
-
}]
|
|
29
|
-
},
|
|
30
|
-
chunks: [{
|
|
31
|
-
id: '1',
|
|
32
|
-
name: 'vendor'
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(AssetInfo, {
|
|
8
|
+
item: {
|
|
9
|
+
runs: [{
|
|
10
|
+
name: 'static/vendor.abcd1234.js'
|
|
33
11
|
}, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
12
|
+
name: 'static/vendor.defg5678.js'
|
|
13
|
+
}]
|
|
14
|
+
},
|
|
15
|
+
labels: ['Job #2', 'Job #1']
|
|
16
|
+
}));
|
|
17
|
+
stories.add('with chunks', () => /*#__PURE__*/React.createElement(AssetInfo, {
|
|
18
|
+
item: {
|
|
19
|
+
runs: [{
|
|
20
|
+
name: 'static/vendor.abcd1234.js',
|
|
21
|
+
chunkId: '1'
|
|
22
|
+
}, {
|
|
23
|
+
name: 'static/vendor.defg5678.js',
|
|
24
|
+
chunkId: '2'
|
|
25
|
+
}]
|
|
26
|
+
},
|
|
27
|
+
chunks: [{
|
|
28
|
+
id: '1',
|
|
29
|
+
name: 'vendor'
|
|
30
|
+
}, {
|
|
31
|
+
id: '2',
|
|
32
|
+
name: 'app~common~utils~shared'
|
|
33
|
+
}],
|
|
34
|
+
labels: ['Job #2', 'Job #1']
|
|
35
|
+
}));
|
|
@@ -2,10 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import * as browsertime from '@bundle-stats/utils';
|
|
4
4
|
import { MetricsTable } from '../metrics-table';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const BrowsertimeTable = props => {
|
|
6
|
+
const {
|
|
7
|
+
className,
|
|
8
|
+
jobs
|
|
9
|
+
} = props;
|
|
10
|
+
const items = browsertime.compare(jobs);
|
|
9
11
|
return /*#__PURE__*/React.createElement(MetricsTable, {
|
|
10
12
|
className: className,
|
|
11
13
|
items: items,
|
|
@@ -5,21 +5,17 @@ import * as browsertime from '@bundle-stats/utils/lib-esm/browsertime';
|
|
|
5
5
|
import browsertimeSourceFixtures from '../../../../../fixtures/browsertime.json';
|
|
6
6
|
import { getWrapperDecorator } from '../../stories';
|
|
7
7
|
import { BrowsertimeTable } from '.';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const browsertimeFixtures = browsertime.filter(browsertimeSourceFixtures);
|
|
9
|
+
const JOBS = createJobs([{
|
|
10
10
|
browsertime: browsertimeFixtures
|
|
11
11
|
}, {
|
|
12
12
|
browsertime: browsertimeFixtures
|
|
13
13
|
}]);
|
|
14
|
-
|
|
14
|
+
const stories = storiesOf('Components/BrowsertimeTable', module);
|
|
15
15
|
stories.addDecorator(getWrapperDecorator());
|
|
16
|
-
stories.add('default',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return /*#__PURE__*/React.createElement(BrowsertimeTable, {
|
|
23
|
-
jobs: [JOBS[1]]
|
|
24
|
-
});
|
|
25
|
-
});
|
|
16
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(BrowsertimeTable, {
|
|
17
|
+
jobs: JOBS
|
|
18
|
+
}));
|
|
19
|
+
stories.add('no baseline', () => /*#__PURE__*/React.createElement(BrowsertimeTable, {
|
|
20
|
+
jobs: [JOBS[1]]
|
|
21
|
+
}));
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
export const SORT_BY_NAME = 'name';
|
|
2
|
+
export const SORT_BY_SIZE = 'size';
|
|
3
|
+
export const SORT_BY_DELTA = 'delta';
|
|
4
|
+
export const SORT_BY = {
|
|
5
|
+
[SORT_BY_NAME]: {
|
|
6
|
+
label: 'Name',
|
|
7
|
+
defaultDirection: 'asc'
|
|
8
|
+
},
|
|
9
|
+
[SORT_BY_DELTA]: {
|
|
10
|
+
label: 'Delta',
|
|
11
|
+
defaultDirection: 'desc'
|
|
12
|
+
},
|
|
13
|
+
[SORT_BY_SIZE]: {
|
|
14
|
+
label: 'Size',
|
|
15
|
+
defaultDirection: 'desc'
|
|
16
|
+
}
|
|
17
|
+
};
|