@rsdoctor/components 0.1.1 → 0.1.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.d.ts +2 -2
- package/dist/components/Alert/file-relation.d.ts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Alert/link.d.ts +1 -1
- package/dist/components/Alert/package-relation.d.ts +9 -9
- package/dist/components/Alert/package-relation.js +188 -94
- package/dist/components/Alert/types.d.ts +15 -15
- package/dist/components/Alert/view.d.ts +1 -1
- package/dist/components/Alerts/bundle.d.ts +4 -4
- package/dist/components/Alerts/common.d.ts +8 -8
- package/dist/components/Alerts/common.js +46 -23
- package/dist/components/Alerts/compile.d.ts +4 -4
- package/dist/components/Alerts/index.d.ts +1 -1
- package/dist/components/Alerts/overlay.d.ts +12 -12
- package/dist/components/Badge/index.d.ts +13 -13
- package/dist/components/Card/diff.d.ts +11 -11
- package/dist/components/Card/index.d.ts +4 -4
- package/dist/components/Card/size.d.ts +16 -16
- package/dist/components/Card/statistic.d.ts +7 -7
- package/dist/components/Charts/TimelineCharts/index.d.ts +5 -5
- package/dist/components/Charts/TimelineCharts/index.js +31 -9
- package/dist/components/Charts/bootstrap.d.ts +1 -1
- package/dist/components/Charts/common.d.ts +4 -4
- package/dist/components/Charts/constants.d.ts +2 -0
- package/dist/components/Charts/constants.js +46 -0
- package/dist/components/Charts/done.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +4 -4
- package/dist/components/Charts/loader.d.ts +1 -1
- package/dist/components/Charts/loader.js +55 -26
- package/dist/components/Charts/minify.d.ts +1 -1
- package/dist/components/Charts/types.d.ts +45 -45
- package/dist/components/Charts/utils.d.ts +5 -4
- package/dist/components/Charts/utils.js +32 -13
- package/dist/components/CodeViewer/config.d.ts +1 -1
- package/dist/components/CodeViewer/diff.d.ts +6 -6
- package/dist/components/CodeViewer/hightlight.d.ts +5 -5
- package/dist/components/CodeViewer/index.d.ts +1 -1
- package/dist/components/CodeViewer/viewer.d.ts +6 -6
- package/dist/components/Configuration/builder.d.ts +6 -6
- package/dist/components/Configuration/index.d.ts +1 -1
- package/dist/components/FileTree/index.d.ts +1 -1
- package/dist/components/Form/keyword.d.ts +10 -10
- package/dist/components/Keyword/index.d.ts +3 -3
- package/dist/components/Layout/builder-select.d.ts +1 -1
- package/dist/components/Layout/constants.d.ts +1 -1
- package/dist/components/Layout/header.d.ts +1 -1
- package/dist/components/Layout/index.d.ts +2 -2
- package/dist/components/Layout/menus.d.ts +4 -4
- package/dist/components/Layout/menus.js +42 -14
- package/dist/components/Layout/progress.d.ts +3 -3
- package/dist/components/Loader/Analysis/files.d.ts +5 -5
- package/dist/components/Loader/Analysis/index.d.ts +6 -6
- package/dist/components/Loader/executions.d.ts +5 -9
- package/dist/components/Manifest/api.d.ts +14 -21
- package/dist/components/Manifest/data.d.ts +1 -1
- package/dist/components/Manifest/index.d.ts +1 -1
- package/dist/components/Opener/code.d.ts +17 -25
- package/dist/components/Opener/index.d.ts +1 -1
- package/dist/components/Opener/vscode.d.ts +7 -12
- package/dist/components/Overall/NumberButton.d.ts +6 -12
- package/dist/components/Overall/bundle.d.ts +3 -3
- package/dist/components/Overall/compile.d.ts +2 -2
- package/dist/components/Overall/index.d.ts +1 -1
- package/dist/components/Overall/project.d.ts +5 -5
- package/dist/components/Plugins/webpack.d.ts +9 -9
- package/dist/components/Resolver/analysis.d.ts +7 -7
- package/dist/components/Select/index.d.ts +9 -9
- package/dist/components/Status/failed.d.ts +4 -4
- package/dist/components/Status/index.d.ts +1 -1
- package/dist/components/TextDrawer/duplicate.d.ts +7 -7
- package/dist/components/TextDrawer/index.d.ts +6 -6
- package/dist/components/Title/index.d.ts +11 -11
- package/dist/components/index.d.ts +1 -1
- package/dist/components/worker/ecmaversion/client.d.ts +4 -4
- package/dist/components/worker/ecmaversion/worker.d.ts +1 -1
- package/dist/components/worker/jsequal/client.d.ts +6 -6
- package/dist/components/worker/jsequal/worker.d.ts +1 -1
- package/dist/config.d.ts +13 -13
- package/dist/constants.d.ts +30 -30
- package/dist/index.d.ts +1 -1
- package/dist/pages/BundleSize/components/asset.d.ts +15 -15
- package/dist/pages/BundleSize/components/cards.d.ts +4 -4
- package/dist/pages/BundleSize/components/editor.d.ts +3 -3
- package/dist/pages/BundleSize/components/index.d.ts +7 -7
- package/dist/pages/BundleSize/config.d.ts +3 -3
- package/dist/pages/BundleSize/constants.d.ts +1 -1
- package/dist/pages/BundleSize/index.d.ts +1 -1
- package/dist/pages/ModuleAnalyze/chunks.d.ts +2 -2
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +9 -9
- package/dist/pages/ModuleAnalyze/constants.d.ts +2 -2
- package/dist/pages/ModuleAnalyze/dependncy.d.ts +4 -4
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +6 -6
- package/dist/pages/ModuleAnalyze/index.d.ts +4 -4
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +16 -16
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +1 -1
- package/dist/pages/ModuleResolve/constants.d.ts +1 -1
- package/dist/pages/ModuleResolve/index.d.ts +1 -1
- package/dist/pages/Overall/constants.d.ts +1 -1
- package/dist/pages/Overall/index.d.ts +4 -4
- package/dist/pages/Overall/index.js +19 -8
- package/dist/pages/Overall/responsiveGridList.d.ts +6 -0
- package/dist/pages/Overall/responsiveGridList.js +28 -0
- package/dist/pages/Resources/RuleIndex/constants.d.ts +1 -1
- package/dist/pages/Resources/RuleIndex/index.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +1 -1
- package/dist/pages/WebpackLoaders/constants.d.ts +1 -1
- package/dist/pages/WebpackPlugins/constants.d.ts +1 -1
- package/dist/pages/WebpackPlugins/index.d.ts +1 -1
- package/dist/pages/index.d.ts +1 -1
- package/dist/utils/data/base.d.ts +21 -21
- package/dist/utils/data/index.d.ts +2 -2
- package/dist/utils/data/local.d.ts +11 -11
- package/dist/utils/data/remote.d.ts +7 -7
- package/dist/utils/file.d.ts +15 -21
- package/dist/utils/hooks.d.ts +4 -4
- package/dist/utils/i18n/cn.d.ts +1 -1
- package/dist/utils/i18n/en.d.ts +28 -28
- package/dist/utils/i18n/index.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/loader.d.ts +1 -1
- package/dist/utils/locale.d.ts +1 -1
- package/dist/utils/manifest.d.ts +17 -17
- package/dist/utils/monaco.d.ts +4 -4
- package/dist/utils/request.d.ts +13 -13
- package/dist/utils/routes.d.ts +1 -1
- package/dist/utils/size.d.ts +1 -1
- package/dist/utils/socket.d.ts +1 -1
- package/dist/utils/storage.d.ts +1 -1
- package/dist/utils/string.d.ts +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/url.d.ts +1 -1
- package/dist/utils/worker/index.d.ts +1 -1
- package/dist/utils/worker/master.d.ts +3 -3
- package/dist/utils/worker/types.d.ts +3 -3
- package/dist/utils/worker/utils.d.ts +4 -6
- package/dist/utils/worker/worker.d.ts +11 -11
- package/package.json +4 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CodeChangeAlertProps } from './types';
|
|
3
3
|
interface FixedProps {
|
|
4
|
-
|
|
4
|
+
setIsFixed(val: boolean): void;
|
|
5
5
|
}
|
|
6
6
|
export declare const CodeChangeDrawerContent: React.FC<CodeChangeAlertProps & FixedProps>;
|
|
7
7
|
export declare const CodeChangeAlert: React.FC<CodeChangeAlertProps>;
|
|
8
|
-
export {};
|
|
8
|
+
export {};
|
|
@@ -2,16 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import { SDK } from '@rsdoctor/types';
|
|
3
3
|
import { PackageRelationAlertProps } from './types';
|
|
4
4
|
export declare const PackageRelationReasons: React.FC<{
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
|
|
6
|
+
cwd: string;
|
|
7
7
|
}>;
|
|
8
8
|
export declare const PackageRelationReasonsWithServer: React.FC<Omit<{
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
|
|
10
|
+
cwd: string;
|
|
11
11
|
}, "data"> & Partial<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
body: {
|
|
13
|
+
id: string | number;
|
|
14
|
+
target: SDK.PackageBasicData;
|
|
15
|
+
};
|
|
16
16
|
}>>;
|
|
17
|
-
export declare const PackageRelationAlert: React.FC<PackageRelationAlertProps>;
|
|
17
|
+
export declare const PackageRelationAlert: React.FC<PackageRelationAlertProps>;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import React, { useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Space,
|
|
6
|
+
Alert,
|
|
7
|
+
Button,
|
|
8
|
+
Typography,
|
|
9
|
+
Divider,
|
|
10
|
+
Tabs,
|
|
11
|
+
Row,
|
|
12
|
+
Col,
|
|
13
|
+
Timeline,
|
|
14
|
+
Card,
|
|
15
|
+
Tag,
|
|
16
|
+
Empty,
|
|
17
|
+
Popover,
|
|
18
|
+
Grid
|
|
19
|
+
} from "antd";
|
|
5
20
|
import { sumBy } from "lodash-es";
|
|
6
21
|
import { Rule, SDK } from "@rsdoctor/types";
|
|
7
22
|
import { ExpandAltOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
|
8
|
-
import { useRuleIndexNavigate, formatSize, useI18n
|
|
23
|
+
import { useRuleIndexNavigate, formatSize, useI18n } from "../../utils";
|
|
9
24
|
import { TextDrawer } from "../TextDrawer";
|
|
10
25
|
import { Title } from "../Title";
|
|
11
26
|
import { Size, Color } from "../../constants";
|
|
@@ -21,7 +36,13 @@ const PackageRelationReasons = ({ data, cwd }) => {
|
|
|
21
36
|
{
|
|
22
37
|
title: `The reasons for importing this version`,
|
|
23
38
|
style: { height: "100%" },
|
|
24
|
-
extra: /* @__PURE__ */ jsx(
|
|
39
|
+
extra: /* @__PURE__ */ jsx(
|
|
40
|
+
Popover,
|
|
41
|
+
{
|
|
42
|
+
content: /* @__PURE__ */ jsx(Typography.Text, { children: t("DuplicatePakCodeExplain") }),
|
|
43
|
+
children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
|
|
44
|
+
}
|
|
45
|
+
),
|
|
25
46
|
bodyStyle: { overflow: "scroll" },
|
|
26
47
|
children: data.length ? /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
27
48
|
/* @__PURE__ */ jsx("div", { style: { marginBottom: Size.BasePadding }, children: /* @__PURE__ */ jsx(Typography.Text, { type: "secondary", strong: true, children: "Click the file path below to show the reason in code viewer." }) }),
|
|
@@ -45,7 +66,10 @@ const PackageRelationReasons = ({ data, cwd }) => {
|
|
|
45
66
|
setIndex(i);
|
|
46
67
|
},
|
|
47
68
|
strong: i === index,
|
|
48
|
-
style: {
|
|
69
|
+
style: {
|
|
70
|
+
color: i === index ? Color.Blue : "inherit",
|
|
71
|
+
display: "block"
|
|
72
|
+
},
|
|
49
73
|
children: text
|
|
50
74
|
}
|
|
51
75
|
)
|
|
@@ -72,110 +96,180 @@ const PackageRelationAlert = ({
|
|
|
72
96
|
const navigate = useRuleIndexNavigate(code, data.link);
|
|
73
97
|
const totalSize = sumBy(packages, (e) => e.targetSize.sourceSize);
|
|
74
98
|
const totalSizeStr = formatSize(totalSize);
|
|
75
|
-
const
|
|
99
|
+
const { xs, lg, xxl } = Grid.useBreakpoint();
|
|
76
100
|
const { name } = packages.find((e) => !!e.target.name).target;
|
|
77
101
|
const versions = packages.map((item) => item.target.version);
|
|
78
102
|
return /* @__PURE__ */ jsx(
|
|
79
103
|
Alert,
|
|
80
104
|
{
|
|
81
|
-
showIcon:
|
|
82
|
-
message: /* @__PURE__ */ jsxs(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
showIcon: !xs,
|
|
106
|
+
message: /* @__PURE__ */ jsxs(
|
|
107
|
+
Space,
|
|
108
|
+
{
|
|
109
|
+
wrap: true,
|
|
110
|
+
split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
111
|
+
align: "center",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(Space, { wrap: false, children: [
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
Typography.Text,
|
|
116
|
+
{
|
|
117
|
+
code: true,
|
|
118
|
+
strong: true,
|
|
119
|
+
onClick: navigate,
|
|
120
|
+
style: { cursor: "pointer" },
|
|
121
|
+
children: /* @__PURE__ */ jsx("a", { children: code })
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[code]?.title || data.title })
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ jsxs(
|
|
127
|
+
Typography.Paragraph,
|
|
128
|
+
{
|
|
129
|
+
ellipsis: { rows: 1 },
|
|
130
|
+
style: { marginBottom: 0 },
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: name }),
|
|
133
|
+
/* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
|
|
134
|
+
" ",
|
|
135
|
+
data.packages.length
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: " versions was found" })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
Bdg,
|
|
143
|
+
{
|
|
144
|
+
label: "total size",
|
|
145
|
+
value: totalSizeStr,
|
|
146
|
+
type: "error",
|
|
147
|
+
tooltip: `total size of ${data.packages.length} versions is ${totalSizeStr}`
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
),
|
|
105
153
|
description: /* @__PURE__ */ jsx(Space, { direction: "vertical", wrap: false, children: data.packages.map(({ target: el, targetSize: size }) => {
|
|
106
154
|
const sizeStr = formatSize(size.sourceSize);
|
|
107
155
|
const parsedSizeStr = size.parsedSize ? formatSize(size.parsedSize) : null;
|
|
108
156
|
const name2 = `${el.name}@${el.version}`;
|
|
109
|
-
return /* @__PURE__ */ jsxs(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
157
|
+
return /* @__PURE__ */ jsxs(
|
|
158
|
+
Space,
|
|
159
|
+
{
|
|
160
|
+
style: { wordBreak: "break-all" },
|
|
161
|
+
align: "center",
|
|
162
|
+
split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
163
|
+
wrap: true,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsxs(Space, { wrap: false, children: [
|
|
166
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { marginLeft: 4 }, children: "└" }),
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
Bdg,
|
|
169
|
+
{
|
|
170
|
+
label: el.name,
|
|
171
|
+
value: `v${el.version}`,
|
|
172
|
+
tooltip: name2
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
Bdg,
|
|
179
|
+
{
|
|
180
|
+
label: /* @__PURE__ */ jsxs("div", { color: "rgb(255, 255, 255)", children: [
|
|
181
|
+
"Source Size ",
|
|
182
|
+
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
183
|
+
] }),
|
|
184
|
+
value: sizeStr,
|
|
185
|
+
tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is source size.`,
|
|
186
|
+
type: "error"
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
Bdg,
|
|
191
|
+
{
|
|
192
|
+
label: "Bundled size",
|
|
193
|
+
value: parsedSizeStr || "CONCATENATED",
|
|
194
|
+
tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is after bundled, concatenated module cannot get bundled size. `,
|
|
195
|
+
type: "error"
|
|
196
|
+
}
|
|
197
|
+
)
|
|
119
198
|
] }),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
children: el.root
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
] }, el.version);
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
Typography.Paragraph,
|
|
201
|
+
{
|
|
202
|
+
style: {
|
|
203
|
+
marginBottom: 0,
|
|
204
|
+
width: xxl ? "40rem" : lg ? "30rem" : "20rem"
|
|
205
|
+
},
|
|
206
|
+
copyable: { text: el.root },
|
|
207
|
+
ellipsis: {
|
|
208
|
+
rows: 1,
|
|
209
|
+
expandable: true,
|
|
210
|
+
symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}),
|
|
211
|
+
tooltip: el.root
|
|
212
|
+
},
|
|
213
|
+
code: true,
|
|
214
|
+
children: el.root
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
el.version
|
|
220
|
+
);
|
|
146
221
|
}) }),
|
|
147
222
|
type: level === "warn" ? "info" : level,
|
|
148
223
|
action: /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
149
|
-
packages && packages.length > 0 ? /* @__PURE__ */ jsx(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
224
|
+
packages && packages.length > 0 ? /* @__PURE__ */ jsx(
|
|
225
|
+
TextDrawer,
|
|
226
|
+
{
|
|
227
|
+
text: "Show Relations",
|
|
228
|
+
buttonProps: { size: "small" },
|
|
229
|
+
drawerProps: { title: data.title },
|
|
230
|
+
children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
|
|
231
|
+
/* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
|
|
232
|
+
/* @__PURE__ */ jsx(Title, { text: name, upperFisrt: false }),
|
|
233
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: versions.length }),
|
|
234
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: " versions was found: " }),
|
|
235
|
+
versions.map((e) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: e }, e))
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
Tabs,
|
|
239
|
+
{
|
|
240
|
+
type: "card",
|
|
241
|
+
size: "middle",
|
|
242
|
+
className: "tabs-space",
|
|
243
|
+
defaultActiveKey: versions[0],
|
|
244
|
+
items: packages.map((pkg) => {
|
|
245
|
+
const { target, targetSize } = pkg;
|
|
246
|
+
return {
|
|
247
|
+
label: /* @__PURE__ */ jsxs(Space, { children: [
|
|
248
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: `${name}@${target.version}` }),
|
|
249
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Red, children: formatSize(targetSize.sourceSize) })
|
|
250
|
+
] }),
|
|
251
|
+
key: `${target.root}${target.name}${target.version}`,
|
|
252
|
+
children: getPackageRelationContentComponent({
|
|
253
|
+
data,
|
|
254
|
+
package: pkg
|
|
255
|
+
})
|
|
256
|
+
};
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] })
|
|
261
|
+
}
|
|
262
|
+
) : null,
|
|
177
263
|
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
178
|
-
/* @__PURE__ */ jsx(
|
|
264
|
+
/* @__PURE__ */ jsx(
|
|
265
|
+
Button,
|
|
266
|
+
{
|
|
267
|
+
type: "link",
|
|
268
|
+
onClick: navigate,
|
|
269
|
+
size: "small",
|
|
270
|
+
icon: /* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
271
|
+
}
|
|
272
|
+
)
|
|
179
273
|
] })
|
|
180
274
|
}
|
|
181
275
|
);
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { Rule } from '@rsdoctor/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface AlertProps extends Omit<PackageRelationAlertProps, 'data'> {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
data: Rule.RuleStoreDataItem;
|
|
5
|
+
cwd: string;
|
|
6
6
|
}
|
|
7
7
|
export interface PackageRelationAlertProps {
|
|
8
|
-
data: Rule.PackageRelationDiffRuleStoreData;
|
|
9
|
-
getPackageRelationContentComponent: React.FC<{
|
|
10
8
|
data: Rule.PackageRelationDiffRuleStoreData;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
getPackageRelationContentComponent: React.FC<{
|
|
10
|
+
data: Rule.PackageRelationDiffRuleStoreData;
|
|
11
|
+
package: Rule.PackageRelationData;
|
|
12
|
+
}>;
|
|
13
|
+
cwd: string;
|
|
14
14
|
}
|
|
15
15
|
export interface FileRelationAlertProps {
|
|
16
|
-
|
|
16
|
+
data: Rule.FileRelationRuleStoreData;
|
|
17
17
|
}
|
|
18
18
|
export interface CodeChangeAlertProps {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
data: Rule.CodeChangeRuleStoreData;
|
|
20
|
+
cwd: string;
|
|
21
21
|
}
|
|
22
22
|
export interface CodeViewAlertProps {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
data: Rule.CodeViewRuleStoreData;
|
|
24
|
+
cwd: string;
|
|
25
25
|
}
|
|
26
26
|
export interface LinkAlertProps {
|
|
27
|
-
|
|
27
|
+
data: Rule.LinkRuleStoreData;
|
|
28
28
|
}
|
|
29
29
|
export interface EMOAlertProps {
|
|
30
|
-
|
|
31
|
-
}
|
|
30
|
+
data: Rule.EMORuleStoreData;
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CodeViewAlertProps } from './types';
|
|
3
3
|
export declare const CodeViewDrawerContent: React.FC<CodeViewAlertProps>;
|
|
4
|
-
export declare const CodeViewAlert: React.FC<CodeViewAlertProps>;
|
|
4
|
+
export declare const CodeViewAlert: React.FC<CodeViewAlertProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Rule, SDK } from '@rsdoctor/types';
|
|
3
3
|
interface BundleAlertsProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
filter?(alert: Rule.RuleStoreDataItem): boolean;
|
|
5
|
+
project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
|
|
6
6
|
}
|
|
7
7
|
export declare const BundleAlertsBase: React.FC<BundleAlertsProps>;
|
|
8
8
|
export declare const BundleAlerts: React.FC<Omit<BundleAlertsProps, "project"> & Partial<{
|
|
9
|
-
|
|
9
|
+
body?: any;
|
|
10
10
|
}>>;
|
|
11
|
-
export {};
|
|
11
|
+
export {};
|
|
@@ -3,13 +3,13 @@ import { Rule } from '@rsdoctor/types';
|
|
|
3
3
|
import { ViewMode } from '../../constants';
|
|
4
4
|
import { AlertProps } from '../Alert/types';
|
|
5
5
|
interface CommonAlertsContainerProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
title: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
dataSource: Rule.RuleStoreDataItem[];
|
|
9
|
+
extraData: Omit<AlertProps, 'data'>;
|
|
10
|
+
viewMode: ViewMode;
|
|
11
|
+
setViewMode(mode: ViewMode): void;
|
|
12
|
+
extraCom?: JSX.Element | undefined;
|
|
13
13
|
}
|
|
14
14
|
export declare const CommonAlertsContainer: React.FC<CommonAlertsContainerProps>;
|
|
15
|
-
export {};
|
|
15
|
+
export {};
|
|
@@ -12,36 +12,59 @@ const LevelMap = {
|
|
|
12
12
|
warn: 1,
|
|
13
13
|
error: 2
|
|
14
14
|
};
|
|
15
|
-
const CommonAlertsList = ({
|
|
15
|
+
const CommonAlertsList = ({
|
|
16
|
+
dataSource,
|
|
17
|
+
extraData
|
|
18
|
+
}) => {
|
|
16
19
|
const _dataSource = useMemo(
|
|
17
20
|
() => dataSource.slice().sort((a, b) => {
|
|
18
21
|
return LevelMap[b.level] - LevelMap[a.level];
|
|
19
22
|
}),
|
|
20
23
|
[dataSource]
|
|
21
24
|
);
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Space,
|
|
27
|
+
{
|
|
28
|
+
direction: "vertical",
|
|
29
|
+
style: { wordBreak: "break-all", width: "100%" },
|
|
30
|
+
children: _dataSource.map((err, i) => {
|
|
31
|
+
return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
);
|
|
25
35
|
};
|
|
26
|
-
const CommonAlertsGroup = ({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
const CommonAlertsGroup = ({
|
|
37
|
+
dataSource,
|
|
38
|
+
extraData
|
|
39
|
+
}) => {
|
|
40
|
+
const _dataSource = useMemo(
|
|
41
|
+
() => values(groupBy(dataSource, (e) => e.code)),
|
|
42
|
+
[dataSource]
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Space,
|
|
46
|
+
{
|
|
47
|
+
direction: "vertical",
|
|
48
|
+
style: { wordBreak: "break-all", width: "100%" },
|
|
49
|
+
children: /* @__PURE__ */ jsx(Collapse, { children: _dataSource.map((el) => {
|
|
50
|
+
const [first] = el;
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
Collapse.Panel,
|
|
53
|
+
{
|
|
54
|
+
header: /* @__PURE__ */ jsxs(Space, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, style: { cursor: "pointer" }, children: first.code }),
|
|
56
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[first.code]?.title || first.title }),
|
|
57
|
+
/* @__PURE__ */ jsx(Bdg, { label: "count", value: el.length, type: "error" })
|
|
58
|
+
] }),
|
|
59
|
+
children: /* @__PURE__ */ jsx(Space, { direction: "vertical", size: 16, style: { width: "100%" }, children: el.map((err, i) => {
|
|
60
|
+
return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
|
|
61
|
+
}) })
|
|
62
|
+
},
|
|
63
|
+
first.code
|
|
64
|
+
);
|
|
65
|
+
}) })
|
|
66
|
+
}
|
|
67
|
+
);
|
|
45
68
|
};
|
|
46
69
|
const CommonAlertsContainer = ({
|
|
47
70
|
title,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Rule, SDK } from '@rsdoctor/types';
|
|
3
3
|
interface CompileAlertsProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
filter?(alert: Rule.RuleStoreDataItem): boolean;
|
|
5
|
+
project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
|
|
6
6
|
}
|
|
7
7
|
export declare const CompileAlerts: React.FC<Omit<CompileAlertsProps, "project"> & Partial<{
|
|
8
|
-
|
|
8
|
+
body?: any;
|
|
9
9
|
}>>;
|
|
10
|
-
export {};
|
|
10
|
+
export {};
|
|
@@ -2,25 +2,25 @@ import React from 'react';
|
|
|
2
2
|
import { SDK } from '@rsdoctor/types';
|
|
3
3
|
import 'rc-dialog/assets/index.css';
|
|
4
4
|
export declare const OverlayAlertsModal: React.FC<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onClose(): void;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const OverlayAlertsTips: React.FC<{
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
export declare const OverlayAlertsButton: React.FC<{
|
|
14
|
-
|
|
14
|
+
alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
|
|
15
15
|
}>;
|
|
16
16
|
export declare const OverlayAlertsWithButton: React.FC<Omit<{
|
|
17
|
-
|
|
17
|
+
alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
|
|
18
18
|
}, "alerts"> & Partial<{
|
|
19
|
-
|
|
19
|
+
body?: any;
|
|
20
20
|
}>>;
|
|
21
21
|
export declare const OverlayAlertsWithTips: React.FC<Omit<{
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
|
|
23
|
+
defaultOpen?: boolean | undefined;
|
|
24
24
|
}, "alerts"> & Partial<{
|
|
25
|
-
|
|
26
|
-
}>>;
|
|
25
|
+
body?: any;
|
|
26
|
+
}>>;
|