@rsdoctor/components 0.0.0-next-20240620044732
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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/assets/connection-point.3b3c78ca.svg +1 -0
- package/dist/assets/webpack.98604d64.svg +1 -0
- package/dist/components/Alert/change.d.ts +8 -0
- package/dist/components/Alert/change.js +93 -0
- package/dist/components/Alert/file-relation.d.ts +3 -0
- package/dist/components/Alert/file-relation.js +9 -0
- package/dist/components/Alert/index.css +32 -0
- package/dist/components/Alert/index.d.ts +4 -0
- package/dist/components/Alert/index.js +37 -0
- package/dist/components/Alert/link.d.ts +3 -0
- package/dist/components/Alert/link.js +27 -0
- package/dist/components/Alert/package-relation.d.ts +17 -0
- package/dist/components/Alert/package-relation.js +281 -0
- package/dist/components/Alert/types.d.ts +31 -0
- package/dist/components/Alert/types.js +0 -0
- package/dist/components/Alert/view.d.ts +4 -0
- package/dist/components/Alert/view.js +58 -0
- package/dist/components/Alerts/bundle.d.ts +11 -0
- package/dist/components/Alerts/bundle.js +61 -0
- package/dist/components/Alerts/common.d.ts +15 -0
- package/dist/components/Alerts/common.js +112 -0
- package/dist/components/Alerts/compile.d.ts +10 -0
- package/dist/components/Alerts/compile.js +46 -0
- package/dist/components/Alerts/index.d.ts +3 -0
- package/dist/components/Alerts/index.js +3 -0
- package/dist/components/Alerts/overlay.d.ts +26 -0
- package/dist/components/Alerts/overlay.js +154 -0
- package/dist/components/Badge/index.d.ts +21 -0
- package/dist/components/Badge/index.js +87 -0
- package/dist/components/BundleDiff/DiffContainer/assets.d.ts +7 -0
- package/dist/components/BundleDiff/DiffContainer/assets.js +507 -0
- package/dist/components/BundleDiff/DiffContainer/cards.d.ts +3 -0
- package/dist/components/BundleDiff/DiffContainer/cards.js +156 -0
- package/dist/components/BundleDiff/DiffContainer/changes.d.ts +15 -0
- package/dist/components/BundleDiff/DiffContainer/changes.js +69 -0
- package/dist/components/BundleDiff/DiffContainer/constants.d.ts +11 -0
- package/dist/components/BundleDiff/DiffContainer/constants.js +17 -0
- package/dist/components/BundleDiff/DiffContainer/diff.d.ts +23 -0
- package/dist/components/BundleDiff/DiffContainer/diff.js +114 -0
- package/dist/components/BundleDiff/DiffContainer/index.d.ts +3 -0
- package/dist/components/BundleDiff/DiffContainer/index.js +180 -0
- package/dist/components/BundleDiff/DiffContainer/modules.d.ts +8 -0
- package/dist/components/BundleDiff/DiffContainer/modules.js +302 -0
- package/dist/components/BundleDiff/DiffContainer/overview.d.ts +5 -0
- package/dist/components/BundleDiff/DiffContainer/overview.js +178 -0
- package/dist/components/BundleDiff/DiffContainer/packages.d.ts +19 -0
- package/dist/components/BundleDiff/DiffContainer/packages.js +330 -0
- package/dist/components/BundleDiff/DiffContainer/row.d.ts +9 -0
- package/dist/components/BundleDiff/DiffContainer/row.js +369 -0
- package/dist/components/BundleDiff/DiffContainer/types.d.ts +45 -0
- package/dist/components/BundleDiff/DiffContainer/types.js +0 -0
- package/dist/components/BundleDiff/DiffContainer/utils.d.ts +2 -0
- package/dist/components/BundleDiff/DiffContainer/utils.js +24 -0
- package/dist/components/BundleDiff/DiffServerAPIProvider/index.d.ts +4 -0
- package/dist/components/BundleDiff/DiffServerAPIProvider/index.js +37 -0
- package/dist/components/BundleDiff/constants.d.ts +11 -0
- package/dist/components/BundleDiff/constants.js +19 -0
- package/dist/components/BundleDiff/index.d.ts +1 -0
- package/dist/components/BundleDiff/index.js +1 -0
- package/dist/components/Card/diff.d.ts +24 -0
- package/dist/components/Card/diff.js +116 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/index.js +50 -0
- package/dist/components/Card/size.d.ts +21 -0
- package/dist/components/Card/size.js +79 -0
- package/dist/components/Card/statistic.css +17 -0
- package/dist/components/Card/statistic.d.ts +12 -0
- package/dist/components/Card/statistic.js +19 -0
- package/dist/components/Charts/TimelineCharts/index.d.ts +8 -0
- package/dist/components/Charts/TimelineCharts/index.js +212 -0
- package/dist/components/Charts/bootstrap.d.ts +5 -0
- package/dist/components/Charts/bootstrap.js +44 -0
- package/dist/components/Charts/common.d.ts +13 -0
- package/dist/components/Charts/common.js +56 -0
- package/dist/components/Charts/constants.d.ts +2 -0
- package/dist/components/Charts/constants.js +46 -0
- package/dist/components/Charts/done.d.ts +5 -0
- package/dist/components/Charts/done.js +45 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/index.js +37 -0
- package/dist/components/Charts/loader.css +31 -0
- package/dist/components/Charts/loader.d.ts +4 -0
- package/dist/components/Charts/loader.js +88 -0
- package/dist/components/Charts/minify.d.ts +5 -0
- package/dist/components/Charts/minify.js +37 -0
- package/dist/components/Charts/tooltips.css +62 -0
- package/dist/components/Charts/types.d.ts +61 -0
- package/dist/components/Charts/types.js +11 -0
- package/dist/components/Charts/utils.d.ts +13 -0
- package/dist/components/Charts/utils.js +206 -0
- package/dist/components/CodeViewer/config.d.ts +2 -0
- package/dist/components/CodeViewer/config.js +18 -0
- package/dist/components/CodeViewer/diff.d.ts +11 -0
- package/dist/components/CodeViewer/diff.js +35 -0
- package/dist/components/CodeViewer/hightlight.d.ts +10 -0
- package/dist/components/CodeViewer/hightlight.js +76 -0
- package/dist/components/CodeViewer/index.d.ts +4 -0
- package/dist/components/CodeViewer/index.js +4 -0
- package/dist/components/CodeViewer/viewer.d.ts +13 -0
- package/dist/components/CodeViewer/viewer.js +60 -0
- package/dist/components/Configuration/builder.d.ts +13 -0
- package/dist/components/Configuration/builder.js +67 -0
- package/dist/components/Configuration/index.d.ts +1 -0
- package/dist/components/Configuration/index.js +1 -0
- package/dist/components/FileTree/index.css +58 -0
- package/dist/components/FileTree/index.d.ts +4 -0
- package/dist/components/FileTree/index.js +42 -0
- package/dist/components/Form/keyword.d.ts +14 -0
- package/dist/components/Form/keyword.js +60 -0
- package/dist/components/Keyword/index.d.ts +6 -0
- package/dist/components/Keyword/index.js +36 -0
- package/dist/components/Layout/builder-select.d.ts +2 -0
- package/dist/components/Layout/builder-select.js +50 -0
- package/dist/components/Layout/constants.d.ts +1 -0
- package/dist/components/Layout/constants.js +4 -0
- package/dist/components/Layout/header.css +12 -0
- package/dist/components/Layout/header.d.ts +3 -0
- package/dist/components/Layout/header.js +86 -0
- package/dist/components/Layout/index.d.ts +5 -0
- package/dist/components/Layout/index.js +34 -0
- package/dist/components/Layout/menus.d.ts +8 -0
- package/dist/components/Layout/menus.js +167 -0
- package/dist/components/Layout/progress.d.ts +8 -0
- package/dist/components/Layout/progress.js +44 -0
- package/dist/components/Loader/Analysis/files.d.ts +8 -0
- package/dist/components/Loader/Analysis/files.js +193 -0
- package/dist/components/Loader/Analysis/index.d.ts +11 -0
- package/dist/components/Loader/Analysis/index.js +23 -0
- package/dist/components/Loader/executions.d.ts +9 -0
- package/dist/components/Loader/executions.js +199 -0
- package/dist/components/Manifest/api.d.ts +34 -0
- package/dist/components/Manifest/api.js +127 -0
- package/dist/components/Manifest/data.d.ts +8 -0
- package/dist/components/Manifest/data.js +65 -0
- package/dist/components/Manifest/index.d.ts +2 -0
- package/dist/components/Manifest/index.js +2 -0
- package/dist/components/Opener/code.d.ts +20 -0
- package/dist/components/Opener/code.js +78 -0
- package/dist/components/Opener/index.d.ts +2 -0
- package/dist/components/Opener/index.js +2 -0
- package/dist/components/Opener/vscode.d.ts +11 -0
- package/dist/components/Opener/vscode.js +42 -0
- package/dist/components/Overall/NumberButton.d.ts +8 -0
- package/dist/components/Overall/NumberButton.js +29 -0
- package/dist/components/Overall/NumberButton.module.js +5 -0
- package/dist/components/Overall/NumberButton_module.css +70 -0
- package/dist/components/Overall/bundle.d.ts +6 -0
- package/dist/components/Overall/bundle.js +167 -0
- package/dist/components/Overall/bundle.module.css +0 -0
- package/dist/components/Overall/card.module.js +5 -0
- package/dist/components/Overall/card_module.css +6 -0
- package/dist/components/Overall/compile.d.ts +5 -0
- package/dist/components/Overall/compile.js +67 -0
- package/dist/components/Overall/compile.module.js +5 -0
- package/dist/components/Overall/compile_module.css +4 -0
- package/dist/components/Overall/index.d.ts +3 -0
- package/dist/components/Overall/index.js +3 -0
- package/dist/components/Overall/list.module.js +5 -0
- package/dist/components/Overall/list_module.css +7 -0
- package/dist/components/Overall/project.d.ts +8 -0
- package/dist/components/Overall/project.js +73 -0
- package/dist/components/Plugins/webpack.d.ts +18 -0
- package/dist/components/Plugins/webpack.js +76 -0
- package/dist/components/Resolver/analysis.d.ts +15 -0
- package/dist/components/Resolver/analysis.js +144 -0
- package/dist/components/Select/index.d.ts +15 -0
- package/dist/components/Select/index.js +68 -0
- package/dist/components/Status/failed.d.ts +9 -0
- package/dist/components/Status/failed.js +33 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/Status/index.js +1 -0
- package/dist/components/TextDrawer/duplicate.d.ts +17 -0
- package/dist/components/TextDrawer/duplicate.js +69 -0
- package/dist/components/TextDrawer/index.d.ts +11 -0
- package/dist/components/TextDrawer/index.js +36 -0
- package/dist/components/Title/index.d.ts +15 -0
- package/dist/components/Title/index.js +10 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +15 -0
- package/dist/components/worker/ecmaversion/client.d.ts +10 -0
- package/dist/components/worker/ecmaversion/client.js +60 -0
- package/dist/components/worker/ecmaversion/worker.d.ts +1 -0
- package/dist/components/worker/ecmaversion/worker.js +13 -0
- package/dist/components/worker/jsequal/client.d.ts +11 -0
- package/dist/components/worker/jsequal/client.js +38 -0
- package/dist/components/worker/jsequal/worker.d.ts +1 -0
- package/dist/components/worker/jsequal/worker.js +23 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +25 -0
- package/dist/constants.d.ts +50 -0
- package/dist/constants.js +75 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/pages/BundleSize/components/asset.d.ts +26 -0
- package/dist/pages/BundleSize/components/asset.js +545 -0
- package/dist/pages/BundleSize/components/cards.d.ts +7 -0
- package/dist/pages/BundleSize/components/cards.js +143 -0
- package/dist/pages/BundleSize/components/editor.d.ts +5 -0
- package/dist/pages/BundleSize/components/editor.js +38 -0
- package/dist/pages/BundleSize/components/index.css +20 -0
- package/dist/pages/BundleSize/components/index.d.ts +16 -0
- package/dist/pages/BundleSize/components/index.js +366 -0
- package/dist/pages/BundleSize/config.d.ts +7 -0
- package/dist/pages/BundleSize/config.js +9 -0
- package/dist/pages/BundleSize/constants.d.ts +5 -0
- package/dist/pages/BundleSize/constants.js +9 -0
- package/dist/pages/BundleSize/index.d.ts +3 -0
- package/dist/pages/BundleSize/index.js +11 -0
- package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
- package/dist/pages/ModuleAnalyze/chunks.js +48 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +97 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +120 -0
- package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
- package/dist/pages/ModuleAnalyze/constants.js +14 -0
- package/dist/pages/ModuleAnalyze/dependncy.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/dependncy.js +31 -0
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/fileTree.js +125 -0
- package/dist/pages/ModuleAnalyze/index.css +10 -0
- package/dist/pages/ModuleAnalyze/index.d.ts +8 -0
- package/dist/pages/ModuleAnalyze/index.js +64 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.js +62 -0
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
- package/dist/pages/ModuleAnalyze/utils/index.js +34 -0
- package/dist/pages/ModuleResolve/constants.d.ts +3 -0
- package/dist/pages/ModuleResolve/constants.js +7 -0
- package/dist/pages/ModuleResolve/index.d.ts +3 -0
- package/dist/pages/ModuleResolve/index.js +19 -0
- package/dist/pages/Overall/constants.d.ts +3 -0
- package/dist/pages/Overall/constants.js +7 -0
- package/dist/pages/Overall/index.d.ts +9 -0
- package/dist/pages/Overall/index.js +39 -0
- 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 +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/TreeShaking/constants.d.ts +3 -0
- package/dist/pages/TreeShaking/constants.js +7 -0
- package/dist/pages/TreeShaking/editor.d.ts +12 -0
- package/dist/pages/TreeShaking/editor.js +110 -0
- package/dist/pages/TreeShaking/index.css +74 -0
- package/dist/pages/TreeShaking/index.d.ts +8 -0
- package/dist/pages/TreeShaking/index.js +177 -0
- package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
- package/dist/pages/TreeShaking/open-tag.js +43 -0
- package/dist/pages/TreeShaking/space.d.ts +1 -0
- package/dist/pages/TreeShaking/space.js +16 -0
- package/dist/pages/TreeShaking/table.d.ts +13 -0
- package/dist/pages/TreeShaking/table.js +319 -0
- package/dist/pages/TreeShaking/types.d.ts +3 -0
- package/dist/pages/TreeShaking/types.js +0 -0
- package/dist/pages/TreeShaking/utils.d.ts +7 -0
- package/dist/pages/TreeShaking/utils.js +147 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/index.js +19 -0
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/index.js +11 -0
- package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
- package/dist/pages/WebpackLoaders/constants.js +6 -0
- package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
- package/dist/pages/WebpackPlugins/constants.js +7 -0
- package/dist/pages/WebpackPlugins/index.d.ts +3 -0
- package/dist/pages/WebpackPlugins/index.js +79 -0
- package/dist/pages/index.d.ts +9 -0
- package/dist/pages/index.js +20 -0
- package/dist/utils/data/base.d.ts +24 -0
- package/dist/utils/data/base.js +48 -0
- package/dist/utils/data/index.d.ts +5 -0
- package/dist/utils/data/index.js +44 -0
- package/dist/utils/data/local.d.ts +14 -0
- package/dist/utils/data/local.js +86 -0
- package/dist/utils/data/remote.d.ts +10 -0
- package/dist/utils/data/remote.js +52 -0
- package/dist/utils/file.d.ts +33 -0
- package/dist/utils/file.js +154 -0
- package/dist/utils/hooks.d.ts +31 -0
- package/dist/utils/hooks.js +216 -0
- package/dist/utils/i18n/cn.d.ts +3 -0
- package/dist/utils/i18n/cn.js +33 -0
- package/dist/utils/i18n/en.d.ts +30 -0
- package/dist/utils/i18n/en.js +33 -0
- package/dist/utils/i18n/index.d.ts +2 -0
- package/dist/utils/i18n/index.js +34 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/loader.d.ts +7 -0
- package/dist/utils/loader.js +34 -0
- package/dist/utils/locale.d.ts +2 -0
- package/dist/utils/locale.js +9 -0
- package/dist/utils/manifest.d.ts +27 -0
- package/dist/utils/manifest.js +54 -0
- package/dist/utils/monaco.d.ts +12 -0
- package/dist/utils/monaco.js +71 -0
- package/dist/utils/request.d.ts +27 -0
- package/dist/utils/request.js +130 -0
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/routes.js +14 -0
- package/dist/utils/size.d.ts +2 -0
- package/dist/utils/size.js +24 -0
- package/dist/utils/socket.d.ts +2 -0
- package/dist/utils/socket.js +21 -0
- package/dist/utils/storage.d.ts +13 -0
- package/dist/utils/storage.js +70 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/string.js +14 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +7 -0
- package/dist/utils/url.d.ts +7 -0
- package/dist/utils/url.js +75 -0
- package/dist/utils/worker/index.d.ts +4 -0
- package/dist/utils/worker/index.js +4 -0
- package/dist/utils/worker/master.d.ts +8 -0
- package/dist/utils/worker/master.js +18 -0
- package/dist/utils/worker/types.d.ts +9 -0
- package/dist/utils/worker/types.js +0 -0
- package/dist/utils/worker/utils.d.ts +7 -0
- package/dist/utils/worker/utils.js +29 -0
- package/dist/utils/worker/worker.d.ts +13 -0
- package/dist/utils/worker/worker.js +38 -0
- package/package.json +92 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
Space,
|
|
4
|
+
Table,
|
|
5
|
+
Typography,
|
|
6
|
+
Divider,
|
|
7
|
+
Tooltip,
|
|
8
|
+
Button,
|
|
9
|
+
Input
|
|
10
|
+
} from "antd";
|
|
11
|
+
import { SearchOutlined } from "@ant-design/icons";
|
|
12
|
+
import React, { useMemo, useState, useRef } from "react";
|
|
13
|
+
import Highlighter from "react-highlight-words";
|
|
14
|
+
import { Card } from "../../components/Card";
|
|
15
|
+
import { ellipsisPath } from "./utils";
|
|
16
|
+
import { isDef } from "../../utils";
|
|
17
|
+
const tableHeight = 600;
|
|
18
|
+
function getDeclarationElement(val, setEditorData) {
|
|
19
|
+
if (!val) {
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { children: "Can not find declaration." });
|
|
21
|
+
}
|
|
22
|
+
const { module } = val;
|
|
23
|
+
const range = module.isPreferSource ? val.position.source : val.position.transformed;
|
|
24
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: `${module.path}, line ${range.start.line}`, children: /* @__PURE__ */ jsx(
|
|
25
|
+
Button,
|
|
26
|
+
{
|
|
27
|
+
type: "link",
|
|
28
|
+
onClick: () => setEditorData(module, [range], range.start.line),
|
|
29
|
+
children: "Move To"
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
32
|
+
}
|
|
33
|
+
function useSearchCell(dataIndex) {
|
|
34
|
+
const [searchText, setSearchText] = useState("");
|
|
35
|
+
const [searchedColumn, setSearchedColumn] = useState("");
|
|
36
|
+
const searchInput = useRef(null);
|
|
37
|
+
const handleSearch = (selectedKeys, confirm, dataIndex2) => {
|
|
38
|
+
confirm();
|
|
39
|
+
setSearchText(selectedKeys[0]);
|
|
40
|
+
setSearchedColumn(dataIndex2);
|
|
41
|
+
};
|
|
42
|
+
const handleReset = (clearFilters) => {
|
|
43
|
+
clearFilters();
|
|
44
|
+
setSearchText("");
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
filterDropdown: ({
|
|
48
|
+
setSelectedKeys,
|
|
49
|
+
selectedKeys,
|
|
50
|
+
confirm,
|
|
51
|
+
clearFilters,
|
|
52
|
+
close
|
|
53
|
+
}) => /* @__PURE__ */ jsxs("div", { style: { padding: 8 }, onKeyDown: (e) => e.stopPropagation(), children: [
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
Input,
|
|
56
|
+
{
|
|
57
|
+
ref: searchInput,
|
|
58
|
+
placeholder: `Search ${dataIndex}`,
|
|
59
|
+
value: selectedKeys[0],
|
|
60
|
+
onChange: (e) => setSelectedKeys(e.target.value ? [e.target.value] : []),
|
|
61
|
+
onPressEnter: () => handleSearch(selectedKeys, confirm, dataIndex),
|
|
62
|
+
style: { marginBottom: 8, display: "block" }
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Button,
|
|
68
|
+
{
|
|
69
|
+
type: "primary",
|
|
70
|
+
onClick: () => handleSearch(selectedKeys, confirm, dataIndex),
|
|
71
|
+
icon: /* @__PURE__ */ jsx(SearchOutlined, {}),
|
|
72
|
+
size: "small",
|
|
73
|
+
style: { width: 90 },
|
|
74
|
+
children: "Search"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Button,
|
|
79
|
+
{
|
|
80
|
+
onClick: () => clearFilters && handleReset(clearFilters),
|
|
81
|
+
size: "small",
|
|
82
|
+
style: { width: 90 },
|
|
83
|
+
children: "Reset"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsx(Button, { type: "link", size: "small", onClick: close, children: "close" })
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
filterIcon: (filtered) => /* @__PURE__ */ jsx(SearchOutlined, { style: { color: filtered ? "#1890ff" : void 0 } }),
|
|
90
|
+
onFilter: (value, record) => {
|
|
91
|
+
return record[dataIndex].toString().toLowerCase().includes(value.toLowerCase());
|
|
92
|
+
},
|
|
93
|
+
render: (text) => {
|
|
94
|
+
return searchedColumn === dataIndex ? /* @__PURE__ */ jsx(
|
|
95
|
+
Highlighter,
|
|
96
|
+
{
|
|
97
|
+
highlightStyle: { backgroundColor: "#ffc069", padding: 0 },
|
|
98
|
+
searchWords: [searchText],
|
|
99
|
+
autoEscape: true,
|
|
100
|
+
textToHighlight: text ? text.toString() : ""
|
|
101
|
+
}
|
|
102
|
+
) : text;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const SideEffectTable = ({
|
|
107
|
+
module,
|
|
108
|
+
moduleGraph,
|
|
109
|
+
setEditorData
|
|
110
|
+
}) => {
|
|
111
|
+
const sideEffects = useMemo(
|
|
112
|
+
() => moduleGraph.getModuleGraphModule(module).getSideEffects(),
|
|
113
|
+
[module]
|
|
114
|
+
);
|
|
115
|
+
const dataSource = sideEffects.map(({ variable, name, identifier }, i) => {
|
|
116
|
+
return {
|
|
117
|
+
key: i,
|
|
118
|
+
name,
|
|
119
|
+
identifier: module.isPreferSource ? identifier.position.source : identifier.position.transformed,
|
|
120
|
+
declaration: variable?.identifier
|
|
121
|
+
};
|
|
122
|
+
}).sort((pre, next) => {
|
|
123
|
+
if (pre.name === next.name) {
|
|
124
|
+
return pre.identifier.start.line > next.identifier.start.line ? 1 : -1;
|
|
125
|
+
}
|
|
126
|
+
return pre.name > next.name ? 1 : -1;
|
|
127
|
+
}).reduce((ans, item) => {
|
|
128
|
+
const lastItem = ans[ans.length - 1];
|
|
129
|
+
if (!lastItem || lastItem.name !== item.name) {
|
|
130
|
+
ans.push(item);
|
|
131
|
+
return ans;
|
|
132
|
+
}
|
|
133
|
+
if (!lastItem.children) {
|
|
134
|
+
lastItem.children = [];
|
|
135
|
+
}
|
|
136
|
+
lastItem.children.push(item);
|
|
137
|
+
return ans;
|
|
138
|
+
}, []);
|
|
139
|
+
const columns = [
|
|
140
|
+
{
|
|
141
|
+
title: "Name",
|
|
142
|
+
dataIndex: "name",
|
|
143
|
+
key: "name",
|
|
144
|
+
align: "center",
|
|
145
|
+
...useSearchCell("name")
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: "SideEffect",
|
|
149
|
+
dataIndex: "identifier",
|
|
150
|
+
key: "identifier",
|
|
151
|
+
align: "center",
|
|
152
|
+
render: (val) => {
|
|
153
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: `Current File line ${val.start.line}`, children: /* @__PURE__ */ jsx(
|
|
154
|
+
Button,
|
|
155
|
+
{
|
|
156
|
+
type: "link",
|
|
157
|
+
onClick: () => setEditorData(module, [val], val.start.line),
|
|
158
|
+
children: "Move To"
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: "Declaration",
|
|
165
|
+
dataIndex: "declaration",
|
|
166
|
+
key: "declaration",
|
|
167
|
+
align: "center",
|
|
168
|
+
render: (val) => {
|
|
169
|
+
return getDeclarationElement(val, setEditorData);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
const titleInfo = /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs(Space, { style: { fontWeight: 400 }, children: [
|
|
174
|
+
"Import",
|
|
175
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: dataSource.length }),
|
|
176
|
+
"variables",
|
|
177
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
178
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: sideEffects.length }),
|
|
179
|
+
"sideEffects"
|
|
180
|
+
] }) });
|
|
181
|
+
return /* @__PURE__ */ jsx(
|
|
182
|
+
Card,
|
|
183
|
+
{
|
|
184
|
+
style: { marginBottom: 10 },
|
|
185
|
+
title: titleInfo,
|
|
186
|
+
className: "tree-shaking-export-table",
|
|
187
|
+
children: /* @__PURE__ */ jsx(
|
|
188
|
+
Table,
|
|
189
|
+
{
|
|
190
|
+
size: "small",
|
|
191
|
+
dataSource,
|
|
192
|
+
columns,
|
|
193
|
+
pagination: false,
|
|
194
|
+
scroll: { y: tableHeight }
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
const ExportTable = ({
|
|
201
|
+
module,
|
|
202
|
+
moduleGraph,
|
|
203
|
+
setEditorData
|
|
204
|
+
}) => {
|
|
205
|
+
const exportsData = useMemo(
|
|
206
|
+
() => moduleGraph.getModuleGraphModule(module).getExports(),
|
|
207
|
+
[module]
|
|
208
|
+
);
|
|
209
|
+
const allUnUsedExports = exportsData.filter(
|
|
210
|
+
(item) => item.getSideEffects().length === 0
|
|
211
|
+
);
|
|
212
|
+
const titleInfo = /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
213
|
+
/* @__PURE__ */ jsxs(Space, { style: { fontWeight: 400 }, children: [
|
|
214
|
+
"Export",
|
|
215
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: exportsData.length })
|
|
216
|
+
] }),
|
|
217
|
+
exportsData.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
219
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { fontWeight: 400 }, code: true, children: [
|
|
220
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Unused" }),
|
|
221
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
222
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: allUnUsedExports.length })
|
|
223
|
+
] }),
|
|
224
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
225
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { fontWeight: 400 }, code: true, children: [
|
|
226
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Used" }),
|
|
227
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
228
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: exportsData.length - allUnUsedExports.length })
|
|
229
|
+
] })
|
|
230
|
+
] }) : ""
|
|
231
|
+
] });
|
|
232
|
+
const dataSource = exportsData.map((item, i) => {
|
|
233
|
+
const { variable } = item;
|
|
234
|
+
return {
|
|
235
|
+
key: i,
|
|
236
|
+
name: item.name,
|
|
237
|
+
declaration: variable?.identifier,
|
|
238
|
+
used: item.getSideEffects().map(({ module: module2, identifier }) => {
|
|
239
|
+
const range = module2?.isPreferSource ? identifier.position.source : identifier.position.transformed;
|
|
240
|
+
if (!module2 || !range) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
module: module2,
|
|
245
|
+
range
|
|
246
|
+
};
|
|
247
|
+
}).filter(isDef)
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
const columns = [
|
|
251
|
+
{
|
|
252
|
+
title: "Name",
|
|
253
|
+
dataIndex: "name",
|
|
254
|
+
key: "name",
|
|
255
|
+
align: "center",
|
|
256
|
+
...useSearchCell("name")
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
title: "Declaration",
|
|
260
|
+
dataIndex: "declaration",
|
|
261
|
+
key: "declaration",
|
|
262
|
+
align: "center",
|
|
263
|
+
render: (val) => {
|
|
264
|
+
return getDeclarationElement(val, setEditorData);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
title: "Info",
|
|
269
|
+
dataIndex: "used",
|
|
270
|
+
key: "used",
|
|
271
|
+
align: "center",
|
|
272
|
+
sorter: (a, b) => a.used.length - b.used.length,
|
|
273
|
+
sortDirections: ["descend", "ascend"],
|
|
274
|
+
render: (val) => /* @__PURE__ */ jsxs("span", { children: [
|
|
275
|
+
"Used ",
|
|
276
|
+
val.length,
|
|
277
|
+
" times"
|
|
278
|
+
] })
|
|
279
|
+
}
|
|
280
|
+
];
|
|
281
|
+
const expandElement = (data) => {
|
|
282
|
+
return /* @__PURE__ */ jsxs("div", { className: "tree-shaking-side-effect-list", children: [
|
|
283
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "List of SideEffect:" }),
|
|
284
|
+
data.used.map(({ module: module2, range }) => /* @__PURE__ */ jsx(Tooltip, { title: `${module2.path}:${range.start.line}`, children: /* @__PURE__ */ jsx(
|
|
285
|
+
Button,
|
|
286
|
+
{
|
|
287
|
+
className: "tree-shaking-side-effect-list-item",
|
|
288
|
+
type: "link",
|
|
289
|
+
onClick: () => {
|
|
290
|
+
setEditorData(module2, [range], range.start.line);
|
|
291
|
+
},
|
|
292
|
+
children: `${ellipsisPath(module2.path)}:${range.start.line}`
|
|
293
|
+
}
|
|
294
|
+
) }, module2.id))
|
|
295
|
+
] });
|
|
296
|
+
};
|
|
297
|
+
return /* @__PURE__ */ jsx(Card, { title: titleInfo, className: "tree-shaking-export-table", children: /* @__PURE__ */ jsx(
|
|
298
|
+
Table,
|
|
299
|
+
{
|
|
300
|
+
size: "small",
|
|
301
|
+
dataSource,
|
|
302
|
+
columns,
|
|
303
|
+
pagination: false,
|
|
304
|
+
scroll: { y: tableHeight },
|
|
305
|
+
expandable: {
|
|
306
|
+
expandedRowRender: expandElement,
|
|
307
|
+
rowExpandable: (val) => val.used.length > 0
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
) });
|
|
311
|
+
};
|
|
312
|
+
const TreeShakingTable = (props) => {
|
|
313
|
+
return props.kind === "side-effect" ? /* @__PURE__ */ jsx(SideEffectTable, { ...props }) : /* @__PURE__ */ jsx(ExportTable, { ...props });
|
|
314
|
+
};
|
|
315
|
+
export {
|
|
316
|
+
ExportTable,
|
|
317
|
+
SideEffectTable,
|
|
318
|
+
TreeShakingTable
|
|
319
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Module, ModuleGraph, Statement } from '@rsdoctor/graph';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
export declare function useFileStructures(modules: Module[], moduleGraph: ModuleGraph, searchInput: string, selectedModule: Module, onItemClick: (file: string) => void, cwd: string): import("../../utils").DataNode[];
|
|
4
|
+
export declare function getTreeFilesDefaultExpandedKeys(files: any[]): (string | number)[];
|
|
5
|
+
export declare function ellipsisPath(full: string): string;
|
|
6
|
+
export declare function getModulePositionString(statement: Statement, module: Module): string;
|
|
7
|
+
export declare function getHoverMessageInModule(module: Module, moduleGraph: ModuleGraph): editor.IModelDecoration[];
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import path from "path-browserify";
|
|
4
|
+
import { escape, get } from "lodash-es";
|
|
5
|
+
import { Module } from "@rsdoctor/graph";
|
|
6
|
+
import { Tag, Space } from "antd";
|
|
7
|
+
import { Range } from "monaco-editor";
|
|
8
|
+
import { getOpenTagText } from "./open-tag";
|
|
9
|
+
import {
|
|
10
|
+
createFileStructures,
|
|
11
|
+
mapFileKey,
|
|
12
|
+
getSelectionRange
|
|
13
|
+
} from "../../utils";
|
|
14
|
+
import { Keyword } from "../../components/Keyword";
|
|
15
|
+
function useFileStructures(modules, moduleGraph, searchInput, selectedModule, onItemClick, cwd) {
|
|
16
|
+
const files = useMemo(
|
|
17
|
+
() => createFileStructures({
|
|
18
|
+
files: modules.map((item) => item.path),
|
|
19
|
+
cwd,
|
|
20
|
+
fileTitle(file, basename) {
|
|
21
|
+
const module = moduleGraph.getModules().find(
|
|
22
|
+
(item) => item.path === file && item.kind === Module.kind.Normal
|
|
23
|
+
);
|
|
24
|
+
const mgm = moduleGraph.getModuleGraphModule(module);
|
|
25
|
+
const infos = mgm.getExports();
|
|
26
|
+
const unused = infos.filter(
|
|
27
|
+
(info) => info.getSideEffects().length === 0
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ jsxs(Space, { style: { wordBreak: "break-all" }, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Keyword,
|
|
32
|
+
{
|
|
33
|
+
text: basename,
|
|
34
|
+
keyword: file,
|
|
35
|
+
onClick: () => onItemClick(file)
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
mgm.dynamic ? /* @__PURE__ */ jsx(Tag, { color: "cyan", children: "dynamic" }) : "",
|
|
39
|
+
unused.length > 0 ? /* @__PURE__ */ jsxs(Tag, { color: "green", children: [
|
|
40
|
+
unused.length,
|
|
41
|
+
" Unused"
|
|
42
|
+
] }) : ""
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
[searchInput, selectedModule]
|
|
47
|
+
);
|
|
48
|
+
return files;
|
|
49
|
+
}
|
|
50
|
+
function getTreeFilesDefaultExpandedKeys(files) {
|
|
51
|
+
return mapFileKey(files, 3, (node) => {
|
|
52
|
+
const resourcePath = get(node, "__RESOURCEPATH__");
|
|
53
|
+
const isNodeModules = resourcePath.indexOf("/node_modules/") > -1;
|
|
54
|
+
return !isNodeModules;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function ellipsisPath(full) {
|
|
58
|
+
let result = "";
|
|
59
|
+
let current = full;
|
|
60
|
+
for (let i = 0; i < 3; i++) {
|
|
61
|
+
result = result ? `${path.basename(current)}/${result}` : path.basename(current);
|
|
62
|
+
current = path.dirname(current);
|
|
63
|
+
}
|
|
64
|
+
return `...${result}`;
|
|
65
|
+
}
|
|
66
|
+
function getModulePositionString(statement, module) {
|
|
67
|
+
const maxLen = 30;
|
|
68
|
+
const { path: path2, isPreferSource } = module;
|
|
69
|
+
const start = isPreferSource ? statement.position.source.start : statement.position.transformed.start;
|
|
70
|
+
const suffix = `:${start.line ?? 1}:${start.column ?? 0}`;
|
|
71
|
+
return path2.length <= maxLen ? `${path2}${suffix}` : `...${path2.substring(path2.length - 30)}${suffix}`;
|
|
72
|
+
}
|
|
73
|
+
function getHoverMessageInModule(module, moduleGraph) {
|
|
74
|
+
const mgm = moduleGraph.getModuleGraphModule(module);
|
|
75
|
+
const exportLocals = mgm.getOwnExports();
|
|
76
|
+
const variables = exportLocals.map((item) => item.variable).filter((item) => Boolean(item));
|
|
77
|
+
if (exportLocals.length === 0 && variables.length === 0) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
function getVariableMessage(data) {
|
|
81
|
+
const exportData = data.getExportInfo();
|
|
82
|
+
if (!exportData) {
|
|
83
|
+
return "Can not find SideEffect info.";
|
|
84
|
+
}
|
|
85
|
+
const sideEffects = exportData.getSideEffects();
|
|
86
|
+
if (sideEffects.length === 0) {
|
|
87
|
+
return "Have no sideEffect.";
|
|
88
|
+
}
|
|
89
|
+
let content = `Used **${sideEffects.length}** times:
|
|
90
|
+
|
|
91
|
+
<div data-code="tree-shaking-hover">
|
|
92
|
+
<li>`;
|
|
93
|
+
for (const sideEffect of sideEffects) {
|
|
94
|
+
if (!sideEffect) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const { identifier, module: module2 } = sideEffect;
|
|
98
|
+
if (!module2) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const { id, isPreferSource: isPreferSource2 } = module2;
|
|
102
|
+
const lineCode = identifier.getLineCode();
|
|
103
|
+
content += `
|
|
104
|
+
<ol>
|
|
105
|
+
${getOpenTagText(
|
|
106
|
+
id,
|
|
107
|
+
isPreferSource2 ? identifier.position.source : identifier.position.transformed,
|
|
108
|
+
getModulePositionString(identifier, module2)
|
|
109
|
+
)}
|
|
110
|
+
${lineCode ? `<pre>${escape(lineCode)}</pre>` : ""}
|
|
111
|
+
</ol>`;
|
|
112
|
+
}
|
|
113
|
+
content += "\n</li></div>";
|
|
114
|
+
return content;
|
|
115
|
+
}
|
|
116
|
+
const { isPreferSource } = module;
|
|
117
|
+
const declarationHovers = variables.map((item) => {
|
|
118
|
+
const position = isPreferSource ? item.identifier.position.source : item.identifier.position.transformed;
|
|
119
|
+
const range = position && getSelectionRange(position, Range);
|
|
120
|
+
if (!position || !range) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
range,
|
|
125
|
+
options: {
|
|
126
|
+
stickiness: 1,
|
|
127
|
+
inlineClassName: "tree-shaking-statement-declaration-identifier",
|
|
128
|
+
isWholeLine: false,
|
|
129
|
+
showIfCollapsed: true,
|
|
130
|
+
hoverMessage: {
|
|
131
|
+
supportHtml: true,
|
|
132
|
+
supportThemeIcons: true,
|
|
133
|
+
isTrusted: true,
|
|
134
|
+
value: getVariableMessage(item)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}).filter((item) => Boolean(item));
|
|
139
|
+
return declarationHovers;
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
ellipsisPath,
|
|
143
|
+
getHoverMessageInModule,
|
|
144
|
+
getModulePositionString,
|
|
145
|
+
getTreeFilesDefaultExpandedKeys,
|
|
146
|
+
useFileStructures
|
|
147
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderAnalysis } from "../../../components/Loader/Analysis";
|
|
3
|
+
import { WebpackConfigurationViewer } from "../../../components/Configuration";
|
|
4
|
+
import { Card } from "../../../components/Card";
|
|
5
|
+
const Page = () => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Card,
|
|
8
|
+
{
|
|
9
|
+
title: "Webpack Loader Analysis",
|
|
10
|
+
extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, { defaultKeys: ["module", "resolve"] }),
|
|
11
|
+
bodyStyle: { paddingTop: 0 },
|
|
12
|
+
children: /* @__PURE__ */ jsx(LoaderAnalysis, {})
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
export * from "./constants";
|
|
17
|
+
export {
|
|
18
|
+
Page
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WebpackConfigurationViewer } from "../../../components/Configuration";
|
|
3
|
+
import { Card } from "../../../components/Card";
|
|
4
|
+
import { LoaderChart } from "../../../components/Charts";
|
|
5
|
+
const Page = () => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Card, { title: "Loader Timeline", extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, { defaultKeys: ["module"] }), collapsable: true, children: /* @__PURE__ */ jsx(LoaderChart, {}) });
|
|
7
|
+
};
|
|
8
|
+
export * from "./constants";
|
|
9
|
+
export {
|
|
10
|
+
Page
|
|
11
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ApiOutlined, PartitionOutlined } from "@ant-design/icons";
|
|
3
|
+
import { SDK } from "@rsdoctor/types";
|
|
4
|
+
import { Button, Card, Input, Select, Space, Typography } from "antd";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { WebpackConfigurationViewer } from "../../components/Configuration";
|
|
7
|
+
import { ServerAPIProvider } from "../../components/Manifest";
|
|
8
|
+
import { WebpackPluginsDataTable } from "../../components/Plugins/webpack";
|
|
9
|
+
import { Size } from "../../constants";
|
|
10
|
+
const Page = () => {
|
|
11
|
+
const [selectedTapNames, setSelectedTapNames] = useState([]);
|
|
12
|
+
const [selectedHooks, setSelectedHooks] = useState([]);
|
|
13
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
14
|
+
Card,
|
|
15
|
+
{
|
|
16
|
+
title: "Webpack Plugins Overall",
|
|
17
|
+
bodyStyle: { paddingTop: Size.BasePadding / 3 },
|
|
18
|
+
extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, { defaultKeys: ["plugins"] }),
|
|
19
|
+
children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetPluginSummary, children: ({ hooks, tapNames }) => /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
|
|
21
|
+
/* @__PURE__ */ jsxs(Input.Group, { compact: true, children: [
|
|
22
|
+
/* @__PURE__ */ jsxs(Button, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(ApiOutlined, {}),
|
|
24
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Plugin Tap Names" })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Select,
|
|
28
|
+
{
|
|
29
|
+
mode: "multiple",
|
|
30
|
+
allowClear: true,
|
|
31
|
+
style: { width: 350 },
|
|
32
|
+
dropdownMatchSelectWidth: true,
|
|
33
|
+
onChange: (e) => {
|
|
34
|
+
setSelectedTapNames(e);
|
|
35
|
+
},
|
|
36
|
+
children: tapNames.map((e) => {
|
|
37
|
+
return /* @__PURE__ */ jsx(Select.Option, { label: e, value: e, children: e }, e);
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsxs(Input.Group, { compact: true, children: [
|
|
43
|
+
/* @__PURE__ */ jsxs(Button, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(PartitionOutlined, {}),
|
|
45
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Hooks" })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
Select,
|
|
49
|
+
{
|
|
50
|
+
mode: "multiple",
|
|
51
|
+
allowClear: true,
|
|
52
|
+
style: { width: 350 },
|
|
53
|
+
dropdownMatchSelectWidth: true,
|
|
54
|
+
onChange: (e) => {
|
|
55
|
+
setSelectedHooks(e);
|
|
56
|
+
},
|
|
57
|
+
children: hooks.map((e) => {
|
|
58
|
+
return /* @__PURE__ */ jsx(Select.Option, { label: e, value: e, children: e }, e);
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] })
|
|
63
|
+
] }) }),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
ServerAPIProvider,
|
|
66
|
+
{
|
|
67
|
+
api: SDK.ServerAPI.API.GetPluginData,
|
|
68
|
+
body: { hooks: selectedHooks, tapNames: selectedTapNames },
|
|
69
|
+
children: (res) => /* @__PURE__ */ jsx(WebpackPluginsDataTable, { dataSource: res })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
73
|
+
}
|
|
74
|
+
) });
|
|
75
|
+
};
|
|
76
|
+
export * from "./constants";
|
|
77
|
+
export {
|
|
78
|
+
Page
|
|
79
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as Overall from './Overall';
|
|
2
|
+
export * as BundleSize from './BundleSize';
|
|
3
|
+
export * as ModuleAnalyze from './ModuleAnalyze';
|
|
4
|
+
export * as LoaderTimeline from './WebpackLoaders/Overall';
|
|
5
|
+
export * as LoaderFiles from './WebpackLoaders/Analysis';
|
|
6
|
+
export * as PluginsAnalyze from './WebpackPlugins';
|
|
7
|
+
export * as ModuleResolve from './ModuleResolve';
|
|
8
|
+
export * as RuleIndex from './Resources/RuleIndex';
|
|
9
|
+
export * as TreeShaking from './TreeShaking';
|