@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.
Files changed (113) hide show
  1. package/dist/components/Alert/change.js +2 -3
  2. package/dist/components/Alert/file-relation.js +1 -1
  3. package/dist/components/Alert/index.css +3 -0
  4. package/dist/components/Alert/link.js +1 -1
  5. package/dist/components/Alert/package-relation.js +8 -27
  6. package/dist/components/Alert/view.js +3 -4
  7. package/dist/components/Alerts/bundle.js +23 -9
  8. package/dist/components/Alerts/common.js +3 -20
  9. package/dist/components/Badge/index.js +11 -29
  10. package/dist/components/Card/diff.d.ts +2 -2
  11. package/dist/components/Card/diff.js +4 -33
  12. package/dist/components/Card/index.d.ts +1 -0
  13. package/dist/components/Card/index.js +6 -37
  14. package/dist/components/Card/size.d.ts +5 -0
  15. package/dist/components/Card/size.js +17 -9
  16. package/dist/components/Card/statistic.css +2 -1
  17. package/dist/components/Card/statistic.d.ts +3 -0
  18. package/dist/components/Card/statistic.js +6 -21
  19. package/dist/components/Charts/TimelineCharts/index.js +120 -127
  20. package/dist/components/Charts/common.js +1 -1
  21. package/dist/components/Charts/loader.js +9 -18
  22. package/dist/components/CodeViewer/diff.js +8 -26
  23. package/dist/components/CodeViewer/hightlight.js +3 -3
  24. package/dist/components/CodeViewer/viewer.js +4 -20
  25. package/dist/components/Configuration/{webpack.d.ts → builder.d.ts} +1 -1
  26. package/dist/components/Configuration/{webpack.js → builder.js} +6 -6
  27. package/dist/components/Configuration/index.d.ts +1 -1
  28. package/dist/components/Configuration/index.js +1 -1
  29. package/dist/components/FileTree/index.js +13 -24
  30. package/dist/components/Form/keyword.js +1 -17
  31. package/dist/components/Keyword/index.js +4 -36
  32. package/dist/components/Layout/builder-select.js +1 -1
  33. package/dist/components/Layout/header.js +2 -3
  34. package/dist/components/Layout/index.js +2 -2
  35. package/dist/components/Layout/menus.d.ts +1 -1
  36. package/dist/components/Layout/menus.js +11 -35
  37. package/dist/components/Loader/Analysis/files.js +8 -2
  38. package/dist/components/Loader/Analysis/index.d.ts +1 -1
  39. package/dist/components/Loader/executions.d.ts +1 -1
  40. package/dist/components/Loader/executions.js +62 -84
  41. package/dist/components/Manifest/api.d.ts +1 -1
  42. package/dist/components/Manifest/api.js +5 -35
  43. package/dist/components/Manifest/data.d.ts +1 -1
  44. package/dist/components/Manifest/data.js +1 -17
  45. package/dist/components/Opener/vscode.js +4 -19
  46. package/dist/components/Overall/bundle.js +2 -2
  47. package/dist/components/Overall/compile.js +1 -2
  48. package/dist/components/Resolver/analysis.js +1 -17
  49. package/dist/components/TextDrawer/duplicate.js +18 -56
  50. package/dist/components/TextDrawer/index.js +9 -28
  51. package/dist/components/worker/ecmaversion/client.js +1 -2
  52. package/dist/components/worker/ecmaversion/worker.js +3 -3
  53. package/dist/components/worker/jsequal/client.js +1 -2
  54. package/dist/components/worker/jsequal/worker.js +21 -50
  55. package/dist/config.d.ts +2 -2
  56. package/dist/config.js +3 -17
  57. package/dist/constants.d.ts +4 -2
  58. package/dist/constants.js +5 -1
  59. package/dist/pages/BundleSize/components/asset.js +74 -101
  60. package/dist/pages/BundleSize/components/cards.js +16 -27
  61. package/dist/pages/BundleSize/components/index.d.ts +1 -1
  62. package/dist/pages/BundleSize/components/index.js +57 -5
  63. package/dist/pages/BundleSize/constants.d.ts +1 -1
  64. package/dist/pages/BundleSize/constants.js +1 -1
  65. package/dist/pages/ModuleAnalyze/chunks.js +1 -1
  66. package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +16 -7
  67. package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +6 -24
  68. package/dist/pages/ModuleAnalyze/constants.d.ts +1 -1
  69. package/dist/pages/ModuleAnalyze/constants.js +1 -1
  70. package/dist/pages/ModuleAnalyze/utils/hooks.js +5 -8
  71. package/dist/pages/ModuleAnalyze/utils/index.js +2 -4
  72. package/dist/pages/ModuleResolve/constants.d.ts +1 -1
  73. package/dist/pages/ModuleResolve/constants.js +1 -1
  74. package/dist/pages/Overall/constants.d.ts +1 -1
  75. package/dist/pages/Overall/constants.js +1 -1
  76. package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
  77. package/dist/pages/Resources/RuleIndex/constants.js +7 -0
  78. package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
  79. package/dist/pages/Resources/RuleIndex/index.js +53 -0
  80. package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +1 -1
  81. package/dist/pages/WebpackLoaders/Analysis/constants.js +1 -1
  82. package/dist/pages/WebpackLoaders/Overall/constants.d.ts +2 -2
  83. package/dist/pages/WebpackLoaders/Overall/constants.js +2 -2
  84. package/dist/pages/WebpackLoaders/Overall/index.js +1 -1
  85. package/dist/pages/WebpackPlugins/constants.d.ts +2 -2
  86. package/dist/pages/WebpackPlugins/constants.js +2 -2
  87. package/dist/pages/index.d.ts +2 -1
  88. package/dist/pages/index.js +3 -1
  89. package/dist/utils/data/base.d.ts +7 -7
  90. package/dist/utils/data/base.js +2 -24
  91. package/dist/utils/data/index.d.ts +1 -1
  92. package/dist/utils/data/index.js +14 -36
  93. package/dist/utils/data/local.d.ts +1 -1
  94. package/dist/utils/data/local.js +32 -56
  95. package/dist/utils/data/remote.d.ts +1 -1
  96. package/dist/utils/data/remote.js +22 -46
  97. package/dist/utils/file.js +4 -4
  98. package/dist/utils/hooks.d.ts +16 -15
  99. package/dist/utils/hooks.js +33 -73
  100. package/dist/utils/i18n/cn.js +1 -1
  101. package/dist/utils/i18n/en.d.ts +1 -1
  102. package/dist/utils/i18n/en.js +1 -1
  103. package/dist/utils/manifest.d.ts +2 -2
  104. package/dist/utils/monaco.d.ts +4 -1
  105. package/dist/utils/monaco.js +26 -3
  106. package/dist/utils/request.d.ts +10 -10
  107. package/dist/utils/request.js +52 -101
  108. package/dist/utils/routes.d.ts +2 -2
  109. package/dist/utils/routes.js +2 -2
  110. package/dist/utils/storage.js +3 -3
  111. package/dist/utils/url.js +10 -28
  112. package/package.json +7 -4
  113. package/dist/assets/icon.7509d763.svg +0 -21
@@ -1,24 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
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
- const ColorMap = [
8
- { color: "#DC2626" },
9
- { color: "#FFE382" },
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
- useMemo(() => {
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: typeItem.color
27
+ color: randomColor()
38
28
  }
39
29
  }
40
30
  });
41
- if (!(_loaderData == null ? void 0 : _loaderData.c))
31
+ if (!_loaderData?.c)
42
32
  return;
43
- for (let l = 0; l < ((_a = _loaderData == null ? void 0 : _loaderData.c) == null ? void 0 : _a.length); 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: ColorMap[Math.round(Math.random() * (ColorMap.length - 1))].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
- useMemo(() => {
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: ColorMap[Math.round(Math.random() * (ColorMap.length - 1))].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
- function renderItem(params, api) {
85
- const categoryIndex = api.value(0);
86
- const start = api.coord([api.value(1), categoryIndex]);
87
- const end = api.coord([api.value(2), categoryIndex]);
88
- const height = api.size([0, 1])[1] * 0.4;
89
- const rectShape = echarts.graphic.clipRectByRect(
90
- {
91
- x: start[0],
92
- y: chartType === "loader" ? start[1] - (categoryIndex % 2 !== 0 ? 0 : height) : start[1],
93
- width: end[0] - start[0] || 5,
94
- height
95
- },
96
- {
97
- x: params.coordSys.x,
98
- y: params.coordSys.y,
99
- width: params.coordSys.width,
100
- height: params.coordSys.height
101
- }
102
- );
103
- return rectShape && {
104
- type: "rect",
105
- transition: ["shape"],
106
- shape: rectShape,
107
- style: api.style(),
108
- enterFrom: {
109
- style: { opacity: 0 },
110
- x: 0
111
- }
112
- };
113
- }
114
- const option = {
115
- tooltip: {
116
- formatter: (raw) => {
117
- return formatterFn(raw);
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
- axisLine: {
171
- show: true
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
- axisTick: {
174
- show: false
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
- data: categories
177
- },
178
- series: [
179
- {
180
- type: "custom",
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
- encode: {
186
- x: [1, 2],
187
- y: 0
153
+ axisLabel: {
154
+ inside: true,
155
+ lineHeight: 20,
156
+ width: 100,
157
+ fontSize: 12,
158
+ color: "#000",
159
+ verticalAlign: "bottom"
188
160
  },
189
- data
190
- }
191
- ]
192
- };
193
- return /* @__PURE__ */ jsx(ReactECharts, { option, echarts, style: { width: "100%", minHeight: "400px" } });
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 Web Doctor plugin." })
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 == null ? void 0 : data2.ext) {
19
+ if (data2?.ext) {
19
20
  return getTooltipHtmlForLoader(data2.ext);
20
21
  }
21
22
  return renderTotalLoadersTooltip(loaderName, loaders, cwd);
22
23
  }, []);
23
- const data = useMemo(() => {
24
- return Object.keys(groupByLoader).map((loaderName) => {
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
- if (!data.length)
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
- __spreadProps(__spreadValues({
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
- }, editorProps), {
36
- options: __spreadValues({
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
- }, editorProps == null ? void 0 : editorProps.options)
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].position.source);
14
- const { start, end } = hasSourceRange ? statements[0].position.source : statements[0].position.transformed;
15
- const content = hasSourceRange ? moduleCode == null ? void 0 : moduleCode.source : moduleCode == null ? void 0 : moduleCode.transformed;
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 { CodepenOutlined } from "@ant-design/icons";
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: __spreadValues(__spreadValues({}, DefaultEditorConfig), editorConfig),
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(CodepenOutlined, {}),
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, __spreadValues({}, props))
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").DoctorManifestMappingKeys;
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 webpackData = useWebpackConfigurationByConfigs(configs || []);
16
- if (!webpackData)
15
+ const builderConfigData = useWebpackConfigurationByConfigs(configs || []);
16
+ if (!builderConfigData)
17
17
  return null;
18
- const { config: webpack, version } = webpackData;
19
- const keys = Object.keys(webpack);
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" ? `webpack@${version}` : `webpack.config`,
49
+ name: version && version !== "unknown" ? `${name}@${version}` : `webpack.config`,
50
50
  theme: "monokai",
51
- src: selectKeys.length === 0 ? webpack : pick(webpack, selectKeys),
51
+ src: selectKeys.length === 0 ? config : pick(config, selectKeys),
52
52
  displayDataTypes: false,
53
53
  displayObjectSize: false
54
54
  }
@@ -1 +1 @@
1
- export * from './webpack';
1
+ export * from './builder';
@@ -1 +1 @@
1
- export * from "./webpack";
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 color = isDark ? "#fff" : "#000";
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
- __spreadValues({
16
+ {
30
17
  checkable: false,
31
18
  selectable: true,
32
19
  switcherIcon: ({ data, expanded }) => {
33
- if (data == null ? void 0 : data.children) {
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: { fontSize: 10, color }
27
+ style
40
28
  }
41
29
  ),
42
- expanded ? /* @__PURE__ */ jsx(FolderOpenOutlined, { style: { fontSize: 14, color } }) : /* @__PURE__ */ jsx(FolderOutlined, { style: { fontSize: 14, color } })
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
- }, props)
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 = __spreadValues({ width: labelWidth }, ls);
17
+ const labelStyle = { width: labelWidth, ...ls };
34
18
  const ref = useRef(null);
35
19
  let timer;
36
20
  useEffect(() => {