@rsdoctor/components 0.4.13 → 1.0.0-alpha.1
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/README.md +1 -1
- package/dist/common/imgs/connection-point.js +11 -0
- package/dist/common/imgs/webpack.js +11 -0
- package/dist/common/svg/bundle-size.js +11 -0
- package/dist/common/svg/error.js +10 -0
- package/dist/common/svg/file-css.js +11 -0
- package/dist/common/svg/file-html.js +11 -0
- package/dist/common/svg/file-image.js +11 -0
- package/dist/common/svg/file-js.js +11 -0
- package/dist/common/svg/file-unknown.js +11 -0
- package/dist/common/svg/file.js +10 -0
- package/dist/common/svg/files/css.js +11 -0
- package/dist/common/svg/files/html.js +11 -0
- package/dist/common/svg/files/image.js +11 -0
- package/dist/common/svg/files/js.js +11 -0
- package/dist/common/svg/files/unkown-file.js +11 -0
- package/dist/common/svg/loader/input.js +11 -0
- package/dist/common/svg/loader/output.js +12 -0
- package/dist/common/svg/loader/step.js +7 -0
- package/dist/common/svg/navbar/bundle-size-active.js +10 -0
- package/dist/common/svg/navbar/bundle-size-inactive.js +10 -0
- package/dist/common/svg/navbar/compile-analysis-active.js +11 -0
- package/dist/common/svg/navbar/compile-analysis-inactive.js +11 -0
- package/dist/common/svg/navbar/overall-active.js +11 -0
- package/dist/common/svg/navbar/overall-inactive.js +11 -0
- package/dist/common/svg/output.js +12 -0
- package/dist/common/svg/source-size.js +12 -0
- package/dist/common/svg/source.js +10 -0
- package/dist/common/svg/total-size.js +11 -0
- package/dist/common/svg/version.js +11 -0
- package/dist/components/Alert/ecma-version-check.d.ts +2 -0
- package/dist/components/Alert/ecma-version-check.js +69 -0
- package/dist/components/Alert/ecma-version-check.module.js +5 -0
- package/dist/components/Alert/ecma-version-check_module.css +23 -0
- package/dist/components/Alert/package-relation.d.ts +1 -2
- package/dist/components/Alert/package-relation.js +29 -59
- package/dist/components/Alert/package-relation.module.js +5 -0
- package/dist/components/Alert/package-relation_module.css +23 -0
- package/dist/components/Alert/types.d.ts +6 -1
- package/dist/components/Alerts/{common.d.ts → bundle-alert.d.ts} +3 -4
- package/dist/components/Alerts/bundle-alert.js +156 -0
- package/dist/components/Alerts/bundle-alert.module.js +5 -0
- package/dist/components/Alerts/bundle-alert_module.css +46 -0
- package/dist/components/Alerts/bundle.js +25 -6
- package/dist/components/Alerts/collapse.d.ts +6 -0
- package/dist/components/Alerts/collapse.js +209 -0
- package/dist/components/Alerts/collapse.module.js +5 -0
- package/dist/components/Alerts/collapse_module.css +71 -0
- package/dist/components/Alerts/compile.js +18 -5
- package/dist/components/Alerts/list.d.ts +4 -0
- package/dist/components/Alerts/list.js +25 -0
- package/dist/components/Alerts/list.module.js +5 -0
- package/dist/components/Alerts/list_module.css +5 -0
- package/dist/components/Alerts/overlay.js +67 -28
- package/dist/components/Alerts/overlay.module.js +5 -0
- package/dist/components/Alerts/overlay_module.css +11 -0
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.js +8 -18
- package/dist/components/Card/size.d.ts +1 -0
- package/dist/components/Card/size.js +99 -65
- package/dist/components/Card/size.module.js +5 -0
- package/dist/components/Card/size_module.css +34 -0
- package/dist/components/Card/statistic.d.ts +0 -2
- package/dist/components/Card/statistic.js +7 -5
- package/dist/components/Charts/TimelineCharts/index.d.ts +6 -1
- package/dist/components/Charts/TimelineCharts/index.js +208 -192
- package/dist/components/Charts/bootstrap.js +15 -10
- package/dist/components/Charts/common.d.ts +2 -0
- package/dist/components/Charts/common.js +18 -5
- package/dist/components/Charts/constants.d.ts +8 -1
- package/dist/components/Charts/constants.js +37 -41
- package/dist/components/Charts/done.js +14 -9
- package/dist/components/Charts/index.js +1 -1
- package/dist/components/Charts/loader.js +12 -2
- package/dist/components/Charts/minify.js +14 -9
- package/dist/components/Charts/utils.js +2 -2
- package/dist/components/CodeViewer/diff.js +8 -2
- package/dist/components/CodeViewer/viewer.js +0 -7
- package/dist/components/Configuration/builder.js +50 -36
- package/dist/components/Configuration/builder.module.js +5 -0
- package/dist/components/Configuration/builder_module.css +6 -0
- package/dist/components/FileTree/css.js +11 -0
- package/dist/components/FileTree/html.js +11 -0
- package/dist/components/FileTree/image.js +11 -0
- package/dist/components/FileTree/index.css +8 -0
- package/dist/components/FileTree/index.d.ts +1 -0
- package/dist/components/FileTree/index.js +65 -5
- package/dist/components/FileTree/js.js +11 -0
- package/dist/components/FileTree/unkown-file.js +11 -0
- package/dist/components/Form/keyword.js +3 -2
- package/dist/components/Keyword/index.js +38 -14
- package/dist/components/Keyword/style.module.js +5 -0
- package/dist/components/Keyword/style_module.css +5 -0
- package/dist/components/Layout/builder-select.js +37 -24
- package/dist/components/Layout/bundle-size-icon.js +10 -0
- package/dist/components/Layout/compile-icon.js +11 -0
- package/dist/components/Layout/header.css +7 -0
- package/dist/components/Layout/header.js +10 -17
- package/dist/components/Layout/menus.js +59 -64
- package/dist/components/Layout/overall-icon.js +10 -0
- package/dist/components/Layout/progress.js +2 -1
- package/dist/components/Loader/Analysis/files.js +187 -101
- package/dist/components/Loader/Analysis/index.js +34 -17
- package/dist/components/Loader/Analysis/input.js +11 -0
- package/dist/components/Loader/Analysis/output.js +12 -0
- package/dist/components/Loader/Analysis/style.module.js +5 -0
- package/dist/components/Loader/Analysis/style_module.css +73 -0
- package/dist/components/Loader/executions.js +95 -114
- package/dist/components/Loader/step.js +7 -0
- package/dist/components/Opener/code.js +2 -1
- package/dist/components/Overall/DataSummary.d.ts +8 -0
- package/dist/components/Overall/DataSummary.js +25 -0
- package/dist/components/Overall/DataSummary.module.js +5 -0
- package/dist/components/Overall/DataSummary_module.css +95 -0
- package/dist/components/Overall/bundle.d.ts +6 -1
- package/dist/components/Overall/bundle.js +208 -112
- package/dist/components/Overall/bundle.module.js +5 -0
- package/dist/components/Overall/bundle_module.css +67 -0
- package/dist/components/Overall/card_module.css +1 -4
- package/dist/components/Overall/compile.js +47 -41
- package/dist/components/Overall/compile.module.js +1 -1
- package/dist/components/Overall/compile_module.css +6 -0
- package/dist/components/Overall/help-center.d.ts +1 -0
- package/dist/components/Overall/help-center.js +86 -0
- package/dist/components/Overall/help-center.module.js +5 -0
- package/dist/components/Overall/help-center_module.css +35 -0
- package/dist/components/Overall/list.module.js +1 -1
- package/dist/components/Overall/list_module.css +14 -4
- package/dist/components/Overall/overview.d.ts +8 -0
- package/dist/components/Overall/overview.js +17 -0
- package/dist/components/Overall/overview.module.js +5 -0
- package/dist/components/Overall/overview_module.css +25 -0
- package/dist/components/Overall/project.d.ts +0 -1
- package/dist/components/Overall/project.js +101 -36
- package/dist/components/Overall/project.module.js +5 -0
- package/dist/components/Overall/project_module.css +19 -0
- package/dist/components/Select/index.css +6 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +7 -4
- package/dist/components/TextDrawer/index.d.ts +2 -1
- package/dist/components/TextDrawer/index.js +38 -27
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/pages/BundleSize/components/asset.js +106 -124
- package/dist/pages/BundleSize/components/card.module.js +5 -0
- package/dist/pages/BundleSize/components/card_module.css +54 -0
- package/dist/pages/BundleSize/components/cards.js +157 -47
- package/dist/pages/BundleSize/components/index.js +129 -121
- package/dist/pages/BundleSize/components/index.module.js +5 -0
- package/dist/pages/BundleSize/components/index_module.css +82 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +13 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +1 -1
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +40 -63
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +1 -0
- package/dist/pages/ModuleAnalyze/fileTree.js +36 -164
- package/dist/pages/ModuleAnalyze/index.css +7 -3
- package/dist/pages/ModuleAnalyze/index.d.ts +7 -1
- package/dist/pages/ModuleAnalyze/index.js +122 -45
- package/dist/pages/Overall/index.js +14 -9
- package/dist/pages/Overall/index.module.js +5 -0
- package/dist/pages/Overall/index_module.css +26 -0
- package/dist/pages/Overall/responsiveLayout.d.ts +6 -0
- package/dist/pages/Overall/responsiveLayout.js +9 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/modules.js +4 -4
- package/dist/pages/TreeShaking/editor.d.ts +3 -4
- package/dist/pages/TreeShaking/table.d.ts +3 -3
- package/dist/pages/TreeShaking/types.d.ts +2 -2
- package/dist/pages/TreeShaking/utils.d.ts +4 -5
- package/dist/pages/WebpackLoaders/Analysis/index.js +4 -1
- package/dist/pages/WebpackLoaders/Overall/index.js +8 -1
- package/dist/pages/WebpackPlugins/index.css +3 -0
- package/dist/pages/WebpackPlugins/index.d.ts +1 -0
- package/dist/pages/WebpackPlugins/index.js +61 -51
- package/dist/utils/data/brief.js +0 -2
- package/dist/utils/file.d.ts +4 -2
- package/dist/utils/file.js +40 -5
- package/dist/utils/i18n/cn.js +5 -0
- package/dist/utils/i18n/en.d.ts +5 -0
- package/dist/utils/i18n/en.js +5 -0
- package/package.json +8 -7
- package/dist/assets/connection-point.3b3c78ca.svg +0 -1
- package/dist/assets/webpack.98604d64.svg +0 -1
- package/dist/components/Alert/index.d.ts +0 -4
- package/dist/components/Alert/index.js +0 -34
- package/dist/components/Alert/link.d.ts +0 -3
- package/dist/components/Alert/link.js +0 -27
- package/dist/components/Alerts/common.js +0 -123
- package/dist/components/Card/statistic.css +0 -17
- package/dist/components/Overall/NumberButton.d.ts +0 -8
- package/dist/components/Overall/NumberButton.js +0 -29
- package/dist/components/Overall/NumberButton.module.js +0 -5
- package/dist/components/Overall/NumberButton_module.css +0 -70
- package/dist/components/Overall/bundle.module.css +0 -0
- package/dist/pages/Overall/responsiveGridList.d.ts +0 -6
- package/dist/pages/Overall/responsiveGridList.js +0 -28
|
@@ -1,187 +1,59 @@
|
|
|
1
|
-
import { Fragment, jsx
|
|
2
|
-
import {
|
|
3
|
-
ExpandOutlined,
|
|
4
|
-
InfoCircleOutlined,
|
|
5
|
-
MenuFoldOutlined,
|
|
6
|
-
MenuUnfoldOutlined,
|
|
7
|
-
RightSquareTwoTone
|
|
8
|
-
} from "@ant-design/icons";
|
|
9
|
-
import { SDK } from "@rsdoctor/types";
|
|
10
|
-
import {
|
|
11
|
-
Badge,
|
|
12
|
-
Button,
|
|
13
|
-
Col,
|
|
14
|
-
Empty,
|
|
15
|
-
Popover,
|
|
16
|
-
Radio,
|
|
17
|
-
Row,
|
|
18
|
-
Tag,
|
|
19
|
-
Typography
|
|
20
|
-
} from "antd";
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Col, Empty } from "antd";
|
|
21
3
|
import { useEffect, useState } from "react";
|
|
22
|
-
import {
|
|
23
|
-
import { Title } from "../../components/Title";
|
|
24
|
-
import { Size, TAG_PALLETE } from "../../constants";
|
|
25
|
-
import { useI18n } from "../../utils/hooks";
|
|
26
|
-
import { ChunksTable } from "./chunks";
|
|
4
|
+
import { Size } from "../../constants";
|
|
27
5
|
import { FileTree } from "./components/fileTreeCom";
|
|
28
6
|
import { clsNamePrefix } from "./constants";
|
|
29
7
|
import DependencyTree from "./dependency";
|
|
30
|
-
import { getImporteds
|
|
8
|
+
import { getImporteds } from "./utils";
|
|
31
9
|
import { useCreateFileTreeData } from "./utils/hooks";
|
|
32
|
-
|
|
33
|
-
ChartDimension2[ChartDimension2["Dependencies"] = 0] = "Dependencies";
|
|
34
|
-
ChartDimension2[ChartDimension2["Chunks"] = 1] = "Chunks";
|
|
35
|
-
return ChartDimension2;
|
|
36
|
-
})(ChartDimension || {});
|
|
10
|
+
import { TabList } from "./index";
|
|
37
11
|
const ModuleFilesTree = (props) => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
12
|
+
const {
|
|
13
|
+
curModule,
|
|
14
|
+
modules,
|
|
15
|
+
dependencies,
|
|
16
|
+
cwd,
|
|
17
|
+
activeTabKey,
|
|
18
|
+
selectedChunk = ""
|
|
19
|
+
} = props;
|
|
40
20
|
const [importedModules, setImportedModules] = useState(
|
|
41
21
|
[]
|
|
42
22
|
);
|
|
43
|
-
const [dimension, setDimension] = useState(
|
|
44
|
-
0 /* Dependencies */
|
|
45
|
-
);
|
|
46
|
-
const [fold, setFold] = useState(true);
|
|
47
23
|
const { data: fileStructures } = useCreateFileTreeData(
|
|
48
24
|
modules,
|
|
49
25
|
importedModules,
|
|
50
26
|
curModule
|
|
51
27
|
);
|
|
52
|
-
const [reasonsTree, setReasonsTree] = useState(
|
|
53
|
-
{}
|
|
54
|
-
);
|
|
55
28
|
useEffect(() => {
|
|
56
29
|
const importeds = getImporteds(curModule, modules);
|
|
57
30
|
setImportedModules(importeds);
|
|
58
31
|
}, [curModule, modules]);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */ jsxs(Typography.Text, { code: true, children: [
|
|
77
|
-
/* @__PURE__ */ jsx(ExpandOutlined, {}),
|
|
78
|
-
" Expand the node_modules's modules that was omitted... "
|
|
79
|
-
] }),
|
|
80
|
-
" ",
|
|
81
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: `: ${t("Expand Omitted")}` })
|
|
82
|
-
] }),
|
|
83
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
84
|
-
/* @__PURE__ */ jsx(Badge, { status: "success", text: " " }),
|
|
85
|
-
/* @__PURE__ */ jsx(
|
|
86
|
-
Popover,
|
|
87
|
-
{
|
|
88
|
-
content: "*",
|
|
89
|
-
title: "Concatenated Module Name",
|
|
90
|
-
trigger: "hover",
|
|
91
|
-
children: /* @__PURE__ */ jsx(Tag, { color: TAG_PALLETE.DARK_BLUE, children: "Concatenated" })
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: `: ${t("Concatenated Tag")}` })
|
|
95
|
-
] }),
|
|
96
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
97
|
-
/* @__PURE__ */ jsx(Badge, { status: "success", text: " " }),
|
|
98
|
-
/* @__PURE__ */ jsx(RightSquareTwoTone, {}),
|
|
99
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: ": Jump button, click to jump to the Module dependency analysis page of this module." })
|
|
100
|
-
] })
|
|
101
|
-
] }),
|
|
102
|
-
title: "Usage",
|
|
103
|
-
children: /* @__PURE__ */ jsx(Button, { type: "primary", icon: /* @__PURE__ */ jsx(InfoCircleOutlined, {}), children: "Usage" })
|
|
104
|
-
}
|
|
105
|
-
) }),
|
|
106
|
-
/* @__PURE__ */ jsxs(Row, { gutter: 4, style: { marginTop: Size.BasePadding }, children: [
|
|
107
|
-
/* @__PURE__ */ jsx(Col, { span: fold ? 18 : 12, children: /* @__PURE__ */ jsx(Row, { className: `${clsNamePrefix}-file-tree`, justify: "center", children: /* @__PURE__ */ jsxs(Col, { span: 24, style: { padding: Size.BasePadding / 2 }, children: [
|
|
108
|
-
/* @__PURE__ */ jsx(Title, { text: "Current Module Imported Reasons Tree:" }),
|
|
109
|
-
importedModules ? /* @__PURE__ */ jsx(
|
|
110
|
-
FileTree,
|
|
111
|
-
{
|
|
112
|
-
cwd,
|
|
113
|
-
treeData: selectedChunk ? fileStructures.filter(
|
|
114
|
-
(_parent) => reasonsTree[_parent.id].indexOf(selectedChunk) >= 0
|
|
115
|
-
) : fileStructures,
|
|
116
|
-
needCode: true,
|
|
117
|
-
needShowAllTree: true,
|
|
118
|
-
needJumpto: true,
|
|
119
|
-
selectedChunk
|
|
120
|
-
}
|
|
121
|
-
) : /* @__PURE__ */ jsx(Empty, { className: `${clsNamePrefix}-empty` })
|
|
122
|
-
] }) }) }),
|
|
123
|
-
/* @__PURE__ */ jsx(Col, { span: fold ? 6 : 12, children: /* @__PURE__ */ jsxs(
|
|
124
|
-
"div",
|
|
32
|
+
return /* @__PURE__ */ jsx(Fragment, { children: activeTabKey === TabList[TabList.Reasons] ? /* @__PURE__ */ jsx(Fragment, { children: importedModules ? /* @__PURE__ */ jsx(
|
|
33
|
+
FileTree,
|
|
34
|
+
{
|
|
35
|
+
cwd,
|
|
36
|
+
treeData: fileStructures,
|
|
37
|
+
needCode: true,
|
|
38
|
+
needShowAllTree: true,
|
|
39
|
+
needJumpto: true,
|
|
40
|
+
selectedChunk
|
|
41
|
+
}
|
|
42
|
+
) : /* @__PURE__ */ jsx(Empty, { className: `${clsNamePrefix}-empty` }) }) : /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: `${clsNamePrefix}-file-tree`,
|
|
46
|
+
style: { padding: Size.BasePadding / 2 },
|
|
47
|
+
children: /* @__PURE__ */ jsx(Col, { span: 24, style: { marginTop: Size.BasePadding / 2 }, children: curModule ? /* @__PURE__ */ jsx(
|
|
48
|
+
DependencyTree,
|
|
125
49
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
fold ? /* @__PURE__ */ jsx(Popover, { content: "Unfold [Dependencies & Chunks] Box.", children: /* @__PURE__ */ jsx(
|
|
130
|
-
MenuFoldOutlined,
|
|
131
|
-
{
|
|
132
|
-
onClick: () => setFold(!fold),
|
|
133
|
-
style: { marginRight: 8 }
|
|
134
|
-
}
|
|
135
|
-
) }) : /* @__PURE__ */ jsx(Popover, { content: "Fold [Dependencies & Chunks] Box.", children: /* @__PURE__ */ jsx(
|
|
136
|
-
MenuUnfoldOutlined,
|
|
137
|
-
{
|
|
138
|
-
onClick: () => setFold(!fold),
|
|
139
|
-
style: { marginRight: 8 }
|
|
140
|
-
}
|
|
141
|
-
) }),
|
|
142
|
-
/* @__PURE__ */ jsx(
|
|
143
|
-
Radio.Group,
|
|
144
|
-
{
|
|
145
|
-
options: [
|
|
146
|
-
{
|
|
147
|
-
label: "Dependencies",
|
|
148
|
-
value: 0 /* Dependencies */
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
label: "Chunks",
|
|
152
|
-
value: 1 /* Chunks */
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
onChange: (e) => setDimension(e.target.value),
|
|
156
|
-
value: dimension,
|
|
157
|
-
optionType: "button",
|
|
158
|
-
buttonStyle: "solid",
|
|
159
|
-
size: "middle"
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
!fold ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
163
|
-
dimension === 0 /* Dependencies */ && /* @__PURE__ */ jsx(Col, { span: 24, style: { marginTop: Size.BasePadding / 2 }, children: curModule ? /* @__PURE__ */ jsx(
|
|
164
|
-
DependencyTree,
|
|
165
|
-
{
|
|
166
|
-
module: curModule,
|
|
167
|
-
dependencies,
|
|
168
|
-
cwd
|
|
169
|
-
}
|
|
170
|
-
) : /* @__PURE__ */ jsx(Empty, { className: `${clsNamePrefix}-empty` }) }),
|
|
171
|
-
dimension === 1 /* Chunks */ && /* @__PURE__ */ jsx(Col, { span: 18, style: { marginTop: Size.BasePadding / 2 }, children: curModule ? /* @__PURE__ */ jsx(
|
|
172
|
-
ServerAPIProvider,
|
|
173
|
-
{
|
|
174
|
-
api: SDK.ServerAPI.API.GetChunksByModuleId,
|
|
175
|
-
body: { moduleId: curModule.id },
|
|
176
|
-
children: (res) => /* @__PURE__ */ jsx(ChunksTable, { chunks: res })
|
|
177
|
-
}
|
|
178
|
-
) : /* @__PURE__ */ jsx(Empty, { className: `${clsNamePrefix}-empty` }) })
|
|
179
|
-
] }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
180
|
-
]
|
|
50
|
+
module: curModule,
|
|
51
|
+
dependencies,
|
|
52
|
+
cwd
|
|
181
53
|
}
|
|
182
|
-
) })
|
|
183
|
-
|
|
184
|
-
|
|
54
|
+
) : /* @__PURE__ */ jsx(Empty, { className: `${clsNamePrefix}-empty` }) })
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
185
57
|
};
|
|
186
58
|
export {
|
|
187
59
|
ModuleFilesTree
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
.module-analyze-file-tree {
|
|
2
2
|
width: "100%";
|
|
3
|
-
border: 1px solid #eee;
|
|
4
3
|
min-height: 50em;
|
|
5
|
-
margin: 4;
|
|
6
|
-
padding: 4;
|
|
7
4
|
}
|
|
8
5
|
.module-analyze-file-tree .module-analyze-empty {
|
|
9
6
|
margin-top: 20%;
|
|
10
7
|
}
|
|
8
|
+
.module-analyze-box {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
}
|
|
12
|
+
.file-tree-com-titles-box {
|
|
13
|
+
line-height: 30px;
|
|
14
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { SDK } from '@rsdoctor/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import './index.
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export declare enum TabList {
|
|
5
|
+
Reasons = 0,
|
|
6
|
+
Dependencies = 1
|
|
7
|
+
}
|
|
4
8
|
export declare const ModuleAnalyzeComponent: React.FC<{
|
|
5
9
|
modules: SDK.ModuleData[];
|
|
6
10
|
cwd: string;
|
|
7
11
|
moduleId: string | number;
|
|
12
|
+
show: boolean;
|
|
13
|
+
setShow: (arg: boolean) => void;
|
|
8
14
|
}>;
|
|
@@ -1,64 +1,141 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LeftSquareOutlined } from "@ant-design/icons";
|
|
3
2
|
import { SDK } from "@rsdoctor/types";
|
|
4
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Badge,
|
|
5
|
+
Card,
|
|
6
|
+
Col,
|
|
7
|
+
Drawer,
|
|
8
|
+
Popover,
|
|
9
|
+
Row,
|
|
10
|
+
Space,
|
|
11
|
+
Typography
|
|
12
|
+
} from "antd";
|
|
5
13
|
import { useState } from "react";
|
|
6
14
|
import { ServerAPIProvider } from "../../components/Manifest";
|
|
7
15
|
import { getShortPath } from "../../utils";
|
|
8
|
-
import { values } from "lodash-es";
|
|
9
16
|
import { ModuleGraphListContext } from "../BundleSize/config";
|
|
10
17
|
import { ModuleFilesTree } from "./fileTree";
|
|
11
18
|
import "./index.css";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
import { drawerWidth } from "../../constants";
|
|
20
|
+
import {
|
|
21
|
+
LeftSquareOutlined,
|
|
22
|
+
QuestionCircleOutlined,
|
|
23
|
+
RightSquareTwoTone
|
|
24
|
+
} from "@ant-design/icons";
|
|
25
|
+
var TabList = /* @__PURE__ */ ((TabList2) => {
|
|
26
|
+
TabList2[TabList2["Reasons"] = 0] = "Reasons";
|
|
27
|
+
TabList2[TabList2["Dependencies"] = 1] = "Dependencies";
|
|
28
|
+
return TabList2;
|
|
29
|
+
})(TabList || {});
|
|
30
|
+
const tabslist = [
|
|
31
|
+
{
|
|
32
|
+
key: TabList[0 /* Reasons */],
|
|
33
|
+
label: TabList[0 /* Reasons */]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: TabList[1 /* Dependencies */],
|
|
37
|
+
label: TabList[1 /* Dependencies */]
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
const ModuleAnalyzeComponent = ({ modules, cwd, moduleId, show, setShow }) => {
|
|
41
|
+
const [selectedChunk, _setSelectedChunk] = useState("");
|
|
42
|
+
const [activeTabKey, setActiveTabKey] = useState(TabList[0 /* Reasons */]);
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
ServerAPIProvider,
|
|
45
|
+
{
|
|
46
|
+
api: SDK.ServerAPI.API.GetModuleDetails,
|
|
47
|
+
body: { moduleId: +moduleId },
|
|
48
|
+
children: ({ module, dependencies }) => {
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
Drawer,
|
|
19
51
|
{
|
|
20
|
-
title: /* @__PURE__ */ jsxs(
|
|
52
|
+
title: /* @__PURE__ */ jsxs("div", { className: "module-analyze-box", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: getShortPath(module.path) }),
|
|
21
54
|
/* @__PURE__ */ jsx(
|
|
22
|
-
|
|
55
|
+
Typography.Text,
|
|
23
56
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setModuleJumpList(_list);
|
|
27
|
-
}
|
|
57
|
+
style: { fontSize: 12, color: "rgba(0, 0, 0, 0.45)" },
|
|
58
|
+
children: `Current Module: ${module.path}`
|
|
28
59
|
}
|
|
29
|
-
)
|
|
30
|
-
/* @__PURE__ */ jsx(Typography.Title, { code: true, level: 5, style: { marginBottom: "revert" }, children: `Current Module: ${getShortPath(module.path)}` })
|
|
60
|
+
)
|
|
31
61
|
] }),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
open: show,
|
|
63
|
+
maskClosable: true,
|
|
64
|
+
width: drawerWidth * 0.8,
|
|
65
|
+
onClose: () => setShow(false),
|
|
66
|
+
children: /* @__PURE__ */ jsx(
|
|
67
|
+
ServerAPIProvider,
|
|
68
|
+
{
|
|
69
|
+
api: SDK.ServerAPI.API.GetAllChunkGraph,
|
|
70
|
+
body: {},
|
|
71
|
+
children: (_chunks) => {
|
|
72
|
+
return /* @__PURE__ */ jsx(ModuleGraphListContext.Consumer, { children: ({ moduleJumpList, setModuleJumpList }) => {
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
Card,
|
|
75
|
+
{
|
|
76
|
+
style: { minHeight: 400 },
|
|
77
|
+
tabList: tabslist,
|
|
78
|
+
activeTabKey,
|
|
79
|
+
tabProps: {
|
|
80
|
+
size: "small",
|
|
81
|
+
style: {
|
|
82
|
+
fontSize: 12
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
onTabChange: (k) => setActiveTabKey(k),
|
|
86
|
+
styles: {
|
|
87
|
+
title: { paddingTop: 0 }
|
|
88
|
+
},
|
|
89
|
+
title: /* @__PURE__ */ jsxs(Space, { style: { padding: "10px 0px" }, children: [
|
|
90
|
+
/* @__PURE__ */ jsx(
|
|
91
|
+
LeftSquareOutlined,
|
|
92
|
+
{
|
|
93
|
+
onClick: () => {
|
|
94
|
+
const _list = [
|
|
95
|
+
...moduleJumpList.slice(0, -1)
|
|
96
|
+
];
|
|
97
|
+
setModuleJumpList(_list);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Current Module Imported Reasons Tree" }),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Popover,
|
|
104
|
+
{
|
|
105
|
+
content: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Badge, { status: "success", text: " " }),
|
|
107
|
+
/* @__PURE__ */ jsx(RightSquareTwoTone, {}),
|
|
108
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: ": Jump button, click to jump to the Module dependency analysis page of this module." })
|
|
109
|
+
] }) }),
|
|
110
|
+
title: "Usage",
|
|
111
|
+
children: /* @__PURE__ */ jsx(QuestionCircleOutlined, {})
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }),
|
|
115
|
+
children: /* @__PURE__ */ jsx(Row, { justify: "start", align: "middle", children: /* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsx(
|
|
116
|
+
ModuleFilesTree,
|
|
117
|
+
{
|
|
118
|
+
curModule: module,
|
|
119
|
+
modules,
|
|
120
|
+
dependencies,
|
|
121
|
+
cwd,
|
|
122
|
+
selectedChunk,
|
|
123
|
+
activeTabKey
|
|
124
|
+
}
|
|
125
|
+
) }) })
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
} });
|
|
53
129
|
}
|
|
54
|
-
|
|
55
|
-
|
|
130
|
+
}
|
|
131
|
+
)
|
|
56
132
|
}
|
|
57
133
|
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
);
|
|
61
137
|
};
|
|
62
138
|
export {
|
|
63
|
-
ModuleAnalyzeComponent
|
|
139
|
+
ModuleAnalyzeComponent,
|
|
140
|
+
TabList
|
|
64
141
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SDK } from "@rsdoctor/types";
|
|
3
|
-
import {
|
|
3
|
+
import { Flex } from "antd";
|
|
4
|
+
import { HelpCenter } from "../../components/Overall/help-center";
|
|
5
|
+
import { BundleAlerts } from "../../components/Alerts";
|
|
4
6
|
import { withServerAPI } from "../../components/Manifest";
|
|
5
7
|
import {
|
|
6
8
|
BundleOverall,
|
|
7
9
|
CompileOverall,
|
|
8
10
|
ProjectOverall
|
|
9
11
|
} from "../../components/Overall";
|
|
10
|
-
import {
|
|
12
|
+
import { ResponsiveLayout } from "./responsiveLayout";
|
|
13
|
+
import style from "./index.module";
|
|
11
14
|
const Component = ({ project }) => {
|
|
12
15
|
const { summary, configs, root: cwd, envinfo, errors } = project;
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */ jsxs(
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: style.overall, children: /* @__PURE__ */ jsxs(Flex, { style: { width: "100%" }, children: [
|
|
17
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 3, marginRight: "16px" }, children: /* @__PURE__ */ jsxs(ResponsiveLayout, { children: [
|
|
15
18
|
/* @__PURE__ */ jsx(
|
|
16
19
|
ProjectOverall,
|
|
17
20
|
{
|
|
@@ -21,12 +24,14 @@ const Component = ({ project }) => {
|
|
|
21
24
|
alerts: errors
|
|
22
25
|
}
|
|
23
26
|
),
|
|
27
|
+
/* @__PURE__ */ jsx(BundleAlerts, {})
|
|
28
|
+
] }) }),
|
|
29
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxs(ResponsiveLayout, { children: [
|
|
24
30
|
/* @__PURE__ */ jsx(BundleOverall, { errors, cwd }),
|
|
25
|
-
/* @__PURE__ */ jsx(CompileOverall, { summary })
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
] });
|
|
31
|
+
/* @__PURE__ */ jsx(CompileOverall, { summary }),
|
|
32
|
+
/* @__PURE__ */ jsx(HelpCenter, {})
|
|
33
|
+
] }) })
|
|
34
|
+
] }) });
|
|
30
35
|
};
|
|
31
36
|
const Page = withServerAPI({
|
|
32
37
|
api: SDK.ServerAPI.API.GetProjectInfo,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--font-family-code: Roboto, Roboto Mono, -apple-system, BlinkMacSystemFont,
|
|
3
|
+
"Segoe UI", Menlo, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
4
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
5
|
+
}
|
|
6
|
+
:root .ant-layout-content {
|
|
7
|
+
padding: 16px 32px !important;
|
|
8
|
+
}
|
|
9
|
+
:root .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper {
|
|
10
|
+
cursor: default;
|
|
11
|
+
}
|
|
12
|
+
:root .ant-tree-title {
|
|
13
|
+
flex: 1 1;
|
|
14
|
+
}
|
|
15
|
+
:root .ant-tree-node-content-wrapper-normal {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.overall_43377 {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.layout_43377 .row_43377 {
|
|
25
|
+
margin-bottom: 16px;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from "antd";
|
|
3
|
+
import style from "./index.module";
|
|
4
|
+
const ResponsiveLayout = ({ children }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Flex, { vertical: true, className: style.layout, children: children.map((e) => /* @__PURE__ */ jsx("div", { className: style.row, children: e })) });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
ResponsiveLayout
|
|
9
|
+
};
|
|
@@ -272,15 +272,15 @@ const Modules = ({
|
|
|
272
272
|
file: r.path,
|
|
273
273
|
data: [
|
|
274
274
|
{
|
|
275
|
-
baseline: current.moduleCodeMap[r.current
|
|
276
|
-
current: current.moduleCodeMap[r.current
|
|
275
|
+
baseline: current.moduleCodeMap[r.current.id]?.source,
|
|
276
|
+
current: current.moduleCodeMap[r.current.id]?.transformed,
|
|
277
277
|
baselineTitle: "Current Source",
|
|
278
278
|
currentTitle: "Current Transformed Source",
|
|
279
279
|
group: "Transformed Source"
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
|
-
baseline: current.moduleCodeMap[r.current
|
|
283
|
-
current: current.moduleCodeMap[r.current
|
|
282
|
+
baseline: current.moduleCodeMap[r.current.id]?.source,
|
|
283
|
+
current: current.moduleCodeMap[r.current.id]?.parsedSource,
|
|
284
284
|
baselineTitle: "Current Source",
|
|
285
285
|
currentTitle: "Current Parsed Source",
|
|
286
286
|
group: "Parsed Source"
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { Module, ModuleGraph, SourceRange } from '@rsdoctor/graph';
|
|
2
1
|
import { SDK } from '@rsdoctor/types';
|
|
3
2
|
import { SetEditorStatus } from './types';
|
|
4
3
|
export interface CodeEditorProps {
|
|
5
|
-
module:
|
|
6
|
-
moduleGraph:
|
|
7
|
-
ranges: SourceRange[];
|
|
4
|
+
module: SDK.ModuleInstance;
|
|
5
|
+
moduleGraph: SDK.ModuleGraphInstance;
|
|
6
|
+
ranges: SDK.SourceRange[];
|
|
8
7
|
setEditorData: SetEditorStatus;
|
|
9
8
|
source: SDK.ModuleSource;
|
|
10
9
|
toLine?: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { TableKind, SetEditorStatus } from './types';
|
|
4
4
|
interface TableProps {
|
|
5
|
-
module:
|
|
6
|
-
moduleGraph:
|
|
5
|
+
module: SDK.ModuleInstance;
|
|
6
|
+
moduleGraph: SDK.ModuleGraphInstance;
|
|
7
7
|
setEditorData: SetEditorStatus;
|
|
8
8
|
kind: TableKind;
|
|
9
9
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
2
|
export type TableKind = 'side-effect' | 'export';
|
|
3
|
-
export type SetEditorStatus = (module:
|
|
3
|
+
export type SetEditorStatus = (module: SDK.ModuleInstance, ranges: SDK.SourceRange[], line?: number) => void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ModuleGraph, Statement } from '@rsdoctor/graph';
|
|
2
|
-
import { Module } from '@rsdoctor/graph';
|
|
3
1
|
import type { editor } from 'monaco-editor';
|
|
4
|
-
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
export declare function useFileStructures(modules: SDK.ModuleInstance[], moduleGraph: SDK.ModuleGraphInstance, searchInput: string, selectedModule: SDK.ModuleInstance, onItemClick: (file: string) => void, cwd: string): import("../..").DataNode[];
|
|
5
4
|
export declare function getTreeFilesDefaultExpandedKeys(files: any[]): (string | number)[];
|
|
6
5
|
export declare function ellipsisPath(full: string): string;
|
|
7
|
-
export declare function getModulePositionString(statement:
|
|
8
|
-
export declare function getHoverMessageInModule(module:
|
|
6
|
+
export declare function getModulePositionString(statement: SDK.StatementInstance, module: SDK.ModuleInstance): string;
|
|
7
|
+
export declare function getHoverMessageInModule(module: SDK.ModuleInstance, moduleGraph: SDK.ModuleGraphInstance): editor.IModelDecoration[];
|
|
@@ -2,13 +2,16 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { LoaderAnalysis } from "../../../components/Loader/Analysis";
|
|
3
3
|
import { WebpackConfigurationViewer } from "../../../components/Configuration";
|
|
4
4
|
import { Card } from "../../../components/Card";
|
|
5
|
+
import { theme } from "antd";
|
|
6
|
+
const { useToken } = theme;
|
|
5
7
|
const Page = () => {
|
|
8
|
+
const { token } = useToken();
|
|
6
9
|
return /* @__PURE__ */ jsx(
|
|
7
10
|
Card,
|
|
8
11
|
{
|
|
9
12
|
title: "Loader Analysis",
|
|
10
13
|
extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, { defaultKeys: ["module", "resolve"] }),
|
|
11
|
-
bodyStyle: { paddingTop:
|
|
14
|
+
bodyStyle: { paddingTop: token.padding, height: 800 },
|
|
12
15
|
children: /* @__PURE__ */ jsx(LoaderAnalysis, {})
|
|
13
16
|
}
|
|
14
17
|
);
|
|
@@ -3,7 +3,14 @@ import { WebpackConfigurationViewer } from "../../../components/Configuration";
|
|
|
3
3
|
import { Card } from "../../../components/Card";
|
|
4
4
|
import { LoaderChart } from "../../../components/Charts";
|
|
5
5
|
const Page = () => {
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Card,
|
|
8
|
+
{
|
|
9
|
+
title: "Loader Timeline",
|
|
10
|
+
extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, { defaultKeys: ["module"] }),
|
|
11
|
+
children: /* @__PURE__ */ jsx(LoaderChart, {})
|
|
12
|
+
}
|
|
13
|
+
);
|
|
7
14
|
};
|
|
8
15
|
export * from "./constants";
|
|
9
16
|
export {
|