@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,44 +1,12 @@
|
|
|
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
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
1
|
import { jsx } from "react/jsx-runtime";
|
|
33
2
|
import { Typography } from "antd";
|
|
34
|
-
const Keyword = (
|
|
35
|
-
var _b = _a, { text, keyword } = _b, rest = __objRest(_b, ["text", "keyword"]);
|
|
3
|
+
const Keyword = ({ text, keyword, ...rest }) => {
|
|
36
4
|
if (!keyword) {
|
|
37
|
-
return /* @__PURE__ */ jsx(Typography.Text,
|
|
5
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: text });
|
|
38
6
|
}
|
|
39
7
|
const idx = text.indexOf(keyword);
|
|
40
8
|
if (idx === -1) {
|
|
41
|
-
return /* @__PURE__ */ jsx(Typography.Text,
|
|
9
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: text });
|
|
42
10
|
}
|
|
43
11
|
const els = [];
|
|
44
12
|
let str = text;
|
|
@@ -61,7 +29,7 @@ const Keyword = (_a) => {
|
|
|
61
29
|
break;
|
|
62
30
|
}
|
|
63
31
|
}
|
|
64
|
-
return /* @__PURE__ */ jsx(Typography.Text,
|
|
32
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: els });
|
|
65
33
|
};
|
|
66
34
|
export {
|
|
67
35
|
Keyword
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
import { OverlayAlertsWithButton } from "../Alerts";
|
|
10
10
|
import { BuilderSelect } from "./builder-select";
|
|
11
11
|
import { Menus } from "./menus";
|
|
12
|
-
import icon from "../../assets/icon.7509d763.svg";
|
|
13
12
|
import "./header.css";
|
|
14
13
|
const Header = () => {
|
|
15
14
|
const { i18n } = useI18n();
|
|
@@ -43,8 +42,8 @@ const Header = () => {
|
|
|
43
42
|
},
|
|
44
43
|
children: /* @__PURE__ */ jsxs(Row, { justify: "space-between", align: "middle", style: { height: Size.NavBarHeight }, wrap: false, children: [
|
|
45
44
|
/* @__PURE__ */ jsx(Col, { style: { height: Size.NavBarHeight, lineHeight: `${Size.NavBarHeight + 2}px` }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", height: "100%" }, children: [
|
|
46
|
-
/* @__PURE__ */ jsx("img", { style: { height: 30 }, src:
|
|
47
|
-
/* @__PURE__ */ jsx(Typography.Text, { style: { color: "inherit", fontSize: 18, marginLeft: 4 }, children: "Rsdoctor" }),
|
|
45
|
+
/* @__PURE__ */ jsx("img", { style: { height: 30 }, src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/logo/rsdoctor.png", className: "web-doctor-logo", alt: "logo" }),
|
|
46
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { color: "inherit", fontSize: 18, marginLeft: 4, marginTop: 8 }, children: "Rsdoctor" }),
|
|
48
47
|
/* @__PURE__ */ jsx(BuilderSelect, {})
|
|
49
48
|
] }) }),
|
|
50
49
|
/* @__PURE__ */ jsx(Col, { flex: 1, children: /* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { FloatButton, Layout as L } from "antd";
|
|
4
|
-
import { Size } from "../../constants";
|
|
4
|
+
import { MAIN_BG, Size } from "../../constants";
|
|
5
5
|
import { Header } from "./header";
|
|
6
6
|
import { useLocale, useI18n } from "../../utils";
|
|
7
7
|
import { Progress } from "./progress";
|
|
@@ -20,7 +20,7 @@ const Layout = (props) => {
|
|
|
20
20
|
/* @__PURE__ */ jsxs(
|
|
21
21
|
L.Content,
|
|
22
22
|
{
|
|
23
|
-
style: { height: "100%", minHeight: "100vh", padding: Size.BasePadding, marginTop: Size.NavBarHeight },
|
|
23
|
+
style: { height: "100%", minHeight: "100vh", padding: Size.BasePadding, marginTop: Size.NavBarHeight, background: MAIN_BG },
|
|
24
24
|
children: [
|
|
25
25
|
children,
|
|
26
26
|
/* @__PURE__ */ jsx(FloatButton.BackTop, {})
|
|
@@ -2,7 +2,7 @@ import { Manifest } from '@rsdoctor/types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Menus: React.FC<Omit<{
|
|
4
4
|
style?: React.CSSProperties | undefined;
|
|
5
|
-
routes: Manifest.
|
|
5
|
+
routes: Manifest.RsdoctorManifestClientRoutes[];
|
|
6
6
|
}, "routes"> & Partial<{
|
|
7
7
|
body?: any;
|
|
8
8
|
}>>;
|
|
@@ -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 {
|
|
22
3
|
ApiOutlined,
|
|
@@ -47,13 +28,14 @@ const MenusBase = (props) => {
|
|
|
47
28
|
const iconStyle = {
|
|
48
29
|
fontSize: 16
|
|
49
30
|
};
|
|
50
|
-
const customIconStyle =
|
|
31
|
+
const customIconStyle = {
|
|
32
|
+
...iconStyle,
|
|
51
33
|
transform: "translateY(-2px)"
|
|
52
|
-
}
|
|
34
|
+
};
|
|
53
35
|
const items = [];
|
|
54
36
|
const { xxl } = Grid.useBreakpoint();
|
|
55
37
|
console.log("enableRoutes: ", enableRoutes);
|
|
56
|
-
if (includes(enableRoutes, Manifest.
|
|
38
|
+
if (includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.Overall)) {
|
|
57
39
|
items.push({
|
|
58
40
|
label: t(OverallConstants.name),
|
|
59
41
|
key: OverallConstants.route,
|
|
@@ -70,10 +52,10 @@ const MenusBase = (props) => {
|
|
|
70
52
|
key: CompileName,
|
|
71
53
|
icon: /* @__PURE__ */ jsx(ToolOutlined, { style: iconStyle }),
|
|
72
54
|
children: [
|
|
73
|
-
includes(enableRoutes, Manifest.
|
|
55
|
+
includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.WebpackLoaders) && {
|
|
74
56
|
label: /* @__PURE__ */ jsx(Typography.Text, { style: { marginRight: 8 }, children: t(LoaderFiles.name) }),
|
|
75
57
|
key: LoaderFiles.route,
|
|
76
|
-
icon: /* @__PURE__ */ jsx("img", { src: WebpackIcon, alt: "", style:
|
|
58
|
+
icon: /* @__PURE__ */ jsx("img", { src: WebpackIcon, alt: "", style: { ...iconStyle, width: 16 } }),
|
|
77
59
|
children: [
|
|
78
60
|
{
|
|
79
61
|
label: t(LoaderTimeline.name),
|
|
@@ -87,12 +69,12 @@ const MenusBase = (props) => {
|
|
|
87
69
|
}
|
|
88
70
|
]
|
|
89
71
|
},
|
|
90
|
-
includes(enableRoutes, Manifest.
|
|
72
|
+
includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.ModuleResolve) && {
|
|
91
73
|
label: t(ModuleResolve.name),
|
|
92
74
|
key: ModuleResolve.route,
|
|
93
75
|
icon: /* @__PURE__ */ jsx(NodeIndexOutlined, { style: iconStyle })
|
|
94
76
|
},
|
|
95
|
-
includes(enableRoutes, Manifest.
|
|
77
|
+
includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.WebpackPlugins) && {
|
|
96
78
|
label: t(PluginsAnalyze.name),
|
|
97
79
|
key: PluginsAnalyze.route,
|
|
98
80
|
icon: /* @__PURE__ */ jsx(ApiOutlined, { style: iconStyle })
|
|
@@ -106,17 +88,11 @@ const MenusBase = (props) => {
|
|
|
106
88
|
key: BundleSize.name,
|
|
107
89
|
icon: /* @__PURE__ */ jsx("span", { style: customIconStyle, children: "📦" }),
|
|
108
90
|
children: [
|
|
109
|
-
includes(enableRoutes, Manifest.
|
|
91
|
+
includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.BundleSize) && {
|
|
110
92
|
label: t(BundleSize.name),
|
|
111
93
|
key: BundleSize.route,
|
|
112
94
|
icon: /* @__PURE__ */ jsx(FolderViewOutlined, { style: iconStyle })
|
|
113
95
|
}
|
|
114
|
-
// TODO: Tree shaking menu
|
|
115
|
-
// includes(enableRoutes, Manifest.DoctorManifestClientRoutes.TreeShaking) && {
|
|
116
|
-
// label: t(TreeShakingConstants.name),
|
|
117
|
-
// key: TreeShakingConstants.route,
|
|
118
|
-
// icon: <ShakeOutlined style={iconStyle} />,
|
|
119
|
-
// },
|
|
120
96
|
].filter((e) => Boolean(e))
|
|
121
97
|
});
|
|
122
98
|
}
|
|
@@ -131,12 +107,12 @@ const MenusBase = (props) => {
|
|
|
131
107
|
}
|
|
132
108
|
},
|
|
133
109
|
overflowedIndicator: /* @__PURE__ */ jsx(MenuOutlined, {}),
|
|
134
|
-
style:
|
|
110
|
+
style: { height: Size.NavBarHeight, lineHeight: `${Size.NavBarHeight}px`, ...props.style },
|
|
135
111
|
selectedKeys: [pathname === "/" ? OverallConstants.route : pathname]
|
|
136
112
|
},
|
|
137
113
|
enableRoutes.join("")
|
|
138
114
|
);
|
|
139
|
-
if (items.length <=
|
|
115
|
+
if (items.length <= 3) {
|
|
140
116
|
return /* @__PURE__ */ jsx(Col, { children: MenuComponent });
|
|
141
117
|
}
|
|
142
118
|
if (xxl) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo, useState } from "react";
|
|
2
|
+
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { endsWith, get, sumBy } from "lodash-es";
|
|
4
4
|
import { Card, Col, Descriptions, Divider, Drawer, Row, Space, Table, Tooltip, Typography } from "antd";
|
|
5
5
|
import { CloseCircleOutlined } from "@ant-design/icons";
|
|
6
6
|
import { Constants, SDK } from "@rsdoctor/types";
|
|
7
7
|
import { ServerAPIProvider } from "../../Manifest";
|
|
8
8
|
import { drawerWidth, Size } from "../../../constants";
|
|
9
|
-
import { createFileStructures, formatCosts, mapFileKey, filterLoader } from "../../../utils";
|
|
9
|
+
import { createFileStructures, formatCosts, mapFileKey, filterLoader, useMonacoEditor } from "../../../utils";
|
|
10
10
|
import { LoaderExecutions } from "../executions";
|
|
11
11
|
import { FileTree } from "../../FileTree";
|
|
12
12
|
import { Keyword } from "../../Keyword";
|
|
@@ -17,6 +17,11 @@ const LoaderFiles = (props) => {
|
|
|
17
17
|
const [resourcePath, setResourcePath] = useState("");
|
|
18
18
|
const [loaderIndex, setLoaderIndex] = useState(0);
|
|
19
19
|
const [selectedNode, setSelectedNode] = useState(null);
|
|
20
|
+
const monacoRef = useRef(null);
|
|
21
|
+
const { initMonaco } = useMonacoEditor();
|
|
22
|
+
const init = useCallback(async () => {
|
|
23
|
+
await initMonaco(monacoRef);
|
|
24
|
+
}, []);
|
|
20
25
|
const maxHeight = 700;
|
|
21
26
|
const filteredFiles = useMemo(
|
|
22
27
|
() => filetree.filter((e) => e.loaders.some((l) => filterLoader(e.path, l.loader, props.filename, props.loaders))),
|
|
@@ -100,6 +105,7 @@ const LoaderFiles = (props) => {
|
|
|
100
105
|
}),
|
|
101
106
|
treeData: files,
|
|
102
107
|
onSelect: (_e, info) => {
|
|
108
|
+
init();
|
|
103
109
|
if (!info.node.isLeaf) {
|
|
104
110
|
setSelectedNode(info.node);
|
|
105
111
|
}
|
|
@@ -1,65 +1,31 @@
|
|
|
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
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
2
|
import { ClockCircleOutlined } from "@ant-design/icons";
|
|
34
|
-
import { Row, Space, Badge, Col, Typography, Button, Divider, Timeline, Tooltip, Empty, Tag } from "antd";
|
|
35
|
-
import { useState } from "react";
|
|
36
|
-
import { Constants } from "@rsdoctor/types";
|
|
37
3
|
import Editor from "@monaco-editor/react";
|
|
4
|
+
import { Constants } from "@rsdoctor/types";
|
|
5
|
+
import { Badge, Button, Col, Divider, Empty, Row, Space, Tag, Timeline, Tooltip, Typography } from "antd";
|
|
38
6
|
import dayjs from "dayjs";
|
|
39
7
|
import { endsWith } from "lodash-es";
|
|
40
|
-
import {
|
|
41
|
-
import { Title } from "../Title";
|
|
8
|
+
import { useState } from "react";
|
|
42
9
|
import { Size } from "../../constants";
|
|
43
|
-
import {
|
|
10
|
+
import { beautifyPath, formatCosts, getModifiedLanguage, useTheme } from "../../utils";
|
|
11
|
+
import { Card } from "../Card";
|
|
44
12
|
import { DiffViewer } from "../CodeViewer";
|
|
13
|
+
import { CodeOpener } from "../Opener";
|
|
14
|
+
import { Title } from "../Title";
|
|
45
15
|
import { JSIsEqualTag } from "../worker/jsequal/client";
|
|
46
|
-
const LoaderInfoItem = (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"label",
|
|
53
|
-
"value",
|
|
54
|
-
"ellipsis"
|
|
55
|
-
]);
|
|
16
|
+
const LoaderInfoItem = ({
|
|
17
|
+
label,
|
|
18
|
+
value,
|
|
19
|
+
ellipsis = false,
|
|
20
|
+
...textProps
|
|
21
|
+
}) => {
|
|
56
22
|
return /* @__PURE__ */ jsxs(Row, { children: [
|
|
57
23
|
/* @__PURE__ */ jsx(Col, { span: 6, children: /* @__PURE__ */ jsxs(Space, { children: [
|
|
58
24
|
/* @__PURE__ */ jsx(Badge, { status: "processing" }),
|
|
59
25
|
/* @__PURE__ */ jsx("div", { style: { width: 180 }, children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: label }) }),
|
|
60
26
|
/* @__PURE__ */ jsx(Divider, { type: "vertical" })
|
|
61
27
|
] }) }),
|
|
62
|
-
/* @__PURE__ */ jsx(Col, { span: 18, children: /* @__PURE__ */ jsx(Typography.Paragraph,
|
|
28
|
+
/* @__PURE__ */ jsx(Col, { span: 18, children: /* @__PURE__ */ jsx(Typography.Paragraph, { ellipsis, strong: true, ...textProps, children: value }) })
|
|
63
29
|
] });
|
|
64
30
|
};
|
|
65
31
|
const LoaderExecutions = ({ data, cwd, index }) => {
|
|
@@ -113,42 +79,48 @@ const LoaderExecutions = ({ data, cwd, index }) => {
|
|
|
113
79
|
}
|
|
114
80
|
),
|
|
115
81
|
/* @__PURE__ */ jsxs(Col, { span: 24 - leftSpan, style: { height: "100%" }, children: [
|
|
116
|
-
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsxs(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
82
|
+
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsxs(
|
|
83
|
+
Card,
|
|
84
|
+
{
|
|
85
|
+
title: "Loader Details",
|
|
86
|
+
style: { border: "none" },
|
|
87
|
+
collapsable: true,
|
|
88
|
+
defaultCollapsed: true,
|
|
89
|
+
extra: /* @__PURE__ */ jsx(Tag, { icon: /* @__PURE__ */ jsx(ClockCircleOutlined, {}), color: "default", children: dayjs(loader.startAt).format("YYYY-MM-DD HH:mm:ss") }),
|
|
90
|
+
children: [
|
|
120
91
|
loader.isPitch ? /* @__PURE__ */ jsx(Typography.Text, { code: true, children: "pitch" }) : null,
|
|
121
|
-
loader.isPitch || hasError || !endsWith(resource.path, Constants.JSExtension) ? null : /* @__PURE__ */ jsx(JSIsEqualTag, { input: before, output: loader.result || "" })
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
92
|
+
loader.isPitch || hasError || !endsWith(resource.path, Constants.JSExtension) ? null : /* @__PURE__ */ jsx(JSIsEqualTag, { input: before, output: loader.result || "" }),
|
|
93
|
+
/* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { padding: Size.BasePadding, wordBreak: "break-all" }, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "file path", value: beautifyPath(resource.path, cwd), code: true }),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
LoaderInfoItem,
|
|
97
|
+
{
|
|
98
|
+
label: "resource path",
|
|
99
|
+
value: /* @__PURE__ */ jsx(CodeOpener, { cwd, url: resource.path, loc: "", disabled: true })
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "resource query", value: resource.queryRaw || "-" }),
|
|
103
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "duration", value: formatCosts(loader.costs), mark: true }),
|
|
104
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "loader name", value: loader.loader, code: true }),
|
|
105
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "loader index", value: `${loader.loaderIndex}` }),
|
|
106
|
+
/* @__PURE__ */ jsx(LoaderInfoItem, { label: "loader path", value: /* @__PURE__ */ jsx(CodeOpener, { cwd, url: loader.path, loc: "", disabled: true }) }),
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
LoaderInfoItem,
|
|
109
|
+
{
|
|
110
|
+
label: "options",
|
|
111
|
+
value: JSON.stringify(loader.options || "-"),
|
|
112
|
+
copyable: true,
|
|
113
|
+
ellipsis: {
|
|
114
|
+
rows: 2,
|
|
115
|
+
expandable: true,
|
|
116
|
+
symbol: "more"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] })
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
) }),
|
|
152
124
|
hasError ? /* @__PURE__ */ jsxs(Col, { span: 24, style: { height: "53%", minHeight: 400 }, children: [
|
|
153
125
|
/* @__PURE__ */ jsx(
|
|
154
126
|
"div",
|
|
@@ -192,7 +164,13 @@ const LoaderExecutions = ({ data, cwd, index }) => {
|
|
|
192
164
|
Editor,
|
|
193
165
|
{
|
|
194
166
|
theme: "vs-dark",
|
|
195
|
-
options: {
|
|
167
|
+
options: {
|
|
168
|
+
readOnly: true,
|
|
169
|
+
domReadOnly: true,
|
|
170
|
+
fontSize: 14,
|
|
171
|
+
formatOnType: true,
|
|
172
|
+
formatOnPaste: true
|
|
173
|
+
},
|
|
196
174
|
value: loader.result,
|
|
197
175
|
language: getModifiedLanguage(resource.path)
|
|
198
176
|
}
|
|
@@ -6,7 +6,7 @@ export type InferServerAPIBody<T> = SDK.ServerAPI.InferRequestBodyType<T> extend
|
|
|
6
6
|
body: SDK.ServerAPI.InferRequestBodyType<T>;
|
|
7
7
|
};
|
|
8
8
|
type ServerAPIProviderProps<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends> = {
|
|
9
|
-
manifestLoader?: () => Promise<Manifest.
|
|
9
|
+
manifestLoader?: () => Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
10
10
|
api: T;
|
|
11
11
|
children: (response: SDK.ServerAPI.InferResponseType<T>) => JSX.Element;
|
|
12
12
|
fallbackComponent?: React.FC;
|
|
@@ -1,34 +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
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
1
|
import { jsx } from "react/jsx-runtime";
|
|
33
2
|
import { SDK } from "@rsdoctor/types";
|
|
34
3
|
import { Skeleton, Spin } from "antd";
|
|
@@ -139,14 +108,15 @@ function withServerAPI({
|
|
|
139
108
|
showSkeleton
|
|
140
109
|
}) {
|
|
141
110
|
return function _(props) {
|
|
142
|
-
const
|
|
111
|
+
const { body = bodyInRoot, ...rest } = props;
|
|
143
112
|
return (
|
|
144
113
|
// @ts-ignore
|
|
145
114
|
/* @__PURE__ */ jsx(ServerAPIProvider, { api, body, showSkeleton, fallbackComponent, children: (res) => {
|
|
146
|
-
const _props =
|
|
115
|
+
const _props = {
|
|
116
|
+
...rest,
|
|
147
117
|
[responsePropName]: res
|
|
148
|
-
}
|
|
149
|
-
return /* @__PURE__ */ jsx(Component,
|
|
118
|
+
};
|
|
119
|
+
return /* @__PURE__ */ jsx(Component, { ..._props });
|
|
150
120
|
} })
|
|
151
121
|
);
|
|
152
122
|
};
|
|
@@ -4,5 +4,5 @@ type ExtractAlias<T> = T extends [property: string, alias: infer P][] ? `${P ext
|
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
6
6
|
*/
|
|
7
|
-
export declare function ConnectManifestData<Props extends object, Keys extends [property: `${Manifest.
|
|
7
|
+
export declare function ConnectManifestData<Props extends object, Keys extends [property: `${Manifest.RsdoctorManifestMappingKeys}`, alias: keyof Props][] | [property: string, alias: keyof Props][]>(manifestLoader: () => Promise<Manifest.RsdoctorManifestWithShardingFiles>, keys: Keys, Component: React.FC<Props>): React.FC<Omit<Props, ExtractAlias<Keys>>>;
|
|
8
8
|
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 } from "react/jsx-runtime";
|
|
18
2
|
import { Skeleton } from "antd";
|
|
19
3
|
import { useEffect, useState } from "react";
|
|
@@ -73,7 +57,7 @@ function ConnectManifestData(manifestLoader, keys, Component) {
|
|
|
73
57
|
}
|
|
74
58
|
);
|
|
75
59
|
}
|
|
76
|
-
return /* @__PURE__ */ jsx(Component,
|
|
60
|
+
return /* @__PURE__ */ jsx(Component, { ...props });
|
|
77
61
|
};
|
|
78
62
|
}
|
|
79
63
|
export {
|