@bundle-stats/ui 4.2.0-beta.6 → 4.2.1-beta.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/lib/components/insights/insights.js +1 -27
- package/lib/components/insights/insights.js.map +1 -1
- package/lib/components/insights/insights.module.css +2 -4
- package/lib-esm/components/insights/insights.js +2 -28
- package/lib-esm/components/insights/insights.js.map +1 -1
- package/lib-esm/components/insights/insights.module.css +2 -4
- package/package.json +14 -16
- package/src/components/insights/insights.module.css +2 -4
- package/src/components/insights/insights.stories.tsx +0 -3
- package/src/components/insights/insights.tsx +2 -47
- package/tsconfig.esm.json +0 -13
- package/tsconfig.json +0 -7
- package/tsconfig.lib.json +0 -9
|
@@ -12,32 +12,6 @@ const stack_1 = require("../../layout/stack");
|
|
|
12
12
|
const icon_1 = require("../../ui/icon");
|
|
13
13
|
const component_link_1 = require("../component-link");
|
|
14
14
|
const insights_module_css_1 = __importDefault(require("./insights.module.css"));
|
|
15
|
-
const normalizedInsights = ({ duplicatePackages, newPackages, }) => {
|
|
16
|
-
const insightsByLevel = {
|
|
17
|
-
[utils_1.InsightType.ERROR]: [],
|
|
18
|
-
[utils_1.InsightType.WARNING]: [],
|
|
19
|
-
[utils_1.InsightType.INFO]: [],
|
|
20
|
-
};
|
|
21
|
-
if (duplicatePackages) {
|
|
22
|
-
insightsByLevel[duplicatePackages.type].push({
|
|
23
|
-
name: 'duplicatePackages',
|
|
24
|
-
insight: duplicatePackages,
|
|
25
|
-
link: utils_1.BUNDLE_PACKAGES_DUPLICATE,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
if (newPackages) {
|
|
29
|
-
insightsByLevel[newPackages.type].push({
|
|
30
|
-
name: 'newPackages',
|
|
31
|
-
insight: newPackages,
|
|
32
|
-
link: utils_1.BUNDLE_PACKAGES_COUNT,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return [
|
|
36
|
-
...(insightsByLevel[utils_1.InsightType.ERROR] || []),
|
|
37
|
-
...(insightsByLevel[utils_1.InsightType.WARNING] || []),
|
|
38
|
-
...(insightsByLevel[utils_1.InsightType.INFO] || []),
|
|
39
|
-
];
|
|
40
|
-
};
|
|
41
15
|
const InsightTypeIconMap = new Map([
|
|
42
16
|
[utils_1.InsightType.ERROR, icon_1.Icon.ICONS.ERROR],
|
|
43
17
|
[utils_1.InsightType.WARNING, icon_1.Icon.ICONS.WARNING],
|
|
@@ -45,7 +19,7 @@ const InsightTypeIconMap = new Map([
|
|
|
45
19
|
]);
|
|
46
20
|
const Insights = (props) => {
|
|
47
21
|
const { duplicatePackages, newPackages, customComponentLink: CustomComponentLink = component_link_1.ComponentLink, ...restProps } = props;
|
|
48
|
-
const insights =
|
|
22
|
+
const insights = (0, utils_1.getInsightList)({ duplicatePackages, newPackages });
|
|
49
23
|
return (react_1.default.createElement(stack_1.Stack, { space: "xxsmall", ...restProps }, insights.map(({ name, insight, link }) => {
|
|
50
24
|
const glyph = InsightTypeIconMap.get(insight.type);
|
|
51
25
|
const { text } = insight.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../../src/components/insights/insights.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4DAA4B;AAC5B,+
|
|
1
|
+
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../../src/components/insights/insights.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4DAA4B;AAC5B,+CAAkE;AAElE,wDAAoD;AACpD,8CAA2C;AAC3C,wCAAqC;AACrC,sDAAkD;AAElD,gFAAwC;AAExC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,CAAC,mBAAW,CAAC,KAAK,EAAE,WAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IACrC,CAAC,mBAAW,CAAC,OAAO,EAAE,WAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IACzC,CAAC,mBAAW,CAAC,I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
|
background: var(--color-highlight);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.error .icon {
|
|
8
|
-
outline-color: var(--color-red-50);
|
|
9
9
|
background: var(--color-red-50);
|
|
10
10
|
color: var(--color-danger);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.warning .icon {
|
|
14
|
-
outline-color: var(--color-yellow-100);
|
|
15
14
|
background: var(--color-yellow-100);
|
|
16
15
|
color: var(--color-warning-dark);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.info .icon {
|
|
20
|
-
outline-color: var(--color-highlight-info);
|
|
21
19
|
background: var(--color-highlight-info);
|
|
22
20
|
color: var(--color-info);
|
|
23
21
|
}
|
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { InsightType, getInsightList } from '@bundle-stats/utils';
|
|
4
4
|
import { FlexStack } from '../../layout/flex-stack';
|
|
5
5
|
import { Stack } from '../../layout/stack';
|
|
6
6
|
import { Icon } from '../../ui/icon';
|
|
7
7
|
import { ComponentLink } from '../component-link';
|
|
8
8
|
import css from './insights.module.css';
|
|
9
|
-
const normalizedInsights = ({ duplicatePackages, newPackages, }) => {
|
|
10
|
-
const insightsByLevel = {
|
|
11
|
-
[InsightType.ERROR]: [],
|
|
12
|
-
[InsightType.WARNING]: [],
|
|
13
|
-
[InsightType.INFO]: [],
|
|
14
|
-
};
|
|
15
|
-
if (duplicatePackages) {
|
|
16
|
-
insightsByLevel[duplicatePackages.type].push({
|
|
17
|
-
name: 'duplicatePackages',
|
|
18
|
-
insight: duplicatePackages,
|
|
19
|
-
link: BUNDLE_PACKAGES_DUPLICATE,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (newPackages) {
|
|
23
|
-
insightsByLevel[newPackages.type].push({
|
|
24
|
-
name: 'newPackages',
|
|
25
|
-
insight: newPackages,
|
|
26
|
-
link: BUNDLE_PACKAGES_COUNT,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return [
|
|
30
|
-
...(insightsByLevel[InsightType.ERROR] || []),
|
|
31
|
-
...(insightsByLevel[InsightType.WARNING] || []),
|
|
32
|
-
...(insightsByLevel[InsightType.INFO] || []),
|
|
33
|
-
];
|
|
34
|
-
};
|
|
35
9
|
const InsightTypeIconMap = new Map([
|
|
36
10
|
[InsightType.ERROR, Icon.ICONS.ERROR],
|
|
37
11
|
[InsightType.WARNING, Icon.ICONS.WARNING],
|
|
@@ -39,7 +13,7 @@ const InsightTypeIconMap = new Map([
|
|
|
39
13
|
]);
|
|
40
14
|
export const Insights = (props) => {
|
|
41
15
|
const { duplicatePackages, newPackages, customComponentLink: CustomComponentLink = ComponentLink, ...restProps } = props;
|
|
42
|
-
const insights =
|
|
16
|
+
const insights = getInsightList({ duplicatePackages, newPackages });
|
|
43
17
|
return (React.createElement(Stack, { space: "xxsmall", ...restProps }, insights.map(({ name, insight, link }) => {
|
|
44
18
|
const glyph = InsightTypeIconMap.get(insight.type);
|
|
45
19
|
const { text } = insight.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../../src/components/insights/insights.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../../src/components/insights/insights.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC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,EAAE,GAAG,CAAC,IAAI,GAAI;YACrD,kCAAO,IAAI,CAAQ,CACT,CACb,CAAC;IACJ,CAAC,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
.icon {
|
|
2
|
-
|
|
2
|
+
padding: 3px;
|
|
3
|
+
box-sizing: content-box;
|
|
3
4
|
border-radius: 50%;
|
|
4
5
|
background: var(--color-highlight);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.error .icon {
|
|
8
|
-
outline-color: var(--color-red-50);
|
|
9
9
|
background: var(--color-red-50);
|
|
10
10
|
color: var(--color-danger);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.warning .icon {
|
|
14
|
-
outline-color: var(--color-yellow-100);
|
|
15
14
|
background: var(--color-yellow-100);
|
|
16
15
|
color: var(--color-warning-dark);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.info .icon {
|
|
20
|
-
outline-color: var(--color-highlight-info);
|
|
21
19
|
background: var(--color-highlight-info);
|
|
22
20
|
color: var(--color-info);
|
|
23
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1-beta.0",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"start": "cross-env NODE_ENV=development start-storybook -c ./build/storybook -p 8080",
|
|
21
21
|
"test": "npm run test:unit",
|
|
22
22
|
"test:unit": "jest src --passWithNoTests",
|
|
23
|
-
"test:storyshots": "jest build/storybook "
|
|
24
|
-
"chromatic": "chromatic --exit-zero-on-changes"
|
|
23
|
+
"test:storyshots": "jest build/storybook "
|
|
25
24
|
},
|
|
26
25
|
"repository": {
|
|
27
26
|
"type": "git",
|
|
@@ -41,17 +40,16 @@
|
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@babel/preset-env": "7.20.2",
|
|
43
42
|
"@babel/preset-react": "7.18.6",
|
|
44
|
-
"@storybook/addon-essentials": "6.5.
|
|
43
|
+
"@storybook/addon-essentials": "6.5.16",
|
|
45
44
|
"@storybook/addon-knobs": "6.4.0",
|
|
46
45
|
"@storybook/addon-postcss": "2.0.0",
|
|
47
|
-
"@storybook/addon-storyshots": "6.5.
|
|
48
|
-
"@storybook/addons": "6.5.
|
|
49
|
-
"@storybook/builder-webpack5": "6.5.
|
|
50
|
-
"@storybook/manager-webpack5": "6.5.
|
|
51
|
-
"@storybook/react": "6.5.
|
|
46
|
+
"@storybook/addon-storyshots": "6.5.16",
|
|
47
|
+
"@storybook/addons": "6.5.16",
|
|
48
|
+
"@storybook/builder-webpack5": "6.5.16",
|
|
49
|
+
"@storybook/manager-webpack5": "6.5.16",
|
|
50
|
+
"@storybook/react": "6.5.16",
|
|
52
51
|
"@types/react": "18.0.26",
|
|
53
52
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
54
|
-
"chromatic": "6.15.0",
|
|
55
53
|
"classnames": "2.3.2",
|
|
56
54
|
"colormap": "2.3.2",
|
|
57
55
|
"cross-env": "7.0.3",
|
|
@@ -60,9 +58,9 @@
|
|
|
60
58
|
"enzyme-to-json": "3.6.2",
|
|
61
59
|
"hex-rgb": "5.0.0",
|
|
62
60
|
"identity-obj-proxy": "3.0.0",
|
|
63
|
-
"jest": "29.4.
|
|
61
|
+
"jest": "29.4.2",
|
|
64
62
|
"jest-date-mock": "1.0.8",
|
|
65
|
-
"jest-environment-jsdom": "29.4.
|
|
63
|
+
"jest-environment-jsdom": "29.4.2",
|
|
66
64
|
"lodash": "4.17.21",
|
|
67
65
|
"postcss": "8.4.21",
|
|
68
66
|
"prop-types": "15.8.1",
|
|
@@ -71,7 +69,7 @@
|
|
|
71
69
|
"react-router-dom": "5.3.4",
|
|
72
70
|
"react-test-renderer": "18.2.0",
|
|
73
71
|
"rimraf": "4.1.2",
|
|
74
|
-
"typescript": "4.9.
|
|
72
|
+
"typescript": "4.9.5"
|
|
75
73
|
},
|
|
76
74
|
"peerDependencies": {
|
|
77
75
|
"classnames": "^2.0.0",
|
|
@@ -82,11 +80,11 @@
|
|
|
82
80
|
"react-router-dom": "^5.0.0"
|
|
83
81
|
},
|
|
84
82
|
"dependencies": {
|
|
85
|
-
"@bundle-stats/utils": "^4.2.
|
|
83
|
+
"@bundle-stats/utils": "^4.2.1-beta.0",
|
|
86
84
|
"ariakit": "2.0.0-next.43",
|
|
87
85
|
"modern-css-reset": "1.4.0",
|
|
88
86
|
"query-string": "7.1.3",
|
|
89
|
-
"use-query-params": "2.
|
|
87
|
+
"use-query-params": "2.2.0"
|
|
90
88
|
},
|
|
91
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "d89f2e40c0830a704b8e64b61741428af2920e5e"
|
|
92
90
|
}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
.icon {
|
|
2
|
-
|
|
2
|
+
padding: 3px;
|
|
3
|
+
box-sizing: content-box;
|
|
3
4
|
border-radius: 50%;
|
|
4
5
|
background: var(--color-highlight);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.error .icon {
|
|
8
|
-
outline-color: var(--color-red-50);
|
|
9
9
|
background: var(--color-red-50);
|
|
10
10
|
color: var(--color-danger);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.warning .icon {
|
|
14
|
-
outline-color: var(--color-yellow-100);
|
|
15
14
|
background: var(--color-yellow-100);
|
|
16
15
|
color: var(--color-warning-dark);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.info .icon {
|
|
20
|
-
outline-color: var(--color-highlight-info);
|
|
21
19
|
background: var(--color-highlight-info);
|
|
22
20
|
color: var(--color-info);
|
|
23
21
|
}
|
|
@@ -27,7 +27,6 @@ Default.args = {
|
|
|
27
27
|
text: 'Bundle introduced 2 new packages: package-c, package-d',
|
|
28
28
|
packages: ['package-c', 'package-d'],
|
|
29
29
|
},
|
|
30
|
-
changes: true,
|
|
31
30
|
},
|
|
32
31
|
};
|
|
33
32
|
|
|
@@ -40,7 +39,6 @@ Info.args = {
|
|
|
40
39
|
packages: { 'package-a': ['package-a', 'package-a~1'] },
|
|
41
40
|
text: 'Bundle removed 1 duplicate packages',
|
|
42
41
|
},
|
|
43
|
-
changes: false,
|
|
44
42
|
},
|
|
45
43
|
newPackages: {
|
|
46
44
|
type: 'warning',
|
|
@@ -48,6 +46,5 @@ Info.args = {
|
|
|
48
46
|
text: 'Bundle introduced 2 new packages: package-c, package-d',
|
|
49
47
|
packages: ['package-c', 'package-d'],
|
|
50
48
|
},
|
|
51
|
-
changes: true,
|
|
52
49
|
},
|
|
53
50
|
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
BUNDLE_PACKAGES_DUPLICATE,
|
|
5
|
-
BUNDLE_PACKAGES_COUNT,
|
|
6
|
-
InsightType,
|
|
7
|
-
JobInsight,
|
|
8
|
-
JobInsights as JobInsightsType,
|
|
9
|
-
} from '@bundle-stats/utils';
|
|
3
|
+
import { InsightType, getInsightList } from '@bundle-stats/utils';
|
|
10
4
|
|
|
11
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
12
6
|
import { Stack } from '../../layout/stack';
|
|
@@ -15,45 +9,6 @@ import { ComponentLink } from '../component-link';
|
|
|
15
9
|
// @ts-ignore
|
|
16
10
|
import css from './insights.module.css';
|
|
17
11
|
|
|
18
|
-
interface InsightEntry {
|
|
19
|
-
name: string;
|
|
20
|
-
insight: JobInsight;
|
|
21
|
-
link: any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const normalizedInsights = ({
|
|
25
|
-
duplicatePackages,
|
|
26
|
-
newPackages,
|
|
27
|
-
}: Partial<JobInsightsType['webpack']>): Array<InsightEntry> => {
|
|
28
|
-
const insightsByLevel: Record<InsightType, Array<InsightEntry>> = {
|
|
29
|
-
[InsightType.ERROR]: [],
|
|
30
|
-
[InsightType.WARNING]: [],
|
|
31
|
-
[InsightType.INFO]: [],
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
if (duplicatePackages) {
|
|
35
|
-
insightsByLevel[duplicatePackages.type].push({
|
|
36
|
-
name: 'duplicatePackages',
|
|
37
|
-
insight: duplicatePackages,
|
|
38
|
-
link: BUNDLE_PACKAGES_DUPLICATE,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (newPackages) {
|
|
43
|
-
insightsByLevel[newPackages.type].push({
|
|
44
|
-
name: 'newPackages',
|
|
45
|
-
insight: newPackages,
|
|
46
|
-
link: BUNDLE_PACKAGES_COUNT,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return [
|
|
51
|
-
...(insightsByLevel[InsightType.ERROR] || []),
|
|
52
|
-
...(insightsByLevel[InsightType.WARNING] || []),
|
|
53
|
-
...(insightsByLevel[InsightType.INFO] || []),
|
|
54
|
-
];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
12
|
const InsightTypeIconMap = new Map([
|
|
58
13
|
[InsightType.ERROR, Icon.ICONS.ERROR],
|
|
59
14
|
[InsightType.WARNING, Icon.ICONS.WARNING],
|
|
@@ -74,7 +29,7 @@ export const Insights = (props: InsightsProps) => {
|
|
|
74
29
|
...restProps
|
|
75
30
|
} = props;
|
|
76
31
|
|
|
77
|
-
const insights =
|
|
32
|
+
const insights = getInsightList({ duplicatePackages, newPackages });
|
|
78
33
|
|
|
79
34
|
return (
|
|
80
35
|
<Stack space="xxsmall" {...restProps}>
|
package/tsconfig.esm.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "react",
|
|
5
|
-
"resolveJsonModule": true,
|
|
6
|
-
"target": "ES2019",
|
|
7
|
-
"module": "ES6",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./types",
|
|
10
|
-
"noEmit": false
|
|
11
|
-
},
|
|
12
|
-
"exclude": ["**/__tests__/*", "**/*.stories.*"]
|
|
13
|
-
}
|
package/tsconfig.json
DELETED