@rsdoctor/components 1.5.1 → 1.5.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.
@@ -8,6 +8,7 @@ import { CommonList } from "./list.mjs";
8
8
  import bundle_alert_module from "./bundle-alert.module.mjs";
9
9
  import { useState } from "react";
10
10
  import { CrossChunksAlertCollapse } from "./collapse-cross-chunks.mjs";
11
+ import { ModuleMixedChunksAlertCollapse } from "./collapse-module-mixed-chunks.mjs";
11
12
  const BundleAlert = ({ title, dataSource, extraData })=>{
12
13
  const [activeKey, setActiveKey] = useState('E1001');
13
14
  const tabData = [
@@ -35,6 +36,11 @@ const BundleAlert = ({ title, dataSource, extraData })=>{
35
36
  key: 'E1005',
36
37
  label: 'Default Import Check',
37
38
  data: []
39
+ },
40
+ {
41
+ key: 'E1006',
42
+ label: 'Module Mixed Chunks',
43
+ data: []
38
44
  }
39
45
  ];
40
46
  dataSource.forEach((data)=>{
@@ -114,6 +120,12 @@ const BundleAlert = ({ title, dataSource, extraData })=>{
114
120
  data: td.data
115
121
  });
116
122
  break;
123
+ case 'E1006':
124
+ children = /*#__PURE__*/ jsx(ModuleMixedChunksAlertCollapse, {
125
+ data: td.data,
126
+ extraData: extraData
127
+ });
128
+ break;
117
129
  default:
118
130
  children = null;
119
131
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"components/Alerts/bundle-alert.mjs","sources":["../../../src/components/Alerts/bundle-alert.tsx"],"sourcesContent":["import { Tabs, Empty, Tag } from 'antd';\n\nimport { Card } from '../Card';\nimport { ECMAVersionCheck } from '../Alert/ecma-version-check';\nimport { Overview } from '../Overall/overview';\nimport { AlertCollapse } from './collapse';\nimport { CommonList } from './list';\nimport { ViewMode } from '../../constants';\n\nimport { AlertProps } from '../Alert/types';\n\nimport type { Rule } from '@rsdoctor/types';\n\nimport styles from './bundle-alert.module.scss';\nimport { CSSProperties, useState } from 'react';\nimport { CrossChunksAlertCollapse } from './collapse-cross-chunks';\n\ninterface BundleAlertProps {\n title: string;\n cwd: string;\n dataSource: Rule.RuleStoreDataItem[];\n extraData: Omit<AlertProps, 'data'>;\n viewMode: ViewMode;\n setViewMode(mode: ViewMode): void;\n extraCom?: JSX.Element | undefined;\n}\n\nexport const BundleAlert: React.FC<BundleAlertProps> = ({\n title,\n dataSource,\n extraData,\n}) => {\n const [activeKey, setActiveKey] = useState('E1001');\n const tabData: Array<{\n key: string;\n label: string;\n data: Array<Rule.RuleStoreDataItem>;\n }> = [\n {\n key: 'E1001',\n label: 'Duplicate Packages',\n data: [],\n },\n {\n key: 'E1002',\n label: 'Cross Chunks Package',\n data: [],\n },\n {\n key: 'E1003',\n label: 'Loader Performance Optimization',\n data: [],\n },\n {\n key: 'E1004',\n label: 'ECMA Version Check',\n data: [],\n },\n {\n key: 'E1005',\n label: 'Default Import Check',\n data: [],\n },\n ];\n\n dataSource.forEach((data) => {\n const target = tabData.find((td) => td.key === data.code)?.data;\n target?.push(data);\n });\n\n const tabItems = tabData.map((td) => {\n const tagStyle =\n activeKey === td.key\n ? ({\n border: '1px solid #91D5FF',\n backgroundColor: '#E6F7FF',\n } as CSSProperties)\n : {};\n\n const tagTextStyle =\n activeKey === td.key\n ? {\n color: '#1890FF',\n }\n : {};\n\n const LabelComponent = () => (\n <Overview\n style={{\n backgroundColor: 'transparent',\n paddingLeft: 0,\n paddingRight: 0,\n width: '100%',\n }}\n title={<span className={styles.labelTitle}>{td.label}</span>}\n description={\n <div className={styles.labelDescription}>\n <span>{td.data.length}</span>\n <Tag\n style={{ fontFamily: 'Menlo', borderRadius: '2px', ...tagStyle }}\n >\n <span style={{ ...tagTextStyle }}>{td.key}</span>\n </Tag>\n </div>\n }\n />\n );\n\n let children, description;\n switch (td.key) {\n case 'E1001':\n children = <AlertCollapse data={td.data} extraData={extraData} />;\n break;\n case 'E1002':\n children = (\n <CrossChunksAlertCollapse data={td.data} extraData={extraData} />\n );\n break;\n case 'E1003':\n children = <CommonList data={td.data} />;\n break;\n case 'E1004':\n description = (\n <span>\n No ECMA Version Check Rules were found. Please refer to\n 「https://rsdoctor.rs/guide/usage/rule-config」.\n </span>\n );\n children = <ECMAVersionCheck data={td.data} />;\n break;\n case 'E1005':\n children = <CommonList data={td.data} />;\n break;\n default:\n children = null;\n break;\n }\n\n if (!td.data.length) {\n children = (\n <Empty description={description} image={Empty.PRESENTED_IMAGE_SIMPLE} />\n );\n }\n\n return {\n key: td.key,\n label: <LabelComponent />,\n children: (\n <Card\n className={styles.card}\n type=\"inner\"\n title={\n <>\n <Tag\n style={{\n fontFamily: 'Menlo',\n fontWeight: '700',\n fontSize: '13px',\n backgroundColor: '#EAEDF1',\n borderRadius: '2px',\n }}\n >\n {td.key}\n </Tag>\n <span>{td.label}</span>\n </>\n }\n >\n {children}\n </Card>\n ),\n };\n });\n\n return (\n <Card style={{ width: '100%', borderRadius: '12px' }}>\n <div className={styles.container}>\n <div className={styles.title}>{title}</div>\n {!dataSource.length ? (\n <div\n style={{\n minHeight: '480px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Empty\n description={'No Bundle Alerts Data'}\n image={Empty.PRESENTED_IMAGE_SIMPLE}\n />\n </div>\n ) : (\n <Tabs\n onChange={setActiveKey}\n tabBarGutter={10}\n type=\"card\"\n defaultActiveKey=\"E1001\"\n items={tabItems}\n />\n )}\n </div>\n </Card>\n );\n};\n"],"names":["BundleAlert","title","dataSource","extraData","activeKey","setActiveKey","useState","tabData","data","target","td","tabItems","tagStyle","tagTextStyle","LabelComponent","Overview","styles","Tag","children","description","AlertCollapse","CrossChunksAlertCollapse","CommonList","ECMAVersionCheck","Empty","Card","Tabs"],"mappings":";;;;;;;;;;AA2BO,MAAMA,cAA0C,CAAC,EACtDC,KAAK,EACLC,UAAU,EACVC,SAAS,EACV;IACC,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAAS;IAC3C,MAAMC,UAID;QACH;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,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BACJ,aAAa;wBACb,OAAOA,MAAM,sBAAsB;;;;;;AAejD"}
1
+ {"version":3,"file":"components/Alerts/bundle-alert.mjs","sources":["../../../src/components/Alerts/bundle-alert.tsx"],"sourcesContent":["import { Tabs, Empty, Tag } from 'antd';\n\nimport { Card } from '../Card';\nimport { ECMAVersionCheck } from '../Alert/ecma-version-check';\nimport { Overview } from '../Overall/overview';\nimport { AlertCollapse } from './collapse';\nimport { CommonList } from './list';\nimport { ViewMode } from '../../constants';\n\nimport { AlertProps } from '../Alert/types';\n\nimport type { Rule } from '@rsdoctor/types';\n\nimport styles from './bundle-alert.module.scss';\nimport { CSSProperties, useState } from 'react';\nimport { CrossChunksAlertCollapse } from './collapse-cross-chunks';\nimport { ModuleMixedChunksAlertCollapse } from './collapse-module-mixed-chunks';\n\ninterface BundleAlertProps {\n title: string;\n cwd: string;\n dataSource: Rule.RuleStoreDataItem[];\n extraData: Omit<AlertProps, 'data'>;\n viewMode: ViewMode;\n setViewMode(mode: ViewMode): void;\n extraCom?: JSX.Element | undefined;\n}\n\nexport const BundleAlert: React.FC<BundleAlertProps> = ({\n title,\n dataSource,\n extraData,\n}) => {\n const [activeKey, setActiveKey] = useState('E1001');\n const tabData: Array<{\n key: string;\n label: string;\n data: Array<Rule.RuleStoreDataItem>;\n }> = [\n {\n key: 'E1001',\n label: 'Duplicate Packages',\n data: [],\n },\n {\n key: 'E1002',\n label: 'Cross Chunks Package',\n data: [],\n },\n {\n key: 'E1003',\n label: 'Loader Performance Optimization',\n data: [],\n },\n {\n key: 'E1004',\n label: 'ECMA Version Check',\n data: [],\n },\n {\n key: 'E1005',\n label: 'Default Import Check',\n data: [],\n },\n {\n key: 'E1006',\n label: 'Module Mixed Chunks',\n data: [],\n },\n ];\n\n dataSource.forEach((data) => {\n const target = tabData.find((td) => td.key === data.code)?.data;\n target?.push(data);\n });\n\n const tabItems = tabData.map((td) => {\n const tagStyle =\n activeKey === td.key\n ? ({\n border: '1px solid #91D5FF',\n backgroundColor: '#E6F7FF',\n } as CSSProperties)\n : {};\n\n const tagTextStyle =\n activeKey === td.key\n ? {\n color: '#1890FF',\n }\n : {};\n\n const LabelComponent = () => (\n <Overview\n style={{\n backgroundColor: 'transparent',\n paddingLeft: 0,\n paddingRight: 0,\n width: '100%',\n }}\n title={<span className={styles.labelTitle}>{td.label}</span>}\n description={\n <div className={styles.labelDescription}>\n <span>{td.data.length}</span>\n <Tag\n style={{ fontFamily: 'Menlo', borderRadius: '2px', ...tagStyle }}\n >\n <span style={{ ...tagTextStyle }}>{td.key}</span>\n </Tag>\n </div>\n }\n />\n );\n\n let children, description;\n switch (td.key) {\n case 'E1001':\n children = <AlertCollapse data={td.data} extraData={extraData} />;\n break;\n case 'E1002':\n children = (\n <CrossChunksAlertCollapse data={td.data} extraData={extraData} />\n );\n break;\n case 'E1003':\n children = <CommonList data={td.data} />;\n break;\n case 'E1004':\n description = (\n <span>\n No ECMA Version Check Rules were found. Please refer to\n 「https://rsdoctor.rs/guide/usage/rule-config」.\n </span>\n );\n children = <ECMAVersionCheck data={td.data} />;\n break;\n case 'E1005':\n children = <CommonList data={td.data} />;\n break;\n case 'E1006':\n children = (\n <ModuleMixedChunksAlertCollapse\n data={td.data}\n extraData={extraData}\n />\n );\n break;\n default:\n children = null;\n break;\n }\n\n if (!td.data.length) {\n children = (\n <Empty description={description} image={Empty.PRESENTED_IMAGE_SIMPLE} />\n );\n }\n\n return {\n key: td.key,\n label: <LabelComponent />,\n children: (\n <Card\n className={styles.card}\n type=\"inner\"\n title={\n <>\n <Tag\n style={{\n fontFamily: 'Menlo',\n fontWeight: '700',\n fontSize: '13px',\n backgroundColor: '#EAEDF1',\n borderRadius: '2px',\n }}\n >\n {td.key}\n </Tag>\n <span>{td.label}</span>\n </>\n }\n >\n {children}\n </Card>\n ),\n };\n });\n\n return (\n <Card style={{ width: '100%', borderRadius: '12px' }}>\n <div className={styles.container}>\n <div className={styles.title}>{title}</div>\n {!dataSource.length ? (\n <div\n style={{\n minHeight: '480px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Empty\n description={'No Bundle Alerts Data'}\n image={Empty.PRESENTED_IMAGE_SIMPLE}\n />\n </div>\n ) : (\n <Tabs\n onChange={setActiveKey}\n tabBarGutter={10}\n type=\"card\"\n defaultActiveKey=\"E1001\"\n items={tabItems}\n />\n )}\n </div>\n </Card>\n );\n};\n"],"names":["BundleAlert","title","dataSource","extraData","activeKey","setActiveKey","useState","tabData","data","target","td","tabItems","tagStyle","tagTextStyle","LabelComponent","Overview","styles","Tag","children","description","AlertCollapse","CrossChunksAlertCollapse","CommonList","ECMAVersionCheck","ModuleMixedChunksAlertCollapse","Empty","Card","Tabs"],"mappings":";;;;;;;;;;;AA4BO,MAAMA,cAA0C,CAAC,EACtDC,KAAK,EACLC,UAAU,EACVC,SAAS,EACV;IACC,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAAS;IAC3C,MAAMC,UAID;QACH;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;QACA;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE;QACV;KACD;IAEDL,WAAW,OAAO,CAAC,CAACM;QAClB,MAAMC,SAASF,QAAQ,IAAI,CAAC,CAACG,KAAOA,GAAG,GAAG,KAAKF,KAAK,IAAI,GAAG;QAC3DC,QAAQ,KAAKD;IACf;IAEA,MAAMG,WAAWJ,QAAQ,GAAG,CAAC,CAACG;QAC5B,MAAME,WACJR,cAAcM,GAAG,GAAG,GACf;YACC,QAAQ;YACR,iBAAiB;QACnB,IACA,CAAC;QAEP,MAAMG,eACJT,cAAcM,GAAG,GAAG,GAChB;YACE,OAAO;QACT,IACA,CAAC;Q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N;YAAa,OAAOM,MAAM,sBAAsB;;QAIxE,OAAO;YACL,KAAKf,GAAG,GAAG;YACX,OAAO,WAAP,GAAO,IAACI,gBAAAA,CAAAA;YACR,UAAU,WAAV,GACE,IAACY,MAAIA;gBACH,WAAWV,oBAAAA,IAAW;gBACtB,MAAK;gBACL,qBACE;;sCACE,IAACC,KAAGA;4BACF,OAAO;gCACL,YAAY;gCACZ,YAAY;gCACZ,UAAU;gCACV,iBAAiB;gCACjB,cAAc;4BAChB;sCAECP,GAAG,GAAG;;sCAET,IAAC;sCAAMA,GAAG,KAAK;;;;0BAIlBQ;;QAGP;IACF;IAEA,OAAO,WAAP,GACE,IAACQ,MAAIA;QAAC,OAAO;YAAE,OAAO;YAAQ,cAAc;QAAO;kBACjD,mBAAC;YAAI,WAAWV,oBAAAA,SAAgB;;8BAC9B,IAAC;oBAAI,WAAWA,oBAAAA,KAAY;8BAAGf;;gBAC7BC,WAAW,MAAM,G,cAejB,IAACyB,MAAIA;oBACH,UAAUtB;oBACV,cAAc;oBACd,MAAK;oBACL,kBAAiB;oBACjB,OAAOM;qBApBW,WAAH,GACjB,IAAC;oBACC,OAAO;wBACL,WAAW;wBACX,SAAS;wBACT,gBAAgB;wBAChB,YAAY;oBACd;8BAEA,kBAACc,OAAKA;wBACJ,aAAa;wBACb,OAAOA,MAAM,sBAAsB;;;;;;AAejD"}
@@ -0,0 +1,6 @@
1
+ import type { Rule } from '@rsdoctor/types';
2
+ import type { AlertProps } from '../Alert/types.js';
3
+ export declare const ModuleMixedChunksAlertCollapse: (props: {
4
+ data: Array<Rule.RuleStoreDataItem>;
5
+ extraData: Omit<AlertProps, "data">;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,171 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import icons from "@ant-design/icons";
3
+ import { Collapse, Space, Tag, Typography } from "antd";
4
+ import overview from "../Overall/overview.mjs";
5
+ import collapse_module from "./collapse.module.mjs";
6
+ import total_size from "../../common/svg/total-size.mjs";
7
+ import { beautifyPath } from "../../utils/file.mjs";
8
+ const { Text } = Typography;
9
+ const { innerWidth: collapse_module_mixed_chunks_innerWidth } = window;
10
+ const LabelComponent = (props)=>{
11
+ const { title, description, extra } = props;
12
+ return /*#__PURE__*/ jsxs("div", {
13
+ className: collapse_module.label,
14
+ children: [
15
+ /*#__PURE__*/ jsxs("div", {
16
+ className: collapse_module.labelContent,
17
+ children: [
18
+ /*#__PURE__*/ jsx("div", {
19
+ children: title
20
+ }),
21
+ /*#__PURE__*/ jsx("div", {
22
+ children: description
23
+ })
24
+ ]
25
+ }),
26
+ /*#__PURE__*/ jsx("div", {
27
+ children: extra
28
+ })
29
+ ]
30
+ });
31
+ };
32
+ const ModuleMixedChunksAlertCollapse = (props)=>{
33
+ const { data, extraData } = props;
34
+ const { cwd } = extraData;
35
+ const items = data.map((d)=>{
36
+ const { module, initialChunks, asyncChunks } = d;
37
+ const modulePath = beautifyPath(module.path, cwd);
38
+ const ChildComponent = ()=>/*#__PURE__*/ jsx("div", {
39
+ className: collapse_module.collapseContainer,
40
+ children: /*#__PURE__*/ jsx(overview, {
41
+ style: {
42
+ backgroundColor: '#fff'
43
+ },
44
+ title: /*#__PURE__*/ jsxs(Space, {
45
+ children: [
46
+ /*#__PURE__*/ jsx(icons, {
47
+ style: {
48
+ fontSize: '18px'
49
+ },
50
+ component: total_size
51
+ }),
52
+ /*#__PURE__*/ jsxs(Text, {
53
+ style: {
54
+ width: collapse_module_mixed_chunks_innerWidth > 1500 ? 900 : 700
55
+ },
56
+ children: [
57
+ "Module:",
58
+ ' ',
59
+ /*#__PURE__*/ jsx(Text, {
60
+ style: {
61
+ fontSize: 12,
62
+ color: 'rgba(28, 31, 35, 0.6)',
63
+ fontWeight: 300
64
+ },
65
+ children: modulePath
66
+ })
67
+ ]
68
+ })
69
+ ]
70
+ }),
71
+ description: /*#__PURE__*/ jsxs("div", {
72
+ className: collapse_module.collapseChild,
73
+ children: [
74
+ initialChunks.length > 0 && /*#__PURE__*/ jsxs("div", {
75
+ style: {
76
+ marginBottom: 16
77
+ },
78
+ children: [
79
+ /*#__PURE__*/ jsx("div", {
80
+ style: {
81
+ marginBottom: 8,
82
+ fontWeight: 500,
83
+ color: 'rgba(28, 31, 35, 0.85)'
84
+ },
85
+ children: "Initial Chunks:"
86
+ }),
87
+ initialChunks.map((chunk)=>/*#__PURE__*/ jsxs("div", {
88
+ style: {
89
+ display: 'flex',
90
+ marginBottom: 4
91
+ },
92
+ children: [
93
+ /*#__PURE__*/ jsx("div", {
94
+ className: collapse_module.attribute,
95
+ children: "Chunk"
96
+ }),
97
+ /*#__PURE__*/ jsx("div", {
98
+ className: collapse_module.iconContainer,
99
+ children: /*#__PURE__*/ jsx("span", {
100
+ className: collapse_module.data,
101
+ children: chunk.name || `chunk-${chunk.id}`
102
+ })
103
+ })
104
+ ]
105
+ }, chunk.id))
106
+ ]
107
+ }),
108
+ asyncChunks.length > 0 && /*#__PURE__*/ jsxs("div", {
109
+ children: [
110
+ /*#__PURE__*/ jsx("div", {
111
+ style: {
112
+ marginBottom: 8,
113
+ fontWeight: 500,
114
+ color: 'rgba(28, 31, 35, 0.85)'
115
+ },
116
+ children: "Async Chunks:"
117
+ }),
118
+ asyncChunks.map((chunk)=>/*#__PURE__*/ jsxs("div", {
119
+ style: {
120
+ display: 'flex',
121
+ marginBottom: 4
122
+ },
123
+ children: [
124
+ /*#__PURE__*/ jsx("div", {
125
+ className: collapse_module.attribute,
126
+ children: "Chunk"
127
+ }),
128
+ /*#__PURE__*/ jsx("div", {
129
+ className: collapse_module.iconContainer,
130
+ children: /*#__PURE__*/ jsx("span", {
131
+ className: collapse_module.data,
132
+ children: chunk.name || `(no chunk name, ChunkId: ${chunk.id})`
133
+ })
134
+ })
135
+ ]
136
+ }, chunk.id))
137
+ ]
138
+ })
139
+ ]
140
+ })
141
+ })
142
+ });
143
+ return {
144
+ key: modulePath,
145
+ label: /*#__PURE__*/ jsx(LabelComponent, {
146
+ title: /*#__PURE__*/ jsx(Tag, {
147
+ style: {
148
+ backgroundColor: '#EAEDF1',
149
+ borderRadius: '2px'
150
+ },
151
+ children: /*#__PURE__*/ jsx("span", {
152
+ className: collapse_module.pkgName,
153
+ children: modulePath
154
+ })
155
+ }),
156
+ description: "is included in both initial and async chunks."
157
+ }),
158
+ children: /*#__PURE__*/ jsx(ChildComponent, {})
159
+ };
160
+ });
161
+ return /*#__PURE__*/ jsx(Collapse, {
162
+ style: {
163
+ width: '100%'
164
+ },
165
+ defaultActiveKey: items.map((item)=>item.key),
166
+ items: items
167
+ });
168
+ };
169
+ export { ModuleMixedChunksAlertCollapse };
170
+
171
+ //# sourceMappingURL=collapse-module-mixed-chunks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/Alerts/collapse-module-mixed-chunks.mjs","sources":["../../../src/components/Alerts/collapse-module-mixed-chunks.tsx"],"sourcesContent":["import Icon from '@ant-design/icons';\nimport { Collapse, Space, Tag, Typography } from 'antd';\nimport { ReactNode } from 'react';\n\nimport Overview from '../Overall/overview';\nimport styles from './collapse.module.scss';\nimport TotalSizeSvg from '../../common/svg/total-size.svg';\nimport { beautifyPath } from '../../utils/file';\n\nimport type { Rule } from '@rsdoctor/types';\nimport type { AlertProps } from '../Alert/types';\n\nconst { Text } = Typography;\nconst { innerWidth } = window;\n\nconst LabelComponent = (props: {\n title: string | ReactNode;\n description: string;\n extra?: ReactNode;\n}) => {\n const { title, description, extra } = props;\n return (\n <div className={styles.label}>\n <div className={styles.labelContent}>\n <div>{title}</div>\n <div>{description}</div>\n </div>\n <div>{extra}</div>\n </div>\n );\n};\n\nexport const ModuleMixedChunksAlertCollapse = (props: {\n data: Array<Rule.RuleStoreDataItem>;\n extraData: Omit<AlertProps, 'data'>;\n}) => {\n const { data, extraData } = props;\n const { cwd } = extraData;\n\n const items = data.map((d) => {\n const { module, initialChunks, asyncChunks } =\n d as Rule.ModuleMixedChunksRuleStoreData;\n\n const modulePath = beautifyPath(module.path, cwd);\n\n const ChildComponent = () => {\n return (\n <div className={styles.collapseContainer}>\n <Overview\n style={{ backgroundColor: '#fff' }}\n title={\n <Space>\n <Icon style={{ fontSize: '18px' }} component={TotalSizeSvg} />\n <Text style={{ width: innerWidth > 1500 ? 900 : 700 }}>\n Module:{' '}\n <Text\n style={{\n fontSize: 12,\n color: 'rgba(28, 31, 35, 0.6)',\n fontWeight: 300,\n }}\n >\n {modulePath}\n </Text>\n </Text>\n </Space>\n }\n description={\n <div className={styles.collapseChild}>\n {initialChunks.length > 0 && (\n <div style={{ marginBottom: 16 }}>\n <div\n style={{\n marginBottom: 8,\n fontWeight: 500,\n color: 'rgba(28, 31, 35, 0.85)',\n }}\n >\n Initial Chunks:\n </div>\n {initialChunks.map((chunk) => (\n <div\n key={chunk.id}\n style={{ display: 'flex', marginBottom: 4 }}\n >\n <div className={styles.attribute}>Chunk</div>\n <div className={styles.iconContainer}>\n <span className={styles.data}>\n {chunk.name || `chunk-${chunk.id}`}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n {asyncChunks.length > 0 && (\n <div>\n <div\n style={{\n marginBottom: 8,\n fontWeight: 500,\n color: 'rgba(28, 31, 35, 0.85)',\n }}\n >\n Async Chunks:\n </div>\n {asyncChunks.map((chunk) => (\n <div\n key={chunk.id}\n style={{ display: 'flex', marginBottom: 4 }}\n >\n <div className={styles.attribute}>Chunk</div>\n <div className={styles.iconContainer}>\n <span className={styles.data}>\n {chunk.name ||\n `(no chunk name, ChunkId: ${chunk.id})`}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n }\n />\n </div>\n );\n };\n\n return {\n key: modulePath,\n label: (\n <LabelComponent\n title={\n <Tag style={{ backgroundColor: '#EAEDF1', borderRadius: '2px' }}>\n <span className={styles.pkgName}>{modulePath}</span>\n </Tag>\n }\n description={`is included in both initial and async chunks.`}\n />\n ),\n children: <ChildComponent />,\n };\n });\n\n return (\n <Collapse\n style={{ width: '100%' }}\n defaultActiveKey={items.map((item) => item.key)}\n items={items}\n />\n );\n};\n"],"names":["Text","Typography","innerWidth","window","LabelComponent","props","title","description","extra","styles","ModuleMixedChunksAlertCollapse","data","extraData","cwd","items","d","module","initialChunks","asyncChunks","modulePath","beautifyPath","ChildComponent","Overview","Space","Icon","TotalSizeSvg","chunk","Tag","Collapse","item"],"mappings":";;;;;;;AAYA,MAAM,EAAEA,IAAI,EAAE,GAAGC;AACjB,MAAM,EAAEC,YAAU,yCAAE,GAAGC;AAEvB,MAAMC,iBAAiB,CAACC;IAKtB,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAE,GAAGH;IACtC,OAAO,WAAP,GACE,KAAC;QAAI,WAAWI,gBAAAA,KAAY;;0BAC1B,KAAC;gBAAI,WAAWA,gBAAAA,YAAmB;;kCACjC,IAAC;kCAAKH;;kCACN,IAAC;kCAAKC;;;;0BAER,IAAC;0BAAKC;;;;AAGZ;AAEO,MAAME,iCAAiC,CAACL;IAI7C,MAAM,EAAEM,IAAI,EAAEC,SAAS,EAAE,GAAGP;IAC5B,MAAM,EAAEQ,GAAG,EAAE,GAAGD;IAEhB,MAAME,QAAQH,KAAK,GAAG,CAAC,CAACI;QACtB,MAAM,EAAEC,MAAM,EAAEC,aAAa,EAAEC,WAAW,EAAE,GAC1CH;QAEF,MAAMI,aAAaC,aAAaJ,OAAO,IAAI,EAAEH;QAE7C,MAAMQ,iBAAiB,IACd,WAAP,GACE,IAAC;gBAAI,WAAWZ,gBAAAA,iBAAwB;0BACtC,kBAACa,UAAQA;oBACP,OAAO;wBAAE,iBAAiB;oBAAO;oBACjC,qBACE,KAACC,OAAKA;;0CACJ,IAACC,OAAIA;gCAAC,OAAO;oCAAE,UAAU;gCAAO;gCAAG,WAAWC;;0CAC9C,KAACzB,MAAAA;gCAAK,OAAO;oCAAE,OAAOE,0CAAa,OAAO,MAAM;gCAAI;;oCAAG;oCAC7C;kDACR,IAACF,MAAAA;wCACC,OAAO;4CACL,UAAU;4CACV,OAAO;4CACP,Y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WlB,gBAAAA,OAAc;kCAAGU;;;gBAGtC,aAAa;;YAGjB,UAAU,WAAV,GAAU,IAACE,gBAAAA,CAAAA;QACb;IACF;IAEA,OAAO,WAAP,GACE,IAACO,UAAQA;QACP,OAAO;YAAE,OAAO;QAAO;QACvB,kBAAkBd,MAAM,GAAG,CAAC,CAACe,OAASA,KAAK,GAAG;QAC9C,OAAOf;;AAGb"}
@@ -350,7 +350,7 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
350
350
  children: (data)=>{
351
351
  const isTargetFileType = (filePath)=>{
352
352
  const ext = filePath.toLowerCase().split('.').pop() || '';
353
- return 'js' === ext || 'cjs' === ext || 'mjs' === ext || 'css' === ext || 'html' === ext;
353
+ return 'js' === ext || 'cjs' === ext || 'mjs' === ext || 'bundle' === ext || 'css' === ext || 'html' === ext;
354
354
  };
355
355
  const computedTreeData = data.filter((item)=>isTargetFileType(item.asset.path)).map((item)=>({
356
356
  name: item.asset.path,
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodeOutlined,\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n InputNumber,\n Row,\n Select,\n Space,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { debounce, sumBy } from 'es-toolkit/compat';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useCodeDrawer } from 'src/components/base/CodeViewer/useCodeDrawer';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { FileTree } from '../../../components/FileTree';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { Size } from '../../../constants';\nimport { useProjectInfo } from '../../../components/Layout/project-info-context';\nimport {\n createFileStructures,\n flattenTreemapData,\n formatSize,\n useI18n,\n} from '../../../utils';\nimport { GraphType } from '../constants';\nimport { AssetDetail } from './asset';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport { SearchModal } from './search-modal';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\n\nconst { Option } = Select;\n\nconst cardBodyHeight = 600;\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\nconst tabList = [\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>{'Tree Graph'}</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\" size=\"middle\">\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated module\n </Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where multiple\n modules are merged (or \"hoisted\") into a single\n scope instead of wrapping each module in separate\n function closures. This reduces the bundle size\n and improves runtime performance by minimizing\n function call overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)', marginLeft: 4 }}\n />\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<CodepenCircleOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<DeploymentUnitOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module reasons in\n stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after processing,\n bundling, and optimization. This is what is delivered to the\n browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before any\n processing or transformations. This is the raw size of your\n code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />\n </Tooltip>\n </Space>\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n },\n];\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [selectedEntryPoints, setEntryPoints] = useState<SDK.EntryPointData[]>(\n [],\n );\n const [inputModule, setModuleValue] = useState(0);\n const [inputAssetName, setAssetName] = useState('');\n const [inputAssetSize, setAssetSize] = useState(0);\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [inputModuleUnit, setModuleUnit] = useState('');\n const [inputChunkUnit, setChunkUnit] = useState('');\n const [assetPath, setAssetPath] = useState<string | null>(null);\n const [graphType, setGraphType] = useState('tree' as GraphType);\n const { showCode, codeDrawerComponent } = useCodeDrawer(\n 'Do not have the codes of assets. If you use the lite or brief mode, there will have codes.',\n );\n\n const { t } = useI18n();\n\n const assets = summary.all.total.files;\n\n const handleChange = useCallback(\n (type: string) => (value: string) => {\n if (type === 'module') {\n setModuleUnit(value);\n } else if (type === 'chunk') {\n setChunkUnit(value);\n }\n },\n [],\n );\n\n const selectAfter = (type: string) => (\n <Select defaultValue=\"kb\" onChange={handleChange(type)}>\n <Option value=\"kb\">KB</Option>\n <Option value=\"mb\">MB</Option>\n </Select>\n );\n const onChangeModule = useCallback(\n debounce((newValue: number) => {\n const count =\n inputModuleUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setModuleValue(count);\n }, 300),\n [],\n );\n\n const onChangeAsset = useCallback(\n debounce((newValue: number) => {\n const count =\n inputChunkUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setAssetSize(count);\n }, 300),\n [],\n );\n\n const filteredAssets = useMemo(() => {\n let res = assets.slice();\n\n if (inputAssetName) {\n res = res.filter((e) => e.path.indexOf(inputAssetName) > -1);\n }\n\n if (inputAssetSize > 0) {\n res = res.filter((e) => e.size >= inputAssetSize);\n }\n\n if (selectedEntryPoints.length) {\n res = res.filter((e) => {\n if (selectedEntryPoints.some((ep) => ep.assets.includes(e.path))) {\n return true;\n }\n return false;\n });\n }\n\n return res.sort((a, b) => {\n const _a = a.path.indexOf('/') > -1 ? 1 : 0;\n const _b = b.path.indexOf('/') > -1 ? 1 : 0;\n // return _a - _b;\n return _b - _a;\n });\n }, [assets, selectedEntryPoints, inputAssetName, inputAssetSize]);\n\n useEffect(() => {\n function getFileExtension(filePath: string) {\n const parts = filePath.split('.');\n return parts.length > 1 ? parts.pop() : '';\n }\n\n summary.all.total.files.forEach((f) => {\n const ext = getFileExtension(f.path);\n if (ext === 'js') {\n setAssetPath(f.path);\n }\n });\n }, [summary.all.total.files]);\n\n const assetsStructures = useMemo(() => {\n const res = createFileStructures({\n files: filteredAssets.map((e) => e.path).filter(Boolean),\n fileTitle(file, basename) {\n const target = filteredAssets.find((e) => e.path === file)!;\n const { size, initial, path, content } = target;\n\n return (\n <div\n className={styles.assetBox}\n onClick={() => {\n setAssetPath(path);\n }}\n >\n <Keyword text={basename} keyword={''} className={styles.fileText} />\n <Space size=\"small\" className={styles.assetsTag}>\n <Divider type=\"vertical\" />\n <Typography.Text style={{ color: '#4FD233' }}>\n {formatSize(size)}\n </Typography.Text>\n <Divider type=\"vertical\" />\n {initial ? (\n <Typography.Text style={{ color: '#009A9E' }}>\n initial\n </Typography.Text>\n ) : null}\n <CodeOutlined\n style={{ fontSize: 14, padding: 0 }}\n onClick={() => showCode({ code: content!, filePath: path })}\n />\n </Space>\n </div>\n );\n },\n });\n return res;\n }, [filteredAssets]);\n\n const onSearch = (value: string) => {\n setAssetName(value);\n setDefaultExpandAll(false);\n };\n\n return (\n <>\n <div className=\"bundle-size-card\">\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n <Card\n className=\"bundle-size=card\"\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n hidden={graphType === 'tree'}\n tabProps={{\n size: 'middle',\n }}\n >\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } = Rspack.checkSourceMapSupport(\n data.configs,\n );\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetSummaryBundles}>\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), CSS, and HTML files\n const isTargetFileType = (filePath: string): boolean => {\n const ext = filePath.toLowerCase().split('.').pop() || '';\n return (\n ext === 'js' ||\n ext === 'cjs' ||\n ext === 'mjs' ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) => isTargetFileType(item.asset.path))\n .map((item) => ({\n name: item.asset.path,\n value: item.asset.size,\n children: flattenTreemapData(item.modules).children,\n }));\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n </Card>\n\n <Card\n hidden={graphType === 'treemap'}\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n tabProps={{\n size: 'middle',\n }}\n >\n <Space direction=\"vertical\">\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n {entryPoints && entryPoints.length ? (\n <Col>\n <Select\n mode=\"multiple\"\n value={selectedEntryPoints.map((e) => e.name)}\n style={{ minWidth: 230, width: 'auto', maxWidth: 300 }}\n placeholder={'filter assets by entry point'}\n onChange={(name: string[]) => {\n setEntryPoints(\n name\n .map((e) => entryPoints.find((ep) => ep.name === e)!)\n .filter(Boolean),\n );\n }}\n allowClear\n onClear={() => {\n setEntryPoints([]);\n }}\n >\n {entryPoints.map((e) => {\n return (\n <Select.Option key={e.name} value={e.name}>\n <Space>\n <Bdg\n label={e.name}\n value={formatSize(e.size)}\n tooltip={e.name}\n />\n </Space>\n </Select.Option>\n );\n })}\n </Select>\n </Col>\n ) : null}\n <Col>\n <KeywordInput\n placeholder=\"search asset by keyword\"\n onChange={onSearch}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Asset Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the output assets which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => onChangeAsset(Number(value))}\n addonAfter={selectAfter('chunk')}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Module Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the modules which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => {\n onChangeModule(Number(value));\n }}\n addonAfter={selectAfter('module')}\n />\n </Col>\n </Row>\n <Row>\n <SearchModal />\n </Row>\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n {filteredAssets.length ? (\n <Row gutter={Size.BasePadding}>\n <Col span={6}>\n <Card\n title={\n <Space>\n <Typography.Text>\n {t('Output Assets List')}\n </Typography.Text>\n <Divider type=\"vertical\" />\n <Tooltip\n title={`total assets count is ${assets.length}, the filtered assets count is ${filteredAssets.length}`}\n >\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {filteredAssets.length} / {assets.length}\n </Typography.Text>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {formatSize(sumBy(filteredAssets, (e) => e.size))}\n </Typography.Text>\n </Space>\n }\n size=\"small\"\n bodyStyle={{\n overflow: 'scroll',\n height: cardBodyHeight,\n }}\n >\n <FileTree\n className={styles.assets}\n treeData={assetsStructures}\n autoExpandParent\n defaultExpandAll={\n defaultExpandAll || filteredAssets.length <= 20\n }\n key={`tree_${inputAssetName}_${defaultExpandAll}`}\n />\n </Card>\n </Col>\n <Col span={18}>\n {assetPath ? (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetDetails}\n body={{ assetPath }}\n >\n {(details) => (\n <AssetDetail\n asset={details.asset}\n chunks={details.chunks}\n modules={details.modules}\n height={cardBodyHeight}\n moduleSizeLimit={inputModule}\n root={cwd}\n />\n )}\n </ServerAPIProvider>\n ) : (\n <Card\n bodyStyle={{\n height: cardBodyHeight,\n }}\n >\n <Empty\n description={\n <Typography.Text strong>\n Click the file path on the left to show the\n modules of the asset\n </Typography.Text>\n }\n />\n </Card>\n )}\n </Col>\n </Row>\n ) : (\n <Empty />\n )}\n </Col>\n </Row>\n </Space>\n </Card>\n </div>\n {codeDrawerComponent}\n </>\n );\n};\n\nexport const WebpackModulesOverall: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { root, errors } = project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["Option","Select","cardBodyHeight","tabList","Space","Typography","Tooltip","Row","Col","Tag","InfoCircleOutlined","Button","CodepenCircleOutlined","DeploymentUnitOutlined","WebpackModulesOverallBase","errors","cwd","summary","entryPoints","selectedEntryPoints","setEntryPoints","useState","inputModule","setModuleValue","inputAssetName","setAssetName","inputAssetSize","setAssetSize","defaultExpandAll","setDefaultExpandAll","inputModuleUnit","setModuleUnit","inputChunkUnit","setChunkUnit","assetPath","setAssetPath","graphType","setGraphType","showCode","codeDrawerComponent","useCodeDrawer","t","useI18n","assets","handleChange","useCallback","type","value","selectAfter","onChangeModule","debounce","newValue","count","onChangeAsset","filteredAssets","useMemo","res","e","ep","a","b","_a","_b","useEffect","getFileExtension","filePath","parts","f","ext","assetsStructures","createFileStructures","Boolean","file","basename","target","size","initial","path","content","styles","Keyword","Divider","formatSize","CodeOutlined","onSearch","BundleCards","Card","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isTargetFileType","computedTreeData","item","flattenTreemapData","AssetTreemapWithFilter","Size","name","Bdg","KeywordInput","InputNumber","Number","SearchModal","sumBy","FileTree","details","AssetDetail","Empty","WebpackModulesOverall","project","useProjectInfo","root"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,EAAEA,MAAM,EAAE,GAA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,WAAW,IAAI;gEAAC,QAAM;0EAAC;;;;;;2DAWpC,IAACwG,OAAKA,CAAAA;;;;;;;;YAOjBtE;;;AAGP;AAEO,MAAMuE,wBAAkC;IAC7C,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,SACH,OAAO;IAGT,MAAM,EAAEE,IAAI,EAAElG,MAAM,EAAE,GAAGgG;IACzB,OAAO,WAAP,GACE,IAACxB,mBAAiBA;QAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB;QACvC,MAAM;YAAE,iBAAiB;QAAK;kBAE7B,CAACvE,UACO,WAAP,GACE,IAACsE,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAACtE,cAAAA,WAAAA,GACA,IAACJ,2BAAAA;wBACC,KAAKmG;wBACL,QAAQlG;wBACR,SAASE;wBACT,aAAaC;;;;AAQ7B"}
1
+ {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodeOutlined,\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n InputNumber,\n Row,\n Select,\n Space,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { debounce, sumBy } from 'es-toolkit/compat';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useCodeDrawer } from 'src/components/base/CodeViewer/useCodeDrawer';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { FileTree } from '../../../components/FileTree';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { Size } from '../../../constants';\nimport { useProjectInfo } from '../../../components/Layout/project-info-context';\nimport {\n createFileStructures,\n flattenTreemapData,\n formatSize,\n useI18n,\n} from '../../../utils';\nimport { GraphType } from '../constants';\nimport { AssetDetail } from './asset';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport { SearchModal } from './search-modal';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\n\nconst { Option } = Select;\n\nconst cardBodyHeight = 600;\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\nconst tabList = [\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>{'Tree Graph'}</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\" size=\"middle\">\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated module\n </Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where multiple\n modules are merged (or \"hoisted\") into a single\n scope instead of wrapping each module in separate\n function closures. This reduces the bundle size\n and improves runtime performance by minimizing\n function call overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)', marginLeft: 4 }}\n />\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<CodepenCircleOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<DeploymentUnitOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module reasons in\n stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after processing,\n bundling, and optimization. This is what is delivered to the\n browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before any\n processing or transformations. This is the raw size of your\n code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />\n </Tooltip>\n </Space>\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n },\n];\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [selectedEntryPoints, setEntryPoints] = useState<SDK.EntryPointData[]>(\n [],\n );\n const [inputModule, setModuleValue] = useState(0);\n const [inputAssetName, setAssetName] = useState('');\n const [inputAssetSize, setAssetSize] = useState(0);\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [inputModuleUnit, setModuleUnit] = useState('');\n const [inputChunkUnit, setChunkUnit] = useState('');\n const [assetPath, setAssetPath] = useState<string | null>(null);\n const [graphType, setGraphType] = useState('tree' as GraphType);\n const { showCode, codeDrawerComponent } = useCodeDrawer(\n 'Do not have the codes of assets. If you use the lite or brief mode, there will have codes.',\n );\n\n const { t } = useI18n();\n\n const assets = summary.all.total.files;\n\n const handleChange = useCallback(\n (type: string) => (value: string) => {\n if (type === 'module') {\n setModuleUnit(value);\n } else if (type === 'chunk') {\n setChunkUnit(value);\n }\n },\n [],\n );\n\n const selectAfter = (type: string) => (\n <Select defaultValue=\"kb\" onChange={handleChange(type)}>\n <Option value=\"kb\">KB</Option>\n <Option value=\"mb\">MB</Option>\n </Select>\n );\n const onChangeModule = useCallback(\n debounce((newValue: number) => {\n const count =\n inputModuleUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setModuleValue(count);\n }, 300),\n [],\n );\n\n const onChangeAsset = useCallback(\n debounce((newValue: number) => {\n const count =\n inputChunkUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setAssetSize(count);\n }, 300),\n [],\n );\n\n const filteredAssets = useMemo(() => {\n let res = assets.slice();\n\n if (inputAssetName) {\n res = res.filter((e) => e.path.indexOf(inputAssetName) > -1);\n }\n\n if (inputAssetSize > 0) {\n res = res.filter((e) => e.size >= inputAssetSize);\n }\n\n if (selectedEntryPoints.length) {\n res = res.filter((e) => {\n if (selectedEntryPoints.some((ep) => ep.assets.includes(e.path))) {\n return true;\n }\n return false;\n });\n }\n\n return res.sort((a, b) => {\n const _a = a.path.indexOf('/') > -1 ? 1 : 0;\n const _b = b.path.indexOf('/') > -1 ? 1 : 0;\n // return _a - _b;\n return _b - _a;\n });\n }, [assets, selectedEntryPoints, inputAssetName, inputAssetSize]);\n\n useEffect(() => {\n function getFileExtension(filePath: string) {\n const parts = filePath.split('.');\n return parts.length > 1 ? parts.pop() : '';\n }\n\n summary.all.total.files.forEach((f) => {\n const ext = getFileExtension(f.path);\n if (ext === 'js') {\n setAssetPath(f.path);\n }\n });\n }, [summary.all.total.files]);\n\n const assetsStructures = useMemo(() => {\n const res = createFileStructures({\n files: filteredAssets.map((e) => e.path).filter(Boolean),\n fileTitle(file, basename) {\n const target = filteredAssets.find((e) => e.path === file)!;\n const { size, initial, path, content } = target;\n\n return (\n <div\n className={styles.assetBox}\n onClick={() => {\n setAssetPath(path);\n }}\n >\n <Keyword text={basename} keyword={''} className={styles.fileText} />\n <Space size=\"small\" className={styles.assetsTag}>\n <Divider type=\"vertical\" />\n <Typography.Text style={{ color: '#4FD233' }}>\n {formatSize(size)}\n </Typography.Text>\n <Divider type=\"vertical\" />\n {initial ? (\n <Typography.Text style={{ color: '#009A9E' }}>\n initial\n </Typography.Text>\n ) : null}\n <CodeOutlined\n style={{ fontSize: 14, padding: 0 }}\n onClick={() => showCode({ code: content!, filePath: path })}\n />\n </Space>\n </div>\n );\n },\n });\n return res;\n }, [filteredAssets]);\n\n const onSearch = (value: string) => {\n setAssetName(value);\n setDefaultExpandAll(false);\n };\n\n return (\n <>\n <div className=\"bundle-size-card\">\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n <Card\n className=\"bundle-size=card\"\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n hidden={graphType === 'tree'}\n tabProps={{\n size: 'middle',\n }}\n >\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } = Rspack.checkSourceMapSupport(\n data.configs,\n );\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetSummaryBundles}>\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), .bundle, CSS, and HTML files\n const isTargetFileType = (filePath: string): boolean => {\n const ext = filePath.toLowerCase().split('.').pop() || '';\n return (\n ext === 'js' ||\n ext === 'cjs' ||\n ext === 'mjs' ||\n ext === 'bundle' ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) => isTargetFileType(item.asset.path))\n .map((item) => ({\n name: item.asset.path,\n value: item.asset.size,\n children: flattenTreemapData(item.modules).children,\n }));\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n </Card>\n\n <Card\n hidden={graphType === 'treemap'}\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n tabProps={{\n size: 'middle',\n }}\n >\n <Space direction=\"vertical\">\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n {entryPoints && entryPoints.length ? (\n <Col>\n <Select\n mode=\"multiple\"\n value={selectedEntryPoints.map((e) => e.name)}\n style={{ minWidth: 230, width: 'auto', maxWidth: 300 }}\n placeholder={'filter assets by entry point'}\n onChange={(name: string[]) => {\n setEntryPoints(\n name\n .map((e) => entryPoints.find((ep) => ep.name === e)!)\n .filter(Boolean),\n );\n }}\n allowClear\n onClear={() => {\n setEntryPoints([]);\n }}\n >\n {entryPoints.map((e) => {\n return (\n <Select.Option key={e.name} value={e.name}>\n <Space>\n <Bdg\n label={e.name}\n value={formatSize(e.size)}\n tooltip={e.name}\n />\n </Space>\n </Select.Option>\n );\n })}\n </Select>\n </Col>\n ) : null}\n <Col>\n <KeywordInput\n placeholder=\"search asset by keyword\"\n onChange={onSearch}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Asset Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the output assets which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => onChangeAsset(Number(value))}\n addonAfter={selectAfter('chunk')}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Module Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the modules which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => {\n onChangeModule(Number(value));\n }}\n addonAfter={selectAfter('module')}\n />\n </Col>\n </Row>\n <Row>\n <SearchModal />\n </Row>\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n {filteredAssets.length ? (\n <Row gutter={Size.BasePadding}>\n <Col span={6}>\n <Card\n title={\n <Space>\n <Typography.Text>\n {t('Output Assets List')}\n </Typography.Text>\n <Divider type=\"vertical\" />\n <Tooltip\n title={`total assets count is ${assets.length}, the filtered assets count is ${filteredAssets.length}`}\n >\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {filteredAssets.length} / {assets.length}\n </Typography.Text>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {formatSize(sumBy(filteredAssets, (e) => e.size))}\n </Typography.Text>\n </Space>\n }\n size=\"small\"\n bodyStyle={{\n overflow: 'scroll',\n height: cardBodyHeight,\n }}\n >\n <FileTree\n className={styles.assets}\n treeData={assetsStructures}\n autoExpandParent\n defaultExpandAll={\n defaultExpandAll || filteredAssets.length <= 20\n }\n key={`tree_${inputAssetName}_${defaultExpandAll}`}\n />\n </Card>\n </Col>\n <Col span={18}>\n {assetPath ? (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetDetails}\n body={{ assetPath }}\n >\n {(details) => (\n <AssetDetail\n asset={details.asset}\n chunks={details.chunks}\n modules={details.modules}\n height={cardBodyHeight}\n moduleSizeLimit={inputModule}\n root={cwd}\n />\n )}\n </ServerAPIProvider>\n ) : (\n <Card\n bodyStyle={{\n height: cardBodyHeight,\n }}\n >\n <Empty\n description={\n <Typography.Text strong>\n Click the file path on the left to show the\n modules of the asset\n </Typography.Text>\n }\n />\n </Card>\n )}\n </Col>\n </Row>\n ) : (\n <Empty />\n )}\n </Col>\n </Row>\n </Space>\n </Card>\n </div>\n {codeDrawerComponent}\n </>\n );\n};\n\nexport const WebpackModulesOverall: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { root, errors } = project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["Option","Select","cardBodyHeight","tabList","Space","Typography","Tooltip","Row","Col","Tag","InfoCircleOutlined","Button","CodepenCircleOutlined","DeploymentUnitOutlined","WebpackModulesOverallBase","errors","cwd","summary","entryPoints","selectedEntryPoints","setEntryPoints","useState","inputModule","setModuleValue","inputAssetName","setAssetName","inputAssetSize","setAssetSize","defaultExpandAll","setDefaultExpandAll","inputModuleUnit","setModuleUnit","inputChunkUnit","setChunkUnit","assetPath","setAssetPath","graphType","setGraphType","showCode","codeDrawerComponent","useCodeDrawer","t","useI18n","assets","handleChange","useCallback","type","value","selectAfter","onChangeModule","debounce","newValue","count","onChangeAsset","filteredAssets","useMemo","res","e","ep","a","b","_a","_b","useEffect","getFileExtension","filePath","parts","f","ext","assetsStructures","createFileStructures","Boolean","file","basename","target","size","initial","path","content","styles","Keyword","Divider","formatSize","CodeOutlined","onSearch","BundleCards","Card","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isTargetFileType","computedTreeData","item","flattenTreemapData","AssetTreemapWithFilter","Size","name","Bdg","KeywordInput","InputNumber","Number","SearchModal","sumBy","FileTree","details","AssetDetail","Empty","WebpackModulesOverall","project","useProjectInfo","root"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,EAAEA,MAAM,EAAE,GAAGC;AAEnB,MAAMC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xG,WAAW,IAAI;gEAAC,QAAM;0EAAC;;;;;;2DAWpC,IAACwG,OAAKA,CAAAA;;;;;;;;YAOjBtE;;;AAGP;AAEO,MAAMuE,wBAAkC;IAC7C,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,SACH,OAAO;IAGT,MAAM,EAAEE,IAAI,EAAElG,MAAM,EAAE,GAAGgG;IACzB,OAAO,WAAP,GACE,IAACxB,mBAAiBA;QAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB;QACvC,MAAM;YAAE,iBAAiB;QAAK;kBAE7B,CAACvE,UACO,WAAP,GACE,IAACsE,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAACtE,cAAAA,WAAAA,GACA,IAACJ,2BAAAA;wBACC,KAAKmG;wBACL,QAAQlG;wBACR,SAASE;wBACT,aAAaC;;;;AAQ7B"}
@@ -14,9 +14,7 @@ import { SortType, UpdateType } from "./constants.mjs";
14
14
  import { formatDiffSize } from "./utils.mjs";
15
15
  import { Graph } from "@rsdoctor/utils/common";
16
16
  const fileTypes = {
17
- JS: [
18
- Constants.JSExtension
19
- ],
17
+ JS: Constants.JSExtensions,
20
18
  CSS: [
21
19
  Constants.CSSExtension
22
20
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/assets.mjs","sources":["../../../../../src/pages/Resources/BundleDiff/DiffContainer/assets.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Button,\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { sumBy } from 'es-toolkit/compat';\nimport {\n CheckSquareOutlined,\n InfoCircleOutlined,\n MinusSquareOutlined,\n PlusSquareOutlined,\n SortAscendingOutlined,\n FileSearchOutlined,\n AppstoreAddOutlined,\n} from '@ant-design/icons';\nimport { Constants, SDK, Client } from '@rsdoctor/types';\nimport { BundleDiffTableAssetsData } from './types';\nimport { formatPercent, formatSize } from '../../../../utils';\nimport { Color, Size } from '../../../../constants';\nimport { Percent, SizePercent } from '../../../../components/Card/diff';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ModuleRowForAsset } from './row';\nimport { ViewChanges } from './changes';\nimport { UpdateType, SortType } from './constants';\nimport { formatDiffSize } from './utils';\nimport { Graph } from '@rsdoctor/utils/common';\n\nconst fileTypes = {\n JS: [Constants.JSExtension],\n CSS: [Constants.CSSExtension],\n HTML: [Constants.HtmlExtension],\n Imgs: Constants.ImgExtensions,\n Fonts: Constants.FontExtensions,\n Media: Constants.MediaExtensions,\n Others: [],\n};\n\nconst definedExtensions = Object.values(fileTypes).flat();\n\nconst Name: React.FC<{ data: BundleDiffTableAssetsData }> = ({ data: r }) => {\n const name = (\n <Space>\n <Typography.Text strong>{r.alias}</Typography.Text>\n <Tooltip\n title={\n <Space style={{ color: 'inherit' }} direction=\"vertical\">\n {r.current ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Current realpath: {r.current.path}\n </Typography.Text>\n ) : null}\n {r.baseline ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Baseline realpath: {r.baseline.path}\n </Typography.Text>\n ) : null}\n </Space>\n }\n >\n <InfoCircleOutlined />\n </Tooltip>\n </Space>\n );\n\n if (r.baseline && !r.current) {\n // deleted\n return (\n <Space>\n <MinusSquareOutlined style={{ color: Color.Red }} />\n {name}\n </Space>\n );\n }\n\n if (!r.baseline && r.current) {\n // new\n return (\n <Space>\n <PlusSquareOutlined style={{ color: Color.Green }} />\n {name}\n </Space>\n );\n }\n\n if (r.baseline && r.current) {\n // update\n return (\n <Space>\n <CheckSquareOutlined style={{ color: Color.Yellow }} />\n {name}\n </Space>\n );\n }\n\n return name;\n};\n\nexport const Assets: React.FC<{\n outputFilename: string;\n baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n}> = ({ baseline, current, outputFilename }) => {\n const bOutPutFileName = outputFilename;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedFileTypes, setSelectedFileTypes] = useState<string[]>([]);\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n const [selectedSortType, setSelectedSortType] = useState<SortType>(\n SortType.Size,\n );\n const [selectedBAsset, setSelectedBAsset] = useState(null);\n const [selectedCAsset, setSelectedCAsset] = useState(null);\n\n const { assets: bAssets } = baseline.chunkGraph;\n const { assets: cAssets } = current.chunkGraph;\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableAssetsData> = {};\n if (selectedBAsset && selectedCAsset) {\n res.choose = {\n alias: `${selectedBAsset} \\n ${selectedCAsset}`,\n current: cAssets.find((c: SDK.AssetData) => c.path === selectedCAsset),\n baseline: bAssets.find((b: SDK.AssetData) => b.path === selectedBAsset),\n };\n return Object.values(res);\n }\n\n bAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = {\n alias,\n baseline: asset,\n };\n } else {\n console.warn('[Baseline Asset Exists]: ', asset, res);\n }\n });\n\n cAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = { alias };\n }\n res[alias].current = asset;\n });\n\n return Object.values(res);\n }, [bAssets, cAssets, selectedBAsset, selectedCAsset]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.alias.indexOf(keyword) > -1);\n }\n\n if (selectedFileTypes.length) {\n const exts = selectedFileTypes\n .map((e) => fileTypes[e as keyof typeof fileTypes])\n .flat();\n\n const hasOthers = selectedFileTypes.indexOf('Others') > -1;\n\n list = list.filter((e) => {\n const asset = e.baseline! || e.current!;\n if (Graph.isAssetMatchExtensions(asset, exts)) {\n return true;\n }\n\n if (hasOthers) {\n return !Graph.isAssetMatchExtensions(asset, definedExtensions);\n }\n\n return false;\n });\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n if (e.baseline && !e.current) {\n // deleted\n return selectedUpdateTypes.includes(UpdateType.Deleted);\n }\n\n if (!e.baseline && e.current) {\n // new\n return selectedUpdateTypes.includes(UpdateType.New);\n }\n\n if (e.baseline && e.current) {\n if (e.baseline.size === e.current.size) {\n // not changed\n return selectedUpdateTypes.includes(UpdateType.NotChanged);\n }\n // changed\n return selectedUpdateTypes.includes(UpdateType.Changed);\n }\n\n return false;\n });\n }\n\n if (selectedSortType) {\n if (selectedSortType === SortType.Name) {\n list.sort((a, b) => {\n return a.alias.localeCompare(b.alias);\n });\n } else {\n const { prev, others } = list.reduce(\n (t, c) => {\n if (c.current) {\n if (c.baseline) {\n t.prev.unshift(c);\n } else {\n t.prev.push(c);\n }\n } else {\n t.others.push(c);\n }\n return t;\n },\n {\n prev: [] as BundleDiffTableAssetsData[],\n others: [] as BundleDiffTableAssetsData[],\n },\n );\n\n list = [\n ...prev.sort((a, b) => {\n if (b.current && a.current) {\n if (selectedSortType === SortType.Delta) {\n const { percent: percentA } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n a.alias,\n );\n const { percent: percentB } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n b.alias,\n );\n return percentB - percentA;\n }\n return b.current!.size - a.current!.size;\n }\n return -1;\n }),\n ...others,\n ];\n }\n }\n\n return list;\n }, [\n dataSource,\n keyword,\n selectedFileTypes,\n selectedUpdateTypes,\n selectedSortType,\n ]);\n\n const cSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.current ? e.current.size : 0)) || 0,\n [filteredDataSource],\n );\n const bSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.baseline ? e.baseline.size : 0)) || 0,\n [filteredDataSource],\n );\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by file name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file type\"\n style={{ width: 250 }}\n options={Object.keys(fileTypes).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedFileTypes(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n <Select\n suffixIcon={<SortAscendingOutlined />}\n // style={{ width: 150 }}\n options={Object.values(SortType).map((e) => ({\n label: e,\n value: e,\n }))}\n value={selectedSortType}\n onChange={(e) => {\n setSelectedSortType(e);\n }}\n />\n </Space>\n <Row style={{ marginTop: 10 }} gutter={[6, 6]}>\n <Col>\n <Button>Select Baseline Asset and Current Asset to Diff </Button>\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select baseline assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(baseline.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedBAsset(e)}\n />\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select current assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(current.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedCAsset(e)}\n />\n </Col>\n </Row>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.alias}\n expandable={{\n expandedRowRender: (r) => {\n return (\n <div style={{ margin: Size.BasePadding / 3 }}>\n <ModuleRowForAsset\n data={r}\n baseline={baseline}\n current={current}\n />\n </div>\n );\n },\n columnTitle: (\n <Tooltip\n title=\"Click to expand row to see the modules which the chunk contains\"\n placement=\"left\"\n >\n <AppstoreAddOutlined style={{ cursor: 'pointer' }} />\n </Tooltip>\n ),\n }}\n columns={[\n {\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered assets is {filteredDataSource.length}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total assets is {dataSource.length}\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Assets</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => <Name data={r} />,\n },\n {\n title: () => {\n const cs = formatSize(cSize);\n const diff = Graph.diffSize(bSize, cSize);\n return (\n <Tooltip\n title={`Current size is ${cs}, Delta is ${formatPercent(diff.percent)}`}\n >\n <Typography.Text strong>Current</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n <Typography.Text\n style={{ fontSize: 'inherit', marginRight: 8 }}\n >\n {cs}\n </Typography.Text>\n <SizePercent\n fontSize={'inherit'}\n baseline={bSize}\n current={cSize}\n />\n {formatDiffSize(\n bSize,\n cSize,\n bSize > cSize\n ? Client.RsdoctorClientDiffState.Down\n : Client.RsdoctorClientDiffState.Up,\n { fontSize: 10, fontWeight: 400, marginLeft: 4 },\n )}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.current) {\n const { percent, state } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n r.alias,\n );\n const isInitial = Graph.isInitialAsset(\n r.current,\n current.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.current.size)}\n </Typography.Text>\n <Percent percent={percent} state={state} />\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: () => {\n const bs = formatSize(bSize);\n return (\n <Tooltip title={`Baseline size is ${bs}`}>\n <Typography.Text strong>Baseline</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {bs}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.baseline) {\n const isInitial = Graph.isInitialAsset(\n r.baseline,\n baseline.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.baseline.size)}\n </Typography.Text>\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: 'Actions',\n key: 'actions',\n render: (_v, r) => {\n return (\n <ViewChanges\n file={r.alias}\n data={[\n {\n baseline: r.baseline?.content,\n current: r.current?.content,\n group: 'assets',\n },\n ]}\n />\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["fileTypes","Constants","definedExtensions","Object","Name","r","name","Space","Typography","Tooltip","InfoCircleOutlined","MinusSquareOutlined","Color","PlusSquareOutlined","CheckSquareOutlined","Assets","baseline","current","outputFilename","bOutPutFileName","keyword","setKeyword","useState","selectedFileTypes","setSelectedFileTypes","selectedUpdateTypes","setSelectedUpdateTypes","selectedSortType","setSelectedSortType","SortType","selectedBAsset","setSelectedBAsset","selectedCAsset","setSelectedCAsset","bAssets","cAssets","dataSource","useMemo","res","c","b","asset","alias","Graph","console","filteredDataSource","list","e","exts","hasOthers","UpdateType","a","prev","others","t","percentA","percentB","cSize","sumBy","bSize","Row","Size","Col","KeywordInput","FileSearchOutlined","Select","SortAscendingOutlined","Button","Table","ModuleRowForAsset","AppstoreAddOutlined","Divider","_v","cs","formatSize","diff","formatPercent","SizePercent","formatDiffSize","Client","percent","state","isInitial","Percent","Tag","bs","ViewChanges"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAMA,YAAY;IAChB,IAAI;QAACC,UAAU,WAAW;KAAC;IAC3B,KAAK;QAACA,UAAU,YAAY;KAAC;IAC7B,MAAM;QAACA,UAAU,aAAa;KAAC;IAC/B,MAAMA,UAAU,aAAa;IAC7B,OAAOA,UAAU,cAAc;IAC/B,OAAOA,UAAU,eAAe;IAChC,QAAQ,EAAE;AACZ;AAEA,MAAMC,oBAAoBC,OAAO,MAAM,CAACH,WAAW,IAAI;AAEvD,MAAMI,OAAsD,CAAC,EAAE,MAAMC,CAAC,EAAE;IACtE,MAAMC,OAAO,WAAPA,GACJ,KAACC,OAAKA;;0BACJ,IAACC,WAAW,IAAI;gBAAC,QAAM;0BAAEH,EAAE,KAAK;;0BAChC,IAACI,SAAOA;gBACN,qBACE,KAACF,OAAKA;oBAAC,OAAO;wBAAE,OAAO;oBAAU;oBAAG,WAAU;;wBAC3CF,EAAE,OAAO,GAAG,WAAH,GACR,KAACG,WAAW,IAAI;4BAAC,OAAO;gCAAE,OAAO;4BAAU;;gCAAG;gCACzBH,EAAE,OAAO,CAAC,IAAI;;6BAEjC;wBACHA,EAAE,QAAQ,GAAG,WAAH,GACT,KAACG,WAAW,IAAI;4BAAC,OAAO;gCAAE,OAAO;4BAAU;;gCAAG;gCACxBH,EAAE,QAAQ,CAAC,IAAI;;6BAEnC;;;0BAIR,kBAACK,oBAAkBA,CAAAA;;;;IAKzB,IAAIL,EAAE,QAAQ,IAAI,CAACA,EAAE,OAAO,EAE1B,OAAO,WAAP,GACE,KAACE,OAAKA;;0BACJ,IAACI,qBAAmBA;gBAAC,OAAO;oBA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gCACA,OAAO;4BACT;wBACF;wBACA;4BACE,OAAO;gCACL,MAAMyE,KAAKX,WAAWf;gCACtB,OAAO,WAAP,GACE,KAAClD,SAAOA;oCAAC,OAAO,CAAC,iBAAiB,EAAE4E,IAAI;;sDACtC,IAAC7E,WAAW,IAAI;4CAAC,QAAM;sDAAC;;sDACxB,IAAC+D,SAAOA;4CAAC,MAAK;;sDACd,IAAC/D,WAAW,IAAI;4CACd,OAAO;gDAAE,UAAU;gDAAI,YAAY;gDAAK,aAAa;4CAAE;sDAEtD6E;;sDAEH,IAAC3E,oBAAkBA,CAAAA;;;4BAGzB;4BACA,QAAQ,CAAC8D,IAAInE;gCACX,IAAIA,EAAE,QAAQ,EAAE;oCACd,MAAM6E,YAAYvC,MAAM,cAAc,CACpCtC,EAAE,QAAQ,EACVW,SAAS,UAAU,CAAC,MAAM;oCAE5B,OAAO,WAAP,GACE,KAACT,OAAKA;;0DACJ,IAACC,WAAW,IAAI;0DACbkE,WAAWrE,EAAE,QAAQ,CAAC,IAAI;;4CAE5B6E,YAAY,WAAZA,GAAY,IAACE,KAAGA;gDAAC,OAAOxE,MAAM,IAAI;0DAAE;iDAAgB;;;gCAG3D;gCACA,OAAO;4BACT;wBACF;wBACA;4BACE,OAAO;4BACP,KAAK;4BACL,QAAQ,CAAC4D,IAAInE,IACJ,WAAP,GACE,IAACiF,aAAWA;oCACV,MAAMjF,EAAE,KAAK;oCACb,MAAM;wCACJ;4CACE,UAAUA,EAAE,QAAQ,EAAE;4CACtB,SAASA,EAAE,OAAO,EAAE;4CACpB,OAAO;wCACT;qCACD;;wBAIT;qBACD;;;;;AAKX"}
1
+ {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/assets.mjs","sources":["../../../../../src/pages/Resources/BundleDiff/DiffContainer/assets.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Button,\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { sumBy } from 'es-toolkit/compat';\nimport {\n CheckSquareOutlined,\n InfoCircleOutlined,\n MinusSquareOutlined,\n PlusSquareOutlined,\n SortAscendingOutlined,\n FileSearchOutlined,\n AppstoreAddOutlined,\n} from '@ant-design/icons';\nimport { Constants, SDK, Client } from '@rsdoctor/types';\nimport { BundleDiffTableAssetsData } from './types';\nimport { formatPercent, formatSize } from '../../../../utils';\nimport { Color, Size } from '../../../../constants';\nimport { Percent, SizePercent } from '../../../../components/Card/diff';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ModuleRowForAsset } from './row';\nimport { ViewChanges } from './changes';\nimport { UpdateType, SortType } from './constants';\nimport { formatDiffSize } from './utils';\nimport { Graph } from '@rsdoctor/utils/common';\n\nconst fileTypes = {\n JS: Constants.JSExtensions,\n CSS: [Constants.CSSExtension],\n HTML: [Constants.HtmlExtension],\n Imgs: Constants.ImgExtensions,\n Fonts: Constants.FontExtensions,\n Media: Constants.MediaExtensions,\n Others: [],\n};\n\nconst definedExtensions = Object.values(fileTypes).flat();\n\nconst Name: React.FC<{ data: BundleDiffTableAssetsData }> = ({ data: r }) => {\n const name = (\n <Space>\n <Typography.Text strong>{r.alias}</Typography.Text>\n <Tooltip\n title={\n <Space style={{ color: 'inherit' }} direction=\"vertical\">\n {r.current ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Current realpath: {r.current.path}\n </Typography.Text>\n ) : null}\n {r.baseline ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Baseline realpath: {r.baseline.path}\n </Typography.Text>\n ) : null}\n </Space>\n }\n >\n <InfoCircleOutlined />\n </Tooltip>\n </Space>\n );\n\n if (r.baseline && !r.current) {\n // deleted\n return (\n <Space>\n <MinusSquareOutlined style={{ color: Color.Red }} />\n {name}\n </Space>\n );\n }\n\n if (!r.baseline && r.current) {\n // new\n return (\n <Space>\n <PlusSquareOutlined style={{ color: Color.Green }} />\n {name}\n </Space>\n );\n }\n\n if (r.baseline && r.current) {\n // update\n return (\n <Space>\n <CheckSquareOutlined style={{ color: Color.Yellow }} />\n {name}\n </Space>\n );\n }\n\n return name;\n};\n\nexport const Assets: React.FC<{\n outputFilename: string;\n baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n}> = ({ baseline, current, outputFilename }) => {\n const bOutPutFileName = outputFilename;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedFileTypes, setSelectedFileTypes] = useState<string[]>([]);\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n const [selectedSortType, setSelectedSortType] = useState<SortType>(\n SortType.Size,\n );\n const [selectedBAsset, setSelectedBAsset] = useState(null);\n const [selectedCAsset, setSelectedCAsset] = useState(null);\n\n const { assets: bAssets } = baseline.chunkGraph;\n const { assets: cAssets } = current.chunkGraph;\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableAssetsData> = {};\n if (selectedBAsset && selectedCAsset) {\n res.choose = {\n alias: `${selectedBAsset} \\n ${selectedCAsset}`,\n current: cAssets.find((c: SDK.AssetData) => c.path === selectedCAsset),\n baseline: bAssets.find((b: SDK.AssetData) => b.path === selectedBAsset),\n };\n return Object.values(res);\n }\n\n bAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = {\n alias,\n baseline: asset,\n };\n } else {\n console.warn('[Baseline Asset Exists]: ', asset, res);\n }\n });\n\n cAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = { alias };\n }\n res[alias].current = asset;\n });\n\n return Object.values(res);\n }, [bAssets, cAssets, selectedBAsset, selectedCAsset]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.alias.indexOf(keyword) > -1);\n }\n\n if (selectedFileTypes.length) {\n const exts = selectedFileTypes\n .map((e) => fileTypes[e as keyof typeof fileTypes])\n .flat();\n\n const hasOthers = selectedFileTypes.indexOf('Others') > -1;\n\n list = list.filter((e) => {\n const asset = e.baseline! || e.current!;\n if (Graph.isAssetMatchExtensions(asset, exts)) {\n return true;\n }\n\n if (hasOthers) {\n return !Graph.isAssetMatchExtensions(asset, definedExtensions);\n }\n\n return false;\n });\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n if (e.baseline && !e.current) {\n // deleted\n return selectedUpdateTypes.includes(UpdateType.Deleted);\n }\n\n if (!e.baseline && e.current) {\n // new\n return selectedUpdateTypes.includes(UpdateType.New);\n }\n\n if (e.baseline && e.current) {\n if (e.baseline.size === e.current.size) {\n // not changed\n return selectedUpdateTypes.includes(UpdateType.NotChanged);\n }\n // changed\n return selectedUpdateTypes.includes(UpdateType.Changed);\n }\n\n return false;\n });\n }\n\n if (selectedSortType) {\n if (selectedSortType === SortType.Name) {\n list.sort((a, b) => {\n return a.alias.localeCompare(b.alias);\n });\n } else {\n const { prev, others } = list.reduce(\n (t, c) => {\n if (c.current) {\n if (c.baseline) {\n t.prev.unshift(c);\n } else {\n t.prev.push(c);\n }\n } else {\n t.others.push(c);\n }\n return t;\n },\n {\n prev: [] as BundleDiffTableAssetsData[],\n others: [] as BundleDiffTableAssetsData[],\n },\n );\n\n list = [\n ...prev.sort((a, b) => {\n if (b.current && a.current) {\n if (selectedSortType === SortType.Delta) {\n const { percent: percentA } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n a.alias,\n );\n const { percent: percentB } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n b.alias,\n );\n return percentB - percentA;\n }\n return b.current!.size - a.current!.size;\n }\n return -1;\n }),\n ...others,\n ];\n }\n }\n\n return list;\n }, [\n dataSource,\n keyword,\n selectedFileTypes,\n selectedUpdateTypes,\n selectedSortType,\n ]);\n\n const cSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.current ? e.current.size : 0)) || 0,\n [filteredDataSource],\n );\n const bSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.baseline ? e.baseline.size : 0)) || 0,\n [filteredDataSource],\n );\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by file name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file type\"\n style={{ width: 250 }}\n options={Object.keys(fileTypes).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedFileTypes(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n <Select\n suffixIcon={<SortAscendingOutlined />}\n // style={{ width: 150 }}\n options={Object.values(SortType).map((e) => ({\n label: e,\n value: e,\n }))}\n value={selectedSortType}\n onChange={(e) => {\n setSelectedSortType(e);\n }}\n />\n </Space>\n <Row style={{ marginTop: 10 }} gutter={[6, 6]}>\n <Col>\n <Button>Select Baseline Asset and Current Asset to Diff </Button>\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select baseline assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(baseline.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedBAsset(e)}\n />\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select current assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(current.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedCAsset(e)}\n />\n </Col>\n </Row>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.alias}\n expandable={{\n expandedRowRender: (r) => {\n return (\n <div style={{ margin: Size.BasePadding / 3 }}>\n <ModuleRowForAsset\n data={r}\n baseline={baseline}\n current={current}\n />\n </div>\n );\n },\n columnTitle: (\n <Tooltip\n title=\"Click to expand row to see the modules which the chunk contains\"\n placement=\"left\"\n >\n <AppstoreAddOutlined style={{ cursor: 'pointer' }} />\n </Tooltip>\n ),\n }}\n columns={[\n {\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered assets is {filteredDataSource.length}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total assets is {dataSource.length}\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Assets</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => <Name data={r} />,\n },\n {\n title: () => {\n const cs = formatSize(cSize);\n const diff = Graph.diffSize(bSize, cSize);\n return (\n <Tooltip\n title={`Current size is ${cs}, Delta is ${formatPercent(diff.percent)}`}\n >\n <Typography.Text strong>Current</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n <Typography.Text\n style={{ fontSize: 'inherit', marginRight: 8 }}\n >\n {cs}\n </Typography.Text>\n <SizePercent\n fontSize={'inherit'}\n baseline={bSize}\n current={cSize}\n />\n {formatDiffSize(\n bSize,\n cSize,\n bSize > cSize\n ? Client.RsdoctorClientDiffState.Down\n : Client.RsdoctorClientDiffState.Up,\n { fontSize: 10, fontWeight: 400, marginLeft: 4 },\n )}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.current) {\n const { percent, state } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n r.alias,\n );\n const isInitial = Graph.isInitialAsset(\n r.current,\n current.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.current.size)}\n </Typography.Text>\n <Percent percent={percent} state={state} />\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: () => {\n const bs = formatSize(bSize);\n return (\n <Tooltip title={`Baseline size is ${bs}`}>\n <Typography.Text strong>Baseline</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {bs}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.baseline) {\n const isInitial = Graph.isInitialAsset(\n r.baseline,\n baseline.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.baseline.size)}\n </Typography.Text>\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: 'Actions',\n key: 'actions',\n render: (_v, r) => {\n return (\n <ViewChanges\n file={r.alias}\n data={[\n {\n baseline: r.baseline?.content,\n current: r.current?.content,\n group: 'assets',\n },\n ]}\n />\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["fileTypes","Constants","definedExtensions","Object","Name","r","name","Space","Typography","Tooltip","InfoCircleOutlined","MinusSquareOutlined","Color","PlusSquareOutlined","CheckSquareOutlined","Assets","baseline","current","outputFilename","bOutPutFileName","keyword","setKeyword","useState","selectedFileTypes","setSelectedFileTypes","selectedUpdateTypes","setSelectedUpdateTypes","selectedSortType","setSelectedSortType","SortType","selectedBAsset","setSelectedBAsset","selectedCAsset","setSelectedCAsset","bAssets","cAssets","dataSource","useMemo","res","c","b","asset","alias","Graph","console","filteredDataSource","list","e","exts","hasOthers","UpdateType","a","prev","others","t","percentA","percentB","cSize","sumBy","bSize","Row","Size","Col","KeywordInput","FileSearchOutlined","Select","SortAscendingOutlined","Button","Table","ModuleRowForAsset","AppstoreAddOutlined","Divider","_v","cs","formatSize","diff","formatPercent","SizePercent","formatDiffSize","Client","percent","state","isInitial","Percent","Tag","bs","ViewChanges"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAMA,YAAY;IAChB,IAAIC,UAAU,YAAY;IAC1B,KAAK;QAACA,UAAU,YAAY;KAAC;IAC7B,MAAM;QAACA,UAAU,aAAa;KAAC;IAC/B,MAAMA,UAAU,aAAa;IAC7B,OAAOA,UAAU,cAAc;IAC/B,OAAOA,UAAU,eAAe;IAChC,QAAQ,EAAE;AACZ;AAEA,MAAMC,oBAAoBC,OAAO,MAAM,CAACH,WAAW,IAAI;AAEvD,MAAMI,OAAsD,CAAC,EAAE,MAAMC,CAAC,EAAE;IACtE,MAAMC,OAAO,WAAPA,GACJ,KAACC,OAAKA;;0BACJ,IAACC,WAAW,IAAI;gBAAC,QAAM;0BAAEH,EAAE,KAAK;;0BAChC,IAACI,SAAOA;gBACN,qBACE,KAACF,OAAKA;oBAAC,OAAO;wBAAE,OAAO;oBAAU;oBAAG,WAAU;;wBAC3CF,EAAE,OAAO,GAAG,WAAH,GACR,KAACG,WAAW,IAAI;4BAAC,OAAO;gCAAE,OAAO;4BAAU;;gCAAG;gCACzBH,EAAE,OAAO,CAAC,IAAI;;6BAEjC;wBACHA,EAAE,QAAQ,GAAG,WAAH,GACT,KAACG,WAAW,IAAI;4BAAC,OAAO;gCAAE,OAAO;4BAAU;;gCAAG;gCACxBH,EAAE,QAAQ,CAAC,IAAI;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
  "name": "@rsdoctor/components",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "license": "MIT",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {
@@ -74,9 +74,9 @@
74
74
  "react-markdown": "^9.1.0",
75
75
  "socket.io-client": "4.8.1",
76
76
  "url-parse": "1.5.10",
77
- "@rsdoctor/graph": "1.5.1",
78
- "@rsdoctor/types": "1.5.1",
79
- "@rsdoctor/utils": "1.5.1"
77
+ "@rsdoctor/graph": "1.5.2",
78
+ "@rsdoctor/utils": "1.5.2",
79
+ "@rsdoctor/types": "1.5.2"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "react": ">=18.3.1",