@bundle-stats/ui 4.3.0-rc.2 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.module.css +2 -2
- package/lib/assets/icons.svg +3 -0
- package/lib/assets/icons.svg.js +2 -0
- package/lib/assets/icons.svg.js.map +1 -1
- package/lib/components/asset-info/asset-info.js +8 -1
- package/lib/components/asset-info/asset-info.js.map +1 -1
- package/lib/components/asset-info/asset-info.module.css +10 -0
- package/lib/components/bundle-assets/bundle-assets.utils.js +3 -1
- package/lib/components/bundle-assets/bundle-assets.utils.js.map +1 -1
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +4 -2
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js.map +1 -1
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +11 -11
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.utils.js +5 -5
- package/lib/components/bundle-modules/bundle-modules.utils.js.map +1 -1
- package/lib/components/bundle-modules/index.js +1 -1
- package/lib/components/bundle-modules/index.js.map +1 -1
- package/lib/components/index.js +1 -3
- package/lib/components/index.js.map +1 -1
- package/lib/components/job-header/job-header.js +12 -11
- package/lib/components/job-header/job-header.js.map +1 -1
- package/lib/components/jobs-header/index.js.map +1 -1
- package/lib/components/jobs-header/jobs-header.js +23 -14
- package/lib/components/jobs-header/jobs-header.js.map +1 -1
- package/lib/components/jobs-header/jobs-header.module.css +21 -3
- package/lib/components/module-info/module-info.js +20 -9
- package/lib/components/module-info/module-info.js.map +1 -1
- package/lib/components/module-info/module-info.module.css +7 -2
- package/lib/components/package-info/package-info.js +15 -8
- package/lib/components/package-info/package-info.js.map +1 -1
- package/lib/components/package-info/package-info.module.css +10 -0
- package/lib/ui/icon/icon.js +1 -0
- package/lib/ui/icon/icon.js.map +1 -1
- package/lib/ui/tooltip/tooltip.module.css +0 -1
- package/lib-esm/app/app.module.css +2 -2
- package/lib-esm/assets/icons.svg +3 -0
- package/lib-esm/assets/icons.svg.js +2 -0
- package/lib-esm/assets/icons.svg.js.map +1 -1
- package/lib-esm/components/asset-info/asset-info.js +9 -2
- package/lib-esm/components/asset-info/asset-info.js.map +1 -1
- package/lib-esm/components/asset-info/asset-info.module.css +10 -0
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +3 -1
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +4 -2
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +11 -11
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +3 -3
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js.map +1 -1
- package/lib-esm/components/bundle-modules/index.js +2 -2
- package/lib-esm/components/bundle-modules/index.js.map +1 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/job-header/job-header.js +12 -11
- package/lib-esm/components/job-header/job-header.js.map +1 -1
- package/lib-esm/components/jobs-header/index.js.map +1 -1
- package/lib-esm/components/jobs-header/jobs-header.js +22 -13
- package/lib-esm/components/jobs-header/jobs-header.js.map +1 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +21 -3
- package/lib-esm/components/module-info/module-info.js +21 -10
- package/lib-esm/components/module-info/module-info.js.map +1 -1
- package/lib-esm/components/module-info/module-info.module.css +7 -2
- package/lib-esm/components/package-info/package-info.js +15 -8
- package/lib-esm/components/package-info/package-info.js.map +1 -1
- package/lib-esm/components/package-info/package-info.module.css +10 -0
- package/lib-esm/ui/icon/icon.js +1 -0
- package/lib-esm/ui/icon/icon.js.map +1 -1
- package/lib-esm/ui/tooltip/tooltip.module.css +0 -1
- package/package.json +8 -8
- package/src/app/app.module.css +2 -2
- package/src/assets/icons/external-link.svg +1 -0
- package/src/assets/icons.svg +3 -0
- package/src/assets/icons.svg.jsx +13 -0
- package/src/components/asset-info/asset-info.module.css +10 -0
- package/src/components/asset-info/asset-info.tsx +30 -9
- package/src/components/bundle-assets/bundle-assets.utils.js +3 -2
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +3 -2
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +1 -1
- package/src/components/bundle-modules/bundle-modules.jsx +12 -11
- package/src/components/bundle-modules/bundle-modules.utils.js +5 -3
- package/src/components/bundle-modules/index.jsx +2 -2
- package/src/components/index.js +0 -1
- package/src/components/job-header/job-header.jsx +16 -13
- package/src/components/jobs-header/jobs-header.module.css +21 -3
- package/src/components/jobs-header/jobs-header.stories.tsx +51 -0
- package/src/components/jobs-header/jobs-header.tsx +91 -0
- package/src/components/module-info/module-info.module.css +7 -2
- package/src/components/module-info/module-info.tsx +45 -3
- package/src/components/package-info/package-info.module.css +10 -0
- package/src/components/package-info/package-info.tsx +46 -17
- package/src/ui/icon/icon.jsx +1 -0
- package/src/ui/tooltip/tooltip.module.css +0 -1
- package/types/components/asset-info/asset-info.d.ts +1 -0
- package/types/components/bundle-modules/bundle-modules.utils.d.ts +1 -1
- package/types/components/index.d.ts +0 -1
- package/types/components/jobs-header/index.d.ts +1 -1
- package/types/components/jobs-header/jobs-header.d.ts +18 -15
- package/types/components/module-info/module-info.d.ts +2 -0
- package/types/ui/icon/icon.d.ts +1 -0
- package/lib/components/job-meta/index.js +0 -18
- package/lib/components/job-meta/index.js.map +0 -1
- package/lib/components/job-meta/job-meta.js +0 -34
- package/lib/components/job-meta/job-meta.js.map +0 -1
- package/lib/components/job-meta/job-meta.module.css +0 -19
- package/lib-esm/components/job-meta/index.js +0 -2
- package/lib-esm/components/job-meta/index.js.map +0 -1
- package/lib-esm/components/job-meta/job-meta.js +0 -27
- package/lib-esm/components/job-meta/job-meta.js.map +0 -1
- package/lib-esm/components/job-meta/job-meta.module.css +0 -19
- package/src/components/job-meta/index.js +0 -1
- package/src/components/job-meta/job-meta.jsx +0 -47
- package/src/components/job-meta/job-meta.module.css +0 -19
- package/src/components/jobs-header/jobs-header.jsx +0 -43
- package/types/components/job-meta/index.d.ts +0 -1
- package/types/components/job-meta/job-meta.d.ts +0 -18
- /package/src/components/jobs-header/{index.js → index.ts} +0 -0
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import cx from 'classnames';
|
|
3
|
+
import { formatDateTime } from '@bundle-stats/utils';
|
|
4
4
|
import I18N from '../../i18n';
|
|
5
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
6
|
-
import {
|
|
6
|
+
import { Stack } from '../../layout/stack';
|
|
7
|
+
import { Icon } from '../../ui/icon';
|
|
8
|
+
import { Tag } from '../../ui/tag';
|
|
7
9
|
import css from './jobs-header.module.css';
|
|
10
|
+
export const Item = (props) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { className, tag, job } = props;
|
|
13
|
+
const { builtAt, hash } = ((_a = job.meta) === null || _a === void 0 ? void 0 : _a.webpack) || {};
|
|
14
|
+
const rootClassName = cx(css.item, className);
|
|
15
|
+
return (React.createElement(Stack, { className: rootClassName, space: "xxsmall" },
|
|
16
|
+
React.createElement(FlexStack, { space: "xsmall", alignItems: "center" },
|
|
17
|
+
React.createElement(FlexStack, { space: "xxxsmall", as: "h1", className: css.itemTitle },
|
|
18
|
+
React.createElement("span", null, `#${job.internalBuildNumber}`),
|
|
19
|
+
tag && React.createElement(Tag, { className: css.itemTag }, tag)),
|
|
20
|
+
builtAt && (React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", inline: true, as: "span", title: builtAt, className: css.itemMeta },
|
|
21
|
+
React.createElement(Icon, { glyph: "clock", className: css.itemMetaIcon }),
|
|
22
|
+
React.createElement("span", { className: css.itemMetaText }, formatDateTime({ dateStyle: 'medium', timeStyle: 'medium' }, builtAt)))),
|
|
23
|
+
hash && (React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", inline: true, title: "Webpack bundle hash", className: css.itemMeta },
|
|
24
|
+
React.createElement(Icon, { glyph: "commit", className: css.itemMetaIcon }),
|
|
25
|
+
React.createElement("span", { className: css.itemMetaText }, hash.slice(0, 7)))))));
|
|
26
|
+
};
|
|
8
27
|
export const JobsHeader = (props) => {
|
|
9
28
|
const { className, jobs } = props;
|
|
10
29
|
const rootClassName = cx(css.root, className);
|
|
11
|
-
return (React.createElement(FlexStack, { className: rootClassName
|
|
12
|
-
};
|
|
13
|
-
JobsHeader.propTypes = {
|
|
14
|
-
className: PropTypes.string,
|
|
15
|
-
jobs: PropTypes.arrayOf(PropTypes.shape({
|
|
16
|
-
internalBuildNumber: PropTypes.number,
|
|
17
|
-
})),
|
|
18
|
-
};
|
|
19
|
-
JobsHeader.defaultProps = {
|
|
20
|
-
className: '',
|
|
21
|
-
jobs: null,
|
|
30
|
+
return (React.createElement(FlexStack, { className: rootClassName }, jobs === null || jobs === void 0 ? void 0 : jobs.map((job, index) => (React.createElement(Item, { key: job.internalBuildNumber || index, job: job, tag: index === 0 ? I18N.CURRENT : I18N.BASELINE })))));
|
|
22
31
|
};
|
|
23
32
|
//# sourceMappingURL=jobs-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs-header.js","sourceRoot":"","sources":["../../../src/components/jobs-header/jobs-header.
|
|
1
|
+
{"version":3,"file":"jobs-header.js","sourceRoot":"","sources":["../../../src/components/jobs-header/jobs-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAA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,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
align-items: stretch;
|
|
3
|
-
flex-wrap: wrap;
|
|
4
2
|
padding: var(--space-small) 0;
|
|
5
3
|
}
|
|
6
4
|
|
|
7
5
|
.item {
|
|
8
6
|
flex: 0 0 auto;
|
|
9
|
-
padding: 0 var(--space-
|
|
7
|
+
padding: 0 var(--space-small);
|
|
10
8
|
border-left: 1px solid var(--color-outline);
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -14,3 +12,23 @@
|
|
|
14
12
|
border-left: 0;
|
|
15
13
|
padding-left: 0;
|
|
16
14
|
}
|
|
15
|
+
|
|
16
|
+
.itemTitle {
|
|
17
|
+
font-size: var(--size-xlarge);
|
|
18
|
+
line-height: 1;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
vertical-align: top;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.itemTag {
|
|
24
|
+
margin-left: var(--space-xxsmall);
|
|
25
|
+
vertical-align: top;
|
|
26
|
+
outline: 1px solid var(--color-outline);
|
|
27
|
+
background: var(--color-highlight);
|
|
28
|
+
color: var(--color-text-light);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.itemMeta {
|
|
32
|
+
font-size: var(--size-small);
|
|
33
|
+
color: var(--color-text-light);
|
|
34
|
+
}
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
4
|
import noop from 'lodash/noop';
|
|
5
|
-
import { BUNDLE_MODULES_DUPLICATE, getBundleModulesByChunk } from '@bundle-stats/utils';
|
|
5
|
+
import { BUNDLE_MODULES_DUPLICATE, FILE_TYPE_LABELS, MODULE_SOURCE_TYPE_LABELS, getBundleModulesByChunk, getBundleModulesByFileTpe, getBundleModulesBySource, } from '@bundle-stats/utils';
|
|
6
6
|
import { Tag } from '../../ui/tag';
|
|
7
7
|
import { ComponentLink } from '../component-link';
|
|
8
8
|
import { EntryInfo } from '../entry-info';
|
|
@@ -19,14 +19,25 @@ export const ModuleInfo = (props) => {
|
|
|
19
19
|
return (React.createElement("div", null,
|
|
20
20
|
React.createElement(Tag, { as: CustomComponentLink, ...BUNDLE_MODULES_DUPLICATE, onClick: onClick, kind: "danger" }, "Duplicate")));
|
|
21
21
|
}, [item]);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const fileTypeLabel = FILE_TYPE_LABELS[item.fileType];
|
|
23
|
+
const sourceTypeLabel = item.thirdParty
|
|
24
|
+
? MODULE_SOURCE_TYPE_LABELS.THIRD_PARTY
|
|
25
|
+
: MODULE_SOURCE_TYPE_LABELS.FIRST_PARTY;
|
|
26
|
+
return (React.createElement(EntryInfo, { item: item, labels: labels, tags: tags, className: rootClassName },
|
|
27
|
+
!isEmpty(currentRun === null || currentRun === void 0 ? void 0 : currentRun.chunkIds) && (React.createElement("div", { className: css.chunks },
|
|
28
|
+
React.createElement("span", { className: css.label }, "Chunks"),
|
|
29
|
+
currentRun.chunkIds.map((chunkId) => {
|
|
30
|
+
const chunk = chunks === null || chunks === void 0 ? void 0 : chunks.find(({ id }) => id === chunkId);
|
|
31
|
+
if (!chunk) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return (React.createElement(Tag, { as: CustomComponentLink, ...getBundleModulesByChunk(chunkIds, chunkId), onClick: onClick, className: css.chunksItem }, chunk.name));
|
|
35
|
+
}))),
|
|
36
|
+
(item === null || item === void 0 ? void 0 : item.fileType) && (React.createElement("p", null,
|
|
37
|
+
React.createElement("span", { className: css.label }, "File type"),
|
|
38
|
+
React.createElement(Tag, { as: CustomComponentLink, ...getBundleModulesByFileTpe(item.fileType, fileTypeLabel), onClick: onClick }, fileTypeLabel))),
|
|
39
|
+
React.createElement("p", null,
|
|
40
|
+
React.createElement("span", { className: css.label }, "Source"),
|
|
41
|
+
React.createElement(Tag, { as: CustomComponentLink, ...getBundleModulesBySource(item.thirdParty || false, sourceTypeLabel), onClick: onClick }, sourceTypeLabel))));
|
|
31
42
|
};
|
|
32
43
|
//# sourceMappingURL=module-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-info.js","sourceRoot":"","sources":["../../../src/components/module-info/module-info.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"module-info.js","sourceRoot":"","sources":["../../../src/components/module-info/module-info.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EAEzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAiB3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAoD,EAAE,EAAE;;IACjF,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,MAAM,EACN,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,EAAE,EACb,mBAAmB,EA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AAO,CAAC,CAAC;gBAEvD,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,IAAI,CAAC;iBACb;gBAED,OAAO,CACL,oBAAC,GAAG,IACF,EAAE,EAAE,mBAAmB,KACnB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC9C,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,GAAG,CAAC,UAAU,IAExB,KAAK,CAAC,IAAI,CACP,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACP;QAEA,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,KAAI,CACjB;YACE,8BAAM,SAAS,EAAE,GAAG,CAAC,KAAK,gBAAkB;YAC5C,oBAAC,GAAG,IACF,EAAE,EAAE,mBAAmB,KACnB,yBAAyB,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAC3D,OAAO,EAAE,OAAO,IAEf,aAAa,CACV,CACJ,CACL;QAED;YACE,8BAAM,SAAS,EAAE,GAAG,CAAC,KAAK,aAAe;YACzC,oBAAC,GAAG,IACF,EAAE,EAAE,mBAAmB,KACnB,wBAAwB,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,EAAE,eAAe,CAAC,EACvE,OAAO,EAAE,OAAO,IAEf,eAAe,CACZ,CACJ,CACM,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -8,17 +8,20 @@ import { FileName } from '../../ui/file-name';
|
|
|
8
8
|
import { Tag } from '../../ui/tag';
|
|
9
9
|
import { EntryInfo } from '../entry-info';
|
|
10
10
|
import css from './package-info.module.css';
|
|
11
|
+
import { Icon } from '../../ui';
|
|
11
12
|
export const PackageInfo = (props) => {
|
|
12
13
|
var _a, _b;
|
|
13
|
-
const { className = '', name, item, labels, customComponentLink: CustomComponentLink = ComponentLink, onClick = noop } = props;
|
|
14
|
-
const fallbackPackagePath = `node_modules/${item.label
|
|
14
|
+
const { className = '', name, item, labels, customComponentLink: CustomComponentLink = ComponentLink, onClick = noop, } = props;
|
|
15
|
+
const fallbackPackagePath = `node_modules/${item.label
|
|
16
|
+
.split(PACKAGES_SEPARATOR)
|
|
17
|
+
.join('/node_modules/')}`;
|
|
15
18
|
const normalizedPackagePath = `${((_b = (_a = item.runs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.path) || fallbackPackagePath}/`;
|
|
16
19
|
const [normalizedName, packageId] = name.split(PACKAGE_ID_SEPARATOR);
|
|
17
20
|
const packageTitle = useMemo(() => (React.createElement("span", { className: css.packageTitle },
|
|
18
21
|
React.createElement("span", { className: css.packageTitleText }, normalizedName),
|
|
19
|
-
packageId && React.createElement("span", { className: css.packageTitleId },
|
|
22
|
+
packageId && (React.createElement("span", { className: css.packageTitleId },
|
|
20
23
|
PACKAGE_ID_SEPARATOR,
|
|
21
|
-
packageId))), [normalizedName, packageId]);
|
|
24
|
+
packageId)))), [normalizedName, packageId]);
|
|
22
25
|
const tags = useMemo(() => {
|
|
23
26
|
if (!item.duplicate) {
|
|
24
27
|
return null;
|
|
@@ -29,14 +32,18 @@ export const PackageInfo = (props) => {
|
|
|
29
32
|
return (React.createElement(EntryInfo, { itemTitle: packageTitle, item: item, labels: labels, tags: tags, runNameSelector: "path", className: className },
|
|
30
33
|
React.createElement(Stack, { space: "small" },
|
|
31
34
|
React.createElement("p", null,
|
|
32
|
-
"
|
|
35
|
+
React.createElement("span", { className: css.label }, "Path"),
|
|
33
36
|
React.createElement(FileName, { name: normalizedPackagePath, className: css.fileName })),
|
|
34
37
|
React.createElement(Stack, { space: "xxxsmall" },
|
|
35
38
|
item.duplicate && (React.createElement("div", null,
|
|
36
|
-
React.createElement(CustomComponentLink, { ...getBundlePackagesByNameComponentLink(normalizedName) }, "View all duplicate instances"))),
|
|
39
|
+
React.createElement(CustomComponentLink, { ...getBundlePackagesByNameComponentLink(normalizedName), onClick: onClick }, "View all duplicate instances"))),
|
|
37
40
|
React.createElement(CustomComponentLink, { ...getBundleModulesBySearch(normalizedPackagePath) }, "Search modules by package path")),
|
|
38
41
|
React.createElement(FlexStack, { space: "xsmall", alignItems: "center", className: css.external },
|
|
39
|
-
React.createElement("a",
|
|
40
|
-
|
|
42
|
+
React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", as: "a", href: `https://www.npmjs.com/package/${normalizedName}`, target: "_blank", rel: "noreferrer", className: css.externalLink },
|
|
43
|
+
React.createElement("span", null, "npmjs.com"),
|
|
44
|
+
React.createElement(Icon, { glyph: Icon.ICONS.EXTERNAL_LINK, size: "small" })),
|
|
45
|
+
React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", as: "a", href: `https://bundlephobia.com/result?p=${normalizedName}`, target: "_blank", rel: "noreferrer", className: css.externalLink },
|
|
46
|
+
React.createElement("span", null, "bundlephobia.com"),
|
|
47
|
+
React.createElement(Icon, { glyph: Icon.ICONS.EXTERNAL_LINK, size: "small" }))))));
|
|
41
48
|
};
|
|
42
49
|
//# sourceMappingURL=package-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-info.js","sourceRoot":"","sources":["../../../src/components/package-info/package-info.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EAEpB,wBAAwB,EACxB,oCAAoC,GACrC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,GA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C,CAAC,KAAM,SAAS;QACrE,6BAAK,SAAS,EAAE,GAAG,CAAC,IAAI;YACtB,6BAAK,SAAS,EAAE,IAAI,KAAK,EAAE,GAAI,CAC3B,CACI,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAEnB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;AAC1B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;AAC5B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;AAC1B,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAElE,IAAI,CAAC,YAAY,GAAG;IAClB,SAAS,EAAE,EAAE;IACb,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,IAAI,CAAC,WAAW;CACvB,CAAC;AAEF,IAAI,CAAC,SAAS,GAAG;IACf,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU;IAC9F,EAAE,EAAE,SAAS,CAAC,IAAI;IAClB,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;CAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@storybook/builder-webpack5": "6.5.16",
|
|
46
46
|
"@storybook/manager-webpack5": "6.5.16",
|
|
47
47
|
"@storybook/react": "6.5.16",
|
|
48
|
-
"@types/react": "18.0.
|
|
48
|
+
"@types/react": "18.0.35",
|
|
49
49
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
50
50
|
"classnames": "2.3.2",
|
|
51
51
|
"colormap": "2.3.2",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"react-dom": "17.0.2",
|
|
64
64
|
"react-router-dom": "5.3.4",
|
|
65
65
|
"react-test-renderer": "18.2.0",
|
|
66
|
-
"rimraf": "
|
|
67
|
-
"typescript": "5.0.
|
|
68
|
-
"typescript-plugin-css-modules": "5.0.
|
|
66
|
+
"rimraf": "5.0.0",
|
|
67
|
+
"typescript": "5.0.4",
|
|
68
|
+
"typescript-plugin-css-modules": "5.0.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"classnames": "^2.0.0",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"react-router-dom": "^5.0.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@bundle-stats/utils": "^4.3.
|
|
80
|
-
"ariakit": "2.0.0-next.
|
|
79
|
+
"@bundle-stats/utils": "^4.3.2",
|
|
80
|
+
"ariakit": "2.0.0-next.44",
|
|
81
81
|
"modern-css-reset": "1.4.0",
|
|
82
82
|
"query-string": "7.1.3",
|
|
83
83
|
"use-query-params": "2.2.1"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "9c09c9504f6cf796860662a1db9617a5b70e9f47"
|
|
86
86
|
}
|
package/src/app/app.module.css
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
.summaryContainer {
|
|
16
16
|
padding-top: var(--space-medium);
|
|
17
|
-
padding-bottom: var(--space-
|
|
17
|
+
padding-bottom: var(--space-xsmall);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.tabsContainer {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
@media (min-width: 600px) {
|
|
44
44
|
:root {
|
|
45
|
-
--header-height:
|
|
45
|
+
--header-height: 52px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.header {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
|
package/src/assets/icons.svg
CHANGED
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
<circle cx="12" cy="12" r="10"/>
|
|
27
27
|
<path d="M12 8v4M12 16h.01"/>
|
|
28
28
|
</symbol>
|
|
29
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link" viewBox="0 0 24 24" id="external-link" xmlns="http://www.w3.org/2000/svg">
|
|
30
|
+
<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3"/>
|
|
31
|
+
</symbol>
|
|
29
32
|
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg">
|
|
30
33
|
<path d="M12 20V10M18 20V4M6 20v-4"/>
|
|
31
34
|
</symbol>
|
package/src/assets/icons.svg.jsx
CHANGED
|
@@ -98,6 +98,19 @@ export const SvgIcons = (props) => (
|
|
|
98
98
|
<circle cx="12" cy="12" r="10" />
|
|
99
99
|
<path d="M12 8v4M12 16h.01" />
|
|
100
100
|
</symbol>
|
|
101
|
+
<symbol
|
|
102
|
+
fill="none"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
stroke-width="2"
|
|
105
|
+
stroke-linecap="round"
|
|
106
|
+
stroke-linejoin="round"
|
|
107
|
+
class="feather feather-external-link"
|
|
108
|
+
viewBox="0 0 24 24"
|
|
109
|
+
id="external-link"
|
|
110
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
111
|
+
>
|
|
112
|
+
<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3" />
|
|
113
|
+
</symbol>
|
|
101
114
|
<symbol
|
|
102
115
|
viewBox="0 0 24 24"
|
|
103
116
|
fill="none"
|
|
@@ -2,14 +2,17 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import noop from 'lodash/noop';
|
|
4
4
|
import {
|
|
5
|
+
FILE_TYPE_LABELS,
|
|
5
6
|
MetricRunInfo,
|
|
6
7
|
getBundleModulesByChunk,
|
|
7
8
|
getBundleAssetsByEntryType,
|
|
9
|
+
getBundleAssetsFileTypeComponentLink,
|
|
8
10
|
getModuleFileType,
|
|
9
11
|
} from '@bundle-stats/utils';
|
|
10
12
|
import { Asset, MetaChunk } from '@bundle-stats/utils/types/webpack';
|
|
11
13
|
|
|
12
14
|
import { FlexStack } from '../../layout/flex-stack';
|
|
15
|
+
import { Stack } from '../../layout/stack';
|
|
13
16
|
import { Tag } from '../../ui/tag';
|
|
14
17
|
import { ComponentLink } from '../component-link';
|
|
15
18
|
import { EntryInfo } from '../entry-info';
|
|
@@ -57,6 +60,7 @@ interface AssetInfoProps {
|
|
|
57
60
|
isEntry?: boolean;
|
|
58
61
|
isInitial?: boolean;
|
|
59
62
|
isNotPredicative?: boolean;
|
|
63
|
+
fileType?: string;
|
|
60
64
|
runs: Array<Asset & MetricRunInfo>;
|
|
61
65
|
};
|
|
62
66
|
chunks?: Array<MetaChunk>;
|
|
@@ -117,17 +121,34 @@ export const AssetInfo = (props: AssetInfoProps & React.ComponentProps<'div'>) =
|
|
|
117
121
|
);
|
|
118
122
|
}, [item]);
|
|
119
123
|
|
|
124
|
+
const fileTypeLabel = FILE_TYPE_LABELS[item.fileType as keyof typeof FILE_TYPE_LABELS];
|
|
125
|
+
|
|
120
126
|
return (
|
|
121
127
|
<EntryInfo item={item} labels={labels} tags={tags} className={cx(css.root, className)}>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
<Stack space="small">
|
|
129
|
+
{item.fileType && (
|
|
130
|
+
<p>
|
|
131
|
+
<span className={css.label}>File type</span>
|
|
132
|
+
<Tag
|
|
133
|
+
as={CustomComponentLink}
|
|
134
|
+
{...getBundleAssetsFileTypeComponentLink(item.fileType, fileTypeLabel)}
|
|
135
|
+
onClick={onClick}
|
|
136
|
+
>
|
|
137
|
+
{fileTypeLabel}
|
|
138
|
+
</Tag>
|
|
139
|
+
</p>
|
|
140
|
+
)}
|
|
141
|
+
|
|
142
|
+
{currentRun?.chunkId && chunks && (
|
|
143
|
+
<ChunkModulesLink
|
|
144
|
+
as={CustomComponentLink}
|
|
145
|
+
chunks={chunks}
|
|
146
|
+
chunkId={currentRun?.chunkId}
|
|
147
|
+
name={currentRun?.name}
|
|
148
|
+
onClick={onClick}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
</Stack>
|
|
131
152
|
</EntryInfo>
|
|
132
153
|
);
|
|
133
154
|
};
|
|
@@ -8,8 +8,8 @@ export const addRowAssetFlags = (row) => {
|
|
|
8
8
|
const isEntry = runs.map((run) => run?.isEntry).includes(true);
|
|
9
9
|
const isInitial = runs.map((run) => run?.isInitial).includes(true);
|
|
10
10
|
const isChunk = runs.map((run) => run?.isChunk).includes(true);
|
|
11
|
-
|
|
12
11
|
const isAsset = !(isEntry || isInitial || isChunk);
|
|
12
|
+
const fileType = getFileType(row.key);
|
|
13
13
|
|
|
14
14
|
return {
|
|
15
15
|
...row,
|
|
@@ -17,6 +17,7 @@ export const addRowAssetFlags = (row) => {
|
|
|
17
17
|
isInitial,
|
|
18
18
|
isChunk,
|
|
19
19
|
isAsset,
|
|
20
|
+
fileType,
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -64,7 +65,7 @@ export const getRowFilter = (filters) => (item) => {
|
|
|
64
65
|
return false;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
if (!filters[`${ASSET_FILE_TYPE}.${
|
|
68
|
+
if (!filters[`${ASSET_FILE_TYPE}.${item.fileType}`]) {
|
|
68
69
|
return false;
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -12,6 +12,7 @@ import { HorizontalBarChart } from '../../ui/horizontal-bar-chart';
|
|
|
12
12
|
import { ComponentLink } from '../component-link'
|
|
13
13
|
import { getColors } from '../../utils';
|
|
14
14
|
import { Stack } from '../../layout/stack';
|
|
15
|
+
import { JobName } from '../job-name';
|
|
15
16
|
import { MetricRunInfo } from '../metric-run-info';
|
|
16
17
|
import css from './bundle-assets-totals-chart-bars.module.css';
|
|
17
18
|
|
|
@@ -63,7 +64,7 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
63
64
|
const colors = getColors(max(map(dataGraphs, (values) => values.length)));
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
|
-
<Stack className={rootClassName} space="
|
|
67
|
+
<Stack className={rootClassName} space="small">
|
|
67
68
|
{dataGraphs.map((data, runIndex) => {
|
|
68
69
|
const { internalBuildNumber } = jobs[runIndex];
|
|
69
70
|
|
|
@@ -76,7 +77,7 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
76
77
|
|
|
77
78
|
return (
|
|
78
79
|
<div key={internalBuildNumber || runIndex} className={css.item}>
|
|
79
|
-
<h3 className={css.itemTitle}
|
|
80
|
+
<h3 className={css.itemTitle}><JobName internalBuildNumber={internalBuildNumber} /></h3>
|
|
80
81
|
<HorizontalBarChart
|
|
81
82
|
className={css.itemChart}
|
|
82
83
|
data={{ labels, values }}
|
|
@@ -40,17 +40,6 @@ const getFilters = ({ filters, compareMode, chunks }) => ({
|
|
|
40
40
|
label: 'Duplicate',
|
|
41
41
|
defaultValue: filters[MODULE_FILTERS.DUPLICATED],
|
|
42
42
|
},
|
|
43
|
-
[MODULE_SOURCE_TYPE]: {
|
|
44
|
-
label: 'Source',
|
|
45
|
-
[MODULE_FILTERS.FIRST_PARTY]: {
|
|
46
|
-
label: 'First party',
|
|
47
|
-
defaultValue: get(filters, `${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.FIRST_PARTY}`, true),
|
|
48
|
-
},
|
|
49
|
-
[MODULE_FILTERS.THIRD_PARTY]: {
|
|
50
|
-
label: 'Third party',
|
|
51
|
-
defaultValue: get(filters, `${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.THIRD_PARTY}`, true),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
43
|
|
|
55
44
|
// When chunks data available, list available chunks as filters
|
|
56
45
|
...(!isEmpty(chunks) && {
|
|
@@ -69,6 +58,18 @@ const getFilters = ({ filters, compareMode, chunks }) => ({
|
|
|
69
58
|
},
|
|
70
59
|
}),
|
|
71
60
|
|
|
61
|
+
[MODULE_SOURCE_TYPE]: {
|
|
62
|
+
label: 'Source',
|
|
63
|
+
[MODULE_FILTERS.FIRST_PARTY]: {
|
|
64
|
+
label: 'First party',
|
|
65
|
+
defaultValue: get(filters, `${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.FIRST_PARTY}`, true),
|
|
66
|
+
},
|
|
67
|
+
[MODULE_FILTERS.THIRD_PARTY]: {
|
|
68
|
+
label: 'Third party',
|
|
69
|
+
defaultValue: get(filters, `${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.THIRD_PARTY}`, true),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
72
73
|
// Module source types
|
|
73
74
|
[MODULE_FILE_TYPE]: {
|
|
74
75
|
label: 'File type',
|
|
@@ -13,14 +13,17 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import { SORT_BY_NAME, SORT_BY_SIZE, SORT_BY_DELTA } from './bundle-modules.constants';
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const addRowFlags = (row) => {
|
|
17
17
|
const { key, runs } = row;
|
|
18
18
|
|
|
19
19
|
// @NOTE Assign instead destructuring for perf reasons
|
|
20
|
+
|
|
20
21
|
// eslint-disable-next-line no-param-reassign
|
|
21
22
|
row.thirdParty = Boolean(key.match(MODULE_PATH_PACKAGES));
|
|
22
23
|
// eslint-disable-next-line no-param-reassign
|
|
23
24
|
row.duplicated = Boolean(runs.find((run) => run?.duplicated === true));
|
|
25
|
+
// eslint-disable-next-line no-param-reassign
|
|
26
|
+
row.fileType = getModuleSourceFileType(row.key);
|
|
24
27
|
|
|
25
28
|
return row;
|
|
26
29
|
};
|
|
@@ -64,8 +67,7 @@ export const getRowFilter = (filters) => (row) => {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
// Skip not matching source file types
|
|
67
|
-
|
|
68
|
-
if (!filters[`${MODULE_FILE_TYPE}.${fileType}`]) {
|
|
70
|
+
if (!filters[`${MODULE_FILE_TYPE}.${row.fileType}`]) {
|
|
69
71
|
return false;
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -14,7 +14,7 @@ import { useRowsSort } from '../../hooks/rows-sort';
|
|
|
14
14
|
import { useSearchParams } from '../../hooks/search-params';
|
|
15
15
|
import { BundleModules as BundleModulesComponent } from './bundle-modules';
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
addRowFlags,
|
|
18
18
|
getRowFilter,
|
|
19
19
|
getCustomSort,
|
|
20
20
|
useModuleFilterByChunk,
|
|
@@ -75,7 +75,7 @@ export const BundleModules = (props) => {
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
const { rows, totalRowCount } = useMemo(() => {
|
|
78
|
-
const result = webpack.compareBySection.modules(filteredJobsByChunkIds, [
|
|
78
|
+
const result = webpack.compareBySection.modules(filteredJobsByChunkIds, [addRowFlags]);
|
|
79
79
|
return { rows: result, totalRowCount: result.length };
|
|
80
80
|
}, [filteredJobsByChunkIds]);
|
|
81
81
|
|
package/src/components/index.js
CHANGED
|
@@ -9,7 +9,6 @@ export { Delta } from './delta';
|
|
|
9
9
|
export { InsightIcon } from './insight-icon';
|
|
10
10
|
export { Insights } from './insights';
|
|
11
11
|
export { JobName } from './job-name';
|
|
12
|
-
export { JobHeader } from './job-header';
|
|
13
12
|
export { JobsHeader } from './jobs-header';
|
|
14
13
|
export { LighthouseTable } from './lighthouse-table';
|
|
15
14
|
export { Metric } from './metric';
|