@rsdoctor/components 0.0.2-beta.0 → 0.0.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/change.js +2 -3
- package/dist/components/Alert/file-relation.js +1 -1
- package/dist/components/Alert/index.css +3 -0
- package/dist/components/Alert/link.js +1 -1
- package/dist/components/Alert/package-relation.js +8 -27
- package/dist/components/Alert/view.js +3 -4
- package/dist/components/Alerts/bundle.js +23 -9
- package/dist/components/Alerts/common.js +3 -20
- package/dist/components/Badge/index.js +11 -29
- package/dist/components/Card/diff.d.ts +2 -2
- package/dist/components/Card/diff.js +4 -33
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +6 -37
- package/dist/components/Card/size.d.ts +5 -0
- package/dist/components/Card/size.js +17 -9
- package/dist/components/Card/statistic.css +2 -1
- package/dist/components/Card/statistic.d.ts +3 -0
- package/dist/components/Card/statistic.js +6 -21
- package/dist/components/Charts/TimelineCharts/index.js +120 -127
- package/dist/components/Charts/common.js +1 -1
- package/dist/components/Charts/loader.js +9 -18
- package/dist/components/CodeViewer/diff.js +8 -26
- package/dist/components/CodeViewer/hightlight.js +3 -3
- package/dist/components/CodeViewer/viewer.js +4 -20
- package/dist/components/Configuration/{webpack.d.ts → builder.d.ts} +1 -1
- package/dist/components/Configuration/{webpack.js → builder.js} +6 -6
- package/dist/components/Configuration/index.d.ts +1 -1
- package/dist/components/Configuration/index.js +1 -1
- package/dist/components/FileTree/index.js +13 -24
- package/dist/components/Form/keyword.js +1 -17
- package/dist/components/Keyword/index.js +4 -36
- package/dist/components/Layout/builder-select.js +1 -1
- package/dist/components/Layout/header.js +2 -3
- package/dist/components/Layout/index.js +2 -2
- package/dist/components/Layout/menus.d.ts +1 -1
- package/dist/components/Layout/menus.js +11 -35
- package/dist/components/Loader/Analysis/files.js +8 -2
- package/dist/components/Loader/Analysis/index.d.ts +1 -1
- package/dist/components/Loader/executions.d.ts +1 -1
- package/dist/components/Loader/executions.js +62 -84
- package/dist/components/Manifest/api.d.ts +1 -1
- package/dist/components/Manifest/api.js +5 -35
- package/dist/components/Manifest/data.d.ts +1 -1
- package/dist/components/Manifest/data.js +1 -17
- package/dist/components/Opener/vscode.js +4 -19
- package/dist/components/Overall/bundle.js +2 -2
- package/dist/components/Overall/compile.js +1 -2
- package/dist/components/Resolver/analysis.js +1 -17
- package/dist/components/TextDrawer/duplicate.js +18 -56
- package/dist/components/TextDrawer/index.js +9 -28
- package/dist/components/worker/ecmaversion/client.js +1 -2
- package/dist/components/worker/ecmaversion/worker.js +3 -3
- package/dist/components/worker/jsequal/client.js +1 -2
- package/dist/components/worker/jsequal/worker.js +21 -50
- package/dist/config.d.ts +2 -2
- package/dist/config.js +3 -17
- package/dist/constants.d.ts +4 -2
- package/dist/constants.js +5 -1
- package/dist/pages/BundleSize/components/asset.js +74 -101
- package/dist/pages/BundleSize/components/cards.js +16 -27
- package/dist/pages/BundleSize/components/index.d.ts +1 -1
- package/dist/pages/BundleSize/components/index.js +57 -5
- package/dist/pages/BundleSize/constants.d.ts +1 -1
- package/dist/pages/BundleSize/constants.js +1 -1
- package/dist/pages/ModuleAnalyze/chunks.js +1 -1
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +16 -7
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +6 -24
- package/dist/pages/ModuleAnalyze/constants.d.ts +1 -1
- package/dist/pages/ModuleAnalyze/constants.js +1 -1
- package/dist/pages/ModuleAnalyze/utils/hooks.js +5 -8
- package/dist/pages/ModuleAnalyze/utils/index.js +2 -4
- package/dist/pages/ModuleResolve/constants.d.ts +1 -1
- package/dist/pages/ModuleResolve/constants.js +1 -1
- package/dist/pages/Overall/constants.d.ts +1 -1
- package/dist/pages/Overall/constants.js +1 -1
- package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/constants.js +7 -0
- package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/index.js +53 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Analysis/constants.js +1 -1
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +2 -2
- package/dist/pages/WebpackLoaders/Overall/constants.js +2 -2
- package/dist/pages/WebpackLoaders/Overall/index.js +1 -1
- package/dist/pages/WebpackPlugins/constants.d.ts +2 -2
- package/dist/pages/WebpackPlugins/constants.js +2 -2
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +3 -1
- package/dist/utils/data/base.d.ts +7 -7
- package/dist/utils/data/base.js +2 -24
- package/dist/utils/data/index.d.ts +1 -1
- package/dist/utils/data/index.js +14 -36
- package/dist/utils/data/local.d.ts +1 -1
- package/dist/utils/data/local.js +32 -56
- package/dist/utils/data/remote.d.ts +1 -1
- package/dist/utils/data/remote.js +22 -46
- package/dist/utils/file.js +4 -4
- package/dist/utils/hooks.d.ts +16 -15
- package/dist/utils/hooks.js +33 -73
- package/dist/utils/i18n/cn.js +1 -1
- package/dist/utils/i18n/en.d.ts +1 -1
- package/dist/utils/i18n/en.js +1 -1
- package/dist/utils/manifest.d.ts +2 -2
- package/dist/utils/monaco.d.ts +4 -1
- package/dist/utils/monaco.js +26 -3
- package/dist/utils/request.d.ts +10 -10
- package/dist/utils/request.js +52 -101
- package/dist/utils/routes.d.ts +2 -2
- package/dist/utils/routes.js +2 -2
- package/dist/utils/storage.js +3 -3
- package/dist/utils/url.js +10 -28
- package/package.json +7 -4
- package/dist/assets/icon.7509d763.svg +0 -21
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useEffect, memo } from "react";
|
|
3
3
|
import ReactECharts from "echarts-for-react";
|
|
4
4
|
import * as echarts from "echarts/core";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import { groupBy } from "lodash-es";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{ color: "#7B66FF" },
|
|
11
|
-
{ color: "#96EFFF" },
|
|
12
|
-
{ color: "#E25E3E" },
|
|
13
|
-
{ color: "#D0F288" },
|
|
14
|
-
{ color: "#8ADAB2" },
|
|
15
|
-
{ color: "#FFC5C5" },
|
|
16
|
-
{ color: "#3876BF" }
|
|
17
|
-
];
|
|
18
|
-
const TimelineCom = ({ loaderData, pluginsData, formatterFn, chartType = "normal" }) => {
|
|
7
|
+
import randomColor from "randomcolor";
|
|
8
|
+
const LINE_HEIGHT = 60;
|
|
9
|
+
const TimelineCom = memo(({ loaderData, pluginsData, formatterFn, chartType = "normal" }) => {
|
|
19
10
|
const data = [];
|
|
20
11
|
let categories = [];
|
|
21
|
-
|
|
12
|
+
const [optionsData, setOptinsData] = useState({});
|
|
13
|
+
useEffect(() => {
|
|
22
14
|
if (!loaderData)
|
|
23
15
|
return;
|
|
24
16
|
const _categories = [];
|
|
@@ -27,26 +19,24 @@ const TimelineCom = ({ loaderData, pluginsData, formatterFn, chartType = "normal
|
|
|
27
19
|
_categories.unshift(_l.n);
|
|
28
20
|
});
|
|
29
21
|
loaderData.forEach(function(_loaderData, _i) {
|
|
30
|
-
var _a;
|
|
31
|
-
const typeItem = ColorMap[_i % 9];
|
|
32
22
|
data.push({
|
|
33
23
|
name: _loaderData.n + " total",
|
|
34
24
|
value: [_categories.indexOf(_loaderData.n + " total"), _loaderData.s, _loaderData.e, _loaderData.e - _loaderData.s],
|
|
35
25
|
itemStyle: {
|
|
36
26
|
normal: {
|
|
37
|
-
color:
|
|
27
|
+
color: randomColor()
|
|
38
28
|
}
|
|
39
29
|
}
|
|
40
30
|
});
|
|
41
|
-
if (!
|
|
31
|
+
if (!_loaderData?.c)
|
|
42
32
|
return;
|
|
43
|
-
for (let l = 0; l <
|
|
33
|
+
for (let l = 0; l < _loaderData?.c?.length; l++) {
|
|
44
34
|
data.push({
|
|
45
35
|
name: _loaderData.n,
|
|
46
36
|
value: [_categories.indexOf(_loaderData.n), _loaderData.c[l].s, _loaderData.c[l].e, _loaderData.c[l].e - _loaderData.c[l].s],
|
|
47
37
|
itemStyle: {
|
|
48
38
|
normal: {
|
|
49
|
-
color:
|
|
39
|
+
color: randomColor()
|
|
50
40
|
}
|
|
51
41
|
},
|
|
52
42
|
ext: _loaderData.c[l].ext
|
|
@@ -61,7 +51,7 @@ const TimelineCom = ({ loaderData, pluginsData, formatterFn, chartType = "normal
|
|
|
61
51
|
}
|
|
62
52
|
});
|
|
63
53
|
}, [loaderData]);
|
|
64
|
-
|
|
54
|
+
useEffect(() => {
|
|
65
55
|
if (!pluginsData)
|
|
66
56
|
return;
|
|
67
57
|
const _pluginsData = groupBy(pluginsData, (e) => e.pid);
|
|
@@ -72,7 +62,7 @@ const TimelineCom = ({ loaderData, pluginsData, formatterFn, chartType = "normal
|
|
|
72
62
|
value: [i, _plugin.args.s, _plugin.args.e, _plugin.args.e - _plugin.args.s],
|
|
73
63
|
itemStyle: {
|
|
74
64
|
normal: {
|
|
75
|
-
color:
|
|
65
|
+
color: randomColor()
|
|
76
66
|
}
|
|
77
67
|
},
|
|
78
68
|
ext: _plugin
|
|
@@ -81,117 +71,120 @@ const TimelineCom = ({ loaderData, pluginsData, formatterFn, chartType = "normal
|
|
|
81
71
|
categories.push(String(key.charAt(0).toUpperCase() + key.slice(1)));
|
|
82
72
|
});
|
|
83
73
|
}, [pluginsData]);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
dataZoom: [
|
|
121
|
-
{
|
|
122
|
-
type: "slider",
|
|
123
|
-
filterMode: "weakFilter",
|
|
124
|
-
showDataShadow: false,
|
|
125
|
-
top: -10,
|
|
126
|
-
labelFormatter: ""
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
type: "inside",
|
|
130
|
-
filterMode: "weakFilter"
|
|
131
|
-
}
|
|
132
|
-
],
|
|
133
|
-
grid: {
|
|
134
|
-
top: 10,
|
|
135
|
-
left: 0,
|
|
136
|
-
bottom: 10,
|
|
137
|
-
right: 0,
|
|
138
|
-
height: categories.length > 2 ? "auto" : chartType === "loader" ? categories.length * 150 : categories.length * 100,
|
|
139
|
-
containLabel: true
|
|
140
|
-
},
|
|
141
|
-
xAxis: {
|
|
142
|
-
position: "top",
|
|
143
|
-
splitLine: {
|
|
144
|
-
show: false
|
|
145
|
-
},
|
|
146
|
-
scale: true,
|
|
147
|
-
axisLine: {
|
|
148
|
-
show: false
|
|
149
|
-
},
|
|
150
|
-
axisLabel: {
|
|
151
|
-
formatter(val) {
|
|
152
|
-
return dayjs(val).format("HH:mm:ss");
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
function renderItem(params, api) {
|
|
76
|
+
const categoryIndex = api.value(0);
|
|
77
|
+
const start = api.coord([api.value(1), categoryIndex]);
|
|
78
|
+
const end = api.coord([api.value(2), categoryIndex]);
|
|
79
|
+
const height = api.size([0, 1])[1] * 0.3;
|
|
80
|
+
const rectShape = echarts.graphic.clipRectByRect(
|
|
81
|
+
{
|
|
82
|
+
x: start[0],
|
|
83
|
+
y: chartType === "loader" ? start[1] - (categoryIndex % 2 !== 0 ? 0 : height * 2) : start[1],
|
|
84
|
+
width: end[0] - start[0] || 5,
|
|
85
|
+
height
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
x: params.coordSys.x,
|
|
89
|
+
y: params.coordSys.y,
|
|
90
|
+
width: params.coordSys.width,
|
|
91
|
+
height: params.coordSys.height
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
return rectShape && {
|
|
95
|
+
type: "rect",
|
|
96
|
+
transition: ["shape"],
|
|
97
|
+
shape: rectShape,
|
|
98
|
+
style: api.style(),
|
|
99
|
+
enterFrom: {
|
|
100
|
+
style: { opacity: 0 },
|
|
101
|
+
x: 0
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const option = {
|
|
106
|
+
tooltip: {
|
|
107
|
+
formatter: (raw) => {
|
|
108
|
+
return formatterFn(raw);
|
|
153
109
|
}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
yAxis: {
|
|
157
|
-
type: "category",
|
|
158
|
-
splitLine: {
|
|
159
|
-
interval: chartType === "loader" ? 1 : 0,
|
|
160
|
-
show: true
|
|
161
|
-
},
|
|
162
|
-
axisLabel: {
|
|
163
|
-
inside: true,
|
|
164
|
-
lineHeight: 20,
|
|
165
|
-
width: 100,
|
|
166
|
-
fontSize: 12,
|
|
167
|
-
color: "#000",
|
|
168
|
-
verticalAlign: "bottom"
|
|
169
110
|
},
|
|
170
|
-
|
|
171
|
-
|
|
111
|
+
dataZoom: [
|
|
112
|
+
{
|
|
113
|
+
type: "slider",
|
|
114
|
+
filterMode: "weakFilter",
|
|
115
|
+
showDataShadow: false,
|
|
116
|
+
top: -10,
|
|
117
|
+
labelFormatter: ""
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "inside",
|
|
121
|
+
filterMode: "weakFilter"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
grid: {
|
|
125
|
+
top: 10,
|
|
126
|
+
left: 0,
|
|
127
|
+
bottom: 10,
|
|
128
|
+
right: 0,
|
|
129
|
+
height: categories.length > (chartType === "loader" ? 6 : 3) ? "auto" : categories.length * LINE_HEIGHT,
|
|
130
|
+
containLabel: true
|
|
172
131
|
},
|
|
173
|
-
|
|
174
|
-
|
|
132
|
+
xAxis: {
|
|
133
|
+
position: "top",
|
|
134
|
+
splitLine: {
|
|
135
|
+
show: false
|
|
136
|
+
},
|
|
137
|
+
scale: true,
|
|
138
|
+
axisLine: {
|
|
139
|
+
show: false
|
|
140
|
+
},
|
|
141
|
+
axisLabel: {
|
|
142
|
+
formatter(val) {
|
|
143
|
+
return dayjs(val).format("HH:mm:ss");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
175
146
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
renderItem,
|
|
182
|
-
itemStyle: {
|
|
183
|
-
opacity: 0.8
|
|
147
|
+
yAxis: {
|
|
148
|
+
type: "category",
|
|
149
|
+
splitLine: {
|
|
150
|
+
interval: chartType === "loader" ? 1 : 0,
|
|
151
|
+
show: true
|
|
184
152
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
153
|
+
axisLabel: {
|
|
154
|
+
inside: true,
|
|
155
|
+
lineHeight: 20,
|
|
156
|
+
width: 100,
|
|
157
|
+
fontSize: 12,
|
|
158
|
+
color: "#000",
|
|
159
|
+
verticalAlign: "bottom"
|
|
188
160
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
161
|
+
axisLine: {
|
|
162
|
+
show: true
|
|
163
|
+
},
|
|
164
|
+
axisTick: {
|
|
165
|
+
show: false
|
|
166
|
+
},
|
|
167
|
+
data: categories
|
|
168
|
+
},
|
|
169
|
+
series: [
|
|
170
|
+
{
|
|
171
|
+
type: "custom",
|
|
172
|
+
renderItem,
|
|
173
|
+
itemStyle: {
|
|
174
|
+
opacity: 0.8
|
|
175
|
+
},
|
|
176
|
+
encode: {
|
|
177
|
+
x: [1, 2],
|
|
178
|
+
y: 0
|
|
179
|
+
},
|
|
180
|
+
data
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
};
|
|
184
|
+
setOptinsData(option);
|
|
185
|
+
}, [loaderData, pluginsData]);
|
|
186
|
+
return /* @__PURE__ */ jsx(ReactECharts, { option: optionsData, echarts, style: { width: "100%", minHeight: "400px" } });
|
|
187
|
+
});
|
|
195
188
|
export {
|
|
196
189
|
TimelineCom
|
|
197
190
|
};
|
|
@@ -43,7 +43,7 @@ const CommonExecutionEmptyTips = () => {
|
|
|
43
43
|
{
|
|
44
44
|
message: /* @__PURE__ */ jsxs(Typography.Text, { children: [
|
|
45
45
|
/* @__PURE__ */ jsx(Typography.Text, { children: "make sure that you have turn on " }),
|
|
46
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: " in configuration for the
|
|
46
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: " in configuration for the Rsdoctor plugin." })
|
|
47
47
|
] }),
|
|
48
48
|
type: "info",
|
|
49
49
|
showIcon: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo, useRef } from "react";
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useRef, useEffect, useState } from "react";
|
|
3
3
|
import { groupBy } from "lodash-es";
|
|
4
4
|
import { Empty } from "antd";
|
|
5
5
|
import "./loader.css";
|
|
@@ -11,27 +11,19 @@ import { renderTotalLoadersTooltip, getTooltipHtmlForLoader } from "./utils";
|
|
|
11
11
|
const LoaderExecutionsChart = ({ loaders, cwd }) => {
|
|
12
12
|
const { isDark } = useTheme();
|
|
13
13
|
const ref = useRef(null);
|
|
14
|
+
const [data, setData] = useState([]);
|
|
14
15
|
const groupByLoader = useMemo(() => groupBy(loaders, (e) => e.loader), [loaders]);
|
|
15
16
|
const formatterForLoader = useCallback((raw) => {
|
|
16
17
|
const { name, data: data2 } = raw;
|
|
17
18
|
const loaderName = name.replace(" total", "");
|
|
18
|
-
if (data2
|
|
19
|
+
if (data2?.ext) {
|
|
19
20
|
return getTooltipHtmlForLoader(data2.ext);
|
|
20
21
|
}
|
|
21
22
|
return renderTotalLoadersTooltip(loaderName, loaders, cwd);
|
|
22
23
|
}, []);
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const _data = Object.keys(groupByLoader).map((loaderName) => {
|
|
25
26
|
const list = groupByLoader[loaderName] || [];
|
|
26
|
-
if (list.length === 1) {
|
|
27
|
-
const { startAt, endAt } = list[0];
|
|
28
|
-
return {
|
|
29
|
-
p: loaderName,
|
|
30
|
-
n: loaderName,
|
|
31
|
-
s: startAt,
|
|
32
|
-
e: endAt
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
27
|
const { start, end } = findLoaderTotalTiming(list);
|
|
36
28
|
return {
|
|
37
29
|
p: loaderName,
|
|
@@ -50,10 +42,9 @@ const LoaderExecutionsChart = ({ loaders, cwd }) => {
|
|
|
50
42
|
})
|
|
51
43
|
};
|
|
52
44
|
});
|
|
45
|
+
setData(_data);
|
|
53
46
|
}, [groupByLoader]);
|
|
54
|
-
|
|
55
|
-
return /* @__PURE__ */ jsx(Empty, {});
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
+
return /* @__PURE__ */ jsx(Fragment, { children: data?.length ? /* @__PURE__ */ jsx(
|
|
57
48
|
"div",
|
|
58
49
|
{
|
|
59
50
|
className: ["loader-chart-container", isDark ? "loader-chart-container_dark" : ""].join(" ").trim(),
|
|
@@ -61,7 +52,7 @@ const LoaderExecutionsChart = ({ loaders, cwd }) => {
|
|
|
61
52
|
style: { width: "100%", height: "600px" },
|
|
62
53
|
children: /* @__PURE__ */ jsx(TimelineCom, { loaderData: data, formatterFn: formatterForLoader, chartType: "loader" })
|
|
63
54
|
}
|
|
64
|
-
);
|
|
55
|
+
) : /* @__PURE__ */ jsx(Empty, {}) });
|
|
65
56
|
};
|
|
66
57
|
export {
|
|
67
58
|
LoaderExecutionsChart
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import { jsx } from "react/jsx-runtime";
|
|
21
2
|
import { DiffEditor } from "@monaco-editor/react";
|
|
22
3
|
import { Size } from "../../constants";
|
|
@@ -24,16 +5,16 @@ import { getModifiedLanguage, getOriginalLanguage } from "../../utils";
|
|
|
24
5
|
const DiffViewer = ({ before, after, filepath, className, editorProps }) => {
|
|
25
6
|
return /* @__PURE__ */ jsx(
|
|
26
7
|
DiffEditor,
|
|
27
|
-
|
|
8
|
+
{
|
|
28
9
|
className,
|
|
29
10
|
originalLanguage: getOriginalLanguage(filepath),
|
|
30
11
|
modifiedLanguage: getModifiedLanguage(filepath),
|
|
31
12
|
theme: "vs-dark",
|
|
32
13
|
original: before,
|
|
33
14
|
modified: after,
|
|
34
|
-
width: "100%"
|
|
35
|
-
|
|
36
|
-
options:
|
|
15
|
+
width: "100%",
|
|
16
|
+
...editorProps,
|
|
17
|
+
options: {
|
|
37
18
|
readOnly: true,
|
|
38
19
|
originalEditable: false,
|
|
39
20
|
renderSideBySide: true,
|
|
@@ -43,9 +24,10 @@ const DiffViewer = ({ before, after, filepath, className, editorProps }) => {
|
|
|
43
24
|
domReadOnly: true,
|
|
44
25
|
fontSize: 14,
|
|
45
26
|
minimap: { enabled: false },
|
|
46
|
-
diffWordWrap: "on"
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
diffWordWrap: "on",
|
|
28
|
+
...editorProps?.options
|
|
29
|
+
}
|
|
30
|
+
}
|
|
49
31
|
);
|
|
50
32
|
};
|
|
51
33
|
export {
|
|
@@ -10,9 +10,9 @@ const FileHightLightViewer = ({ dependency, module, cwd, moduleCode }) => {
|
|
|
10
10
|
if (!dependency)
|
|
11
11
|
return null;
|
|
12
12
|
const { statements } = dependency;
|
|
13
|
-
const hasSourceRange = Boolean(statements[0]
|
|
14
|
-
const { start, end } = hasSourceRange ? statements[0].position.source : statements[0].position.transformed;
|
|
15
|
-
const content = hasSourceRange ? moduleCode
|
|
13
|
+
const hasSourceRange = Boolean(statements?.[0]?.position?.source);
|
|
14
|
+
const { start, end } = statements?.[0]?.position ? hasSourceRange ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 }, end: { line: 0, column: 0 } };
|
|
15
|
+
const content = hasSourceRange ? moduleCode?.source : moduleCode?.transformed || moduleCode?.source;
|
|
16
16
|
const modulePath = module.path;
|
|
17
17
|
const handleEditorDidMount = (editor2, monaco) => {
|
|
18
18
|
editorRef.current = editor2;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
import { jsx } from "react/jsx-runtime";
|
|
18
2
|
import Editor from "@monaco-editor/react";
|
|
19
3
|
import { isNumber } from "lodash-es";
|
|
20
|
-
import {
|
|
4
|
+
import { CodepenCircleOutlined } from "@ant-design/icons";
|
|
21
5
|
import { getOriginalLanguage, getSelectionRange } from "../../utils";
|
|
22
6
|
import { DefaultEditorConfig } from "./config";
|
|
23
7
|
import { TextDrawer } from "../TextDrawer";
|
|
@@ -46,7 +30,7 @@ const CodeViewer = ({ content, ranges, path, defaultLine, editorConfig = {} }) =
|
|
|
46
30
|
value: content,
|
|
47
31
|
width: "100%",
|
|
48
32
|
height: window.innerHeight / 1.5,
|
|
49
|
-
options:
|
|
33
|
+
options: { ...DefaultEditorConfig, ...editorConfig },
|
|
50
34
|
onMount: handleEditorDidMount
|
|
51
35
|
}
|
|
52
36
|
);
|
|
@@ -58,7 +42,7 @@ const CodeViewerWithDrawer = (props) => {
|
|
|
58
42
|
text: "",
|
|
59
43
|
buttonProps: {
|
|
60
44
|
size: "small",
|
|
61
|
-
icon: /* @__PURE__ */ jsx(
|
|
45
|
+
icon: /* @__PURE__ */ jsx(CodepenCircleOutlined, {}),
|
|
62
46
|
type: "default"
|
|
63
47
|
},
|
|
64
48
|
buttonStyle: { padding: `0 4px` },
|
|
@@ -66,7 +50,7 @@ const CodeViewerWithDrawer = (props) => {
|
|
|
66
50
|
destroyOnClose: true,
|
|
67
51
|
title: `Code of "${props.path}"`
|
|
68
52
|
},
|
|
69
|
-
children: /* @__PURE__ */ jsx(CodeViewer,
|
|
53
|
+
children: /* @__PURE__ */ jsx(CodeViewer, { ...props })
|
|
70
54
|
}
|
|
71
55
|
);
|
|
72
56
|
};
|
|
@@ -7,7 +7,7 @@ interface WebpackConfigurationViewerBaseProps {
|
|
|
7
7
|
export declare const WebpackConfigurationViewerBase: React.FC<WebpackConfigurationViewerBaseProps>;
|
|
8
8
|
export declare const WebpackConfigurationViewer: React.FC<Omit<WebpackConfigurationViewerBaseProps, "configs"> & Partial<{
|
|
9
9
|
body: {
|
|
10
|
-
key: import("@rsdoctor/types/dist/manifest").
|
|
10
|
+
key: import("@rsdoctor/types/dist/manifest").RsdoctorManifestMappingKeys;
|
|
11
11
|
};
|
|
12
12
|
}>>;
|
|
13
13
|
export {};
|
|
@@ -12,11 +12,11 @@ const WebpackConfigurationViewerBase = ({
|
|
|
12
12
|
defaultKeys,
|
|
13
13
|
configs
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
15
|
+
const builderConfigData = useWebpackConfigurationByConfigs(configs || []);
|
|
16
|
+
if (!builderConfigData)
|
|
17
17
|
return null;
|
|
18
|
-
const { config
|
|
19
|
-
const keys = Object.keys(
|
|
18
|
+
const { config, version, name } = builderConfigData;
|
|
19
|
+
const keys = Object.keys(config);
|
|
20
20
|
const [selectKeys, setSelectKeys] = useState(defaultKeys || keys);
|
|
21
21
|
return /* @__PURE__ */ jsx(TextDrawer, { text: "View Builder Config", children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
22
22
|
/* @__PURE__ */ jsx(Title, { text: `Builder Config Viewer` }),
|
|
@@ -46,9 +46,9 @@ const WebpackConfigurationViewerBase = ({
|
|
|
46
46
|
/* @__PURE__ */ jsx(
|
|
47
47
|
ReactJson,
|
|
48
48
|
{
|
|
49
|
-
name: version && version !== "unknown" ?
|
|
49
|
+
name: version && version !== "unknown" ? `${name}@${version}` : `webpack.config`,
|
|
50
50
|
theme: "monokai",
|
|
51
|
-
src: selectKeys.length === 0 ?
|
|
51
|
+
src: selectKeys.length === 0 ? config : pick(config, selectKeys),
|
|
52
52
|
displayDataTypes: false,
|
|
53
53
|
displayObjectSize: false
|
|
54
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './builder';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./builder";
|
|
@@ -1,51 +1,40 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Space } from "antd";
|
|
2
|
+
import { Space, theme } from "antd";
|
|
19
3
|
import { FileOutlined, FolderOpenOutlined, FolderOutlined, RightOutlined } from "@ant-design/icons";
|
|
20
4
|
import Tree from "rc-tree";
|
|
21
5
|
import { Size } from "../../constants";
|
|
22
6
|
import "./index.css";
|
|
23
7
|
import { useTheme } from "../../utils";
|
|
8
|
+
const { useToken } = theme;
|
|
24
9
|
const FileTree = (props) => {
|
|
25
10
|
const { isDark } = useTheme();
|
|
26
|
-
const
|
|
11
|
+
const { token } = useToken();
|
|
12
|
+
const color = isDark ? token.colorWhite : token.colorText;
|
|
13
|
+
const style = { fontSize: token.fontSize };
|
|
27
14
|
return /* @__PURE__ */ jsx(
|
|
28
15
|
Tree,
|
|
29
|
-
|
|
16
|
+
{
|
|
30
17
|
checkable: false,
|
|
31
18
|
selectable: true,
|
|
32
19
|
switcherIcon: ({ data, expanded }) => {
|
|
33
|
-
if (data
|
|
20
|
+
if (data?.children) {
|
|
34
21
|
return /* @__PURE__ */ jsxs(Space, { style: { color }, children: [
|
|
35
22
|
/* @__PURE__ */ jsx(
|
|
36
23
|
RightOutlined,
|
|
37
24
|
{
|
|
25
|
+
twoToneColor: color,
|
|
38
26
|
className: `file-tree-switcher-arrow ${expanded ? "file-tree-switcher-arrow-expand" : ""}`,
|
|
39
|
-
style
|
|
27
|
+
style
|
|
40
28
|
}
|
|
41
29
|
),
|
|
42
|
-
expanded ? /* @__PURE__ */ jsx(FolderOpenOutlined, {
|
|
30
|
+
expanded ? /* @__PURE__ */ jsx(FolderOpenOutlined, { twoToneColor: color, style }) : /* @__PURE__ */ jsx(FolderOutlined, { twoToneColor: color, style })
|
|
43
31
|
] });
|
|
44
32
|
}
|
|
45
33
|
return /* @__PURE__ */ jsx(FileOutlined, { style: { marginLeft: Size.BasePadding - 6, color } });
|
|
46
34
|
},
|
|
47
|
-
expandAction: "click"
|
|
48
|
-
|
|
35
|
+
expandAction: "click",
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
49
38
|
);
|
|
50
39
|
};
|
|
51
40
|
export {
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
2
|
import { useEffect, useRef, useState } from "react";
|
|
19
3
|
import { Button, Input, Typography } from "antd";
|
|
@@ -30,7 +14,7 @@ const KeywordInput = ({
|
|
|
30
14
|
}) => {
|
|
31
15
|
const labelWidth = 120;
|
|
32
16
|
const [filename, setFilename] = useState("");
|
|
33
|
-
const labelStyle =
|
|
17
|
+
const labelStyle = { width: labelWidth, ...ls };
|
|
34
18
|
const ref = useRef(null);
|
|
35
19
|
let timer;
|
|
36
20
|
useEffect(() => {
|