@rsdoctor/components 1.0.0-rc.0 → 1.0.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.
|
@@ -10,7 +10,7 @@ export declare const ModuleGraphViewer: React.FC<{
|
|
|
10
10
|
setShow: (_show: boolean) => void;
|
|
11
11
|
cwd: string;
|
|
12
12
|
}>;
|
|
13
|
-
export declare function getChildrenModule(node: DataNode): string[];
|
|
13
|
+
export declare function getChildrenModule(node: DataNode, mods: string[]): string[];
|
|
14
14
|
export declare const ModulesStatistics: React.FC<{
|
|
15
15
|
modules: SDK.ModuleData[];
|
|
16
16
|
chunks: SDK.ChunkData[];
|
|
@@ -181,13 +181,12 @@ const ModuleGraphViewer = ({ id, show, setShow, cwd }) => {
|
|
|
181
181
|
) });
|
|
182
182
|
};
|
|
183
183
|
const inlinedResourcePathKey = "__RESOURCEPATH__";
|
|
184
|
-
function getChildrenModule(node) {
|
|
185
|
-
const mods = [];
|
|
184
|
+
function getChildrenModule(node, mods) {
|
|
186
185
|
node.children && node.children.forEach((n) => {
|
|
187
186
|
if (n.isLeaf) {
|
|
188
187
|
mods.push(n[inlinedResourcePathKey]);
|
|
189
188
|
} else {
|
|
190
|
-
getChildrenModule(n);
|
|
189
|
+
getChildrenModule(n, mods);
|
|
191
190
|
}
|
|
192
191
|
});
|
|
193
192
|
return mods;
|
|
@@ -418,9 +417,24 @@ const AssetDetail = ({
|
|
|
418
417
|
] });
|
|
419
418
|
},
|
|
420
419
|
dirTitle(dir, defaultTitle) {
|
|
421
|
-
const
|
|
420
|
+
const mods = [];
|
|
421
|
+
const paths = getChildrenModule(dir, mods);
|
|
422
422
|
if (paths.length) {
|
|
423
|
-
|
|
423
|
+
const mods2 = paths.map(
|
|
424
|
+
(e) => includeModules.find((m) => m.path === e)
|
|
425
|
+
);
|
|
426
|
+
const parsedSize = sumBy(mods2, (e) => e.size?.parsedSize || 0);
|
|
427
|
+
const sourceSize = sumBy(mods2, (e) => e.size?.sourceSize || 0);
|
|
428
|
+
return /* @__PURE__ */ jsxs("div", { className: styles["bundle-tree"], children: [
|
|
429
|
+
/* @__PURE__ */ jsxs("div", { className: styles.box, children: [
|
|
430
|
+
/* @__PURE__ */ jsx("div", { className: styles.keywords, children: /* @__PURE__ */ jsx(Keyword, { ellipsis: true, text: defaultTitle, keyword: "" }) }),
|
|
431
|
+
/* @__PURE__ */ jsx("div", { className: styles.dividerDiv, children: /* @__PURE__ */ jsx(Divider, { className: styles.divider, dashed: true }) })
|
|
432
|
+
] }),
|
|
433
|
+
/* @__PURE__ */ jsx(Space, { children: parsedSize > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
434
|
+
/* @__PURE__ */ jsx(Tag, { style: tagStyle, color: "orange", children: "Bundled:" + formatSize(parsedSize) }),
|
|
435
|
+
/* @__PURE__ */ jsx(Tag, { style: tagStyle, color: "lime", children: "Source:" + formatSize(sourceSize) })
|
|
436
|
+
] }) : /* @__PURE__ */ jsx(Tag, { style: tagStyle, color: "lime", children: "Source:" + formatSize(sourceSize) }) })
|
|
437
|
+
] });
|
|
424
438
|
}
|
|
425
439
|
return defaultTitle;
|
|
426
440
|
},
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
.bundle_0b14c .ant-tree-iconEle {
|
|
77
77
|
margin-right: 2px;
|
|
78
78
|
}
|
|
79
|
+
.bundle_0b14c .ant-tree-node-content-wrapper-open,
|
|
80
|
+
.bundle_0b14c .ant-tree-node-content-wrapper-close {
|
|
81
|
+
display: flex;
|
|
82
|
+
}
|
|
79
83
|
|
|
80
84
|
.bundle-size-card_0b14c .ant-tabs-tab_0b14c {
|
|
81
85
|
margin-right: 20px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/components",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@ant-design/icons": "5.6.1",
|
|
44
|
-
"@rsbuild/plugin-check-syntax": "1.
|
|
44
|
+
"@rsbuild/plugin-check-syntax": "1.3.0",
|
|
45
45
|
"@monaco-editor/react": "4.7.0",
|
|
46
46
|
"@types/lodash-es": "4.17.12",
|
|
47
47
|
"@types/node": "^16",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/url-parse": "1.4.11",
|
|
52
52
|
"ansi-to-react": "6.1.6",
|
|
53
53
|
"antd": "5.19.1",
|
|
54
|
-
"axios": "^1.
|
|
54
|
+
"axios": "^1.8.3",
|
|
55
55
|
"dayjs": "1.11.13",
|
|
56
56
|
"echarts": "^5.6.0",
|
|
57
57
|
"echarts-for-react": "^3.0.3",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"socket.io-client": "4.6.1",
|
|
72
72
|
"typescript": "^5.2.2",
|
|
73
73
|
"url-parse": "1.5.10",
|
|
74
|
-
"@rsdoctor/graph": "1.0.0
|
|
75
|
-
"@rsdoctor/utils": "1.0.0
|
|
76
|
-
"@rsdoctor/types": "1.0.0
|
|
74
|
+
"@rsdoctor/graph": "1.0.0",
|
|
75
|
+
"@rsdoctor/utils": "1.0.0",
|
|
76
|
+
"@rsdoctor/types": "1.0.0"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public",
|