@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,302 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
Col,
|
|
5
|
+
Divider,
|
|
6
|
+
Row,
|
|
7
|
+
Select,
|
|
8
|
+
Space,
|
|
9
|
+
Table,
|
|
10
|
+
Tag,
|
|
11
|
+
Tooltip,
|
|
12
|
+
Typography
|
|
13
|
+
} from "antd";
|
|
14
|
+
import { includes, uniq, values } from "lodash-es";
|
|
15
|
+
import { InfoCircleOutlined, FileSearchOutlined } from "@ant-design/icons";
|
|
16
|
+
import { Graph } from "@rsdoctor/utils/common";
|
|
17
|
+
import { beautifyModulePath, useUniqModules } from "@rsdoctor/components/utils";
|
|
18
|
+
import { ViewChanges } from "./changes";
|
|
19
|
+
import { UpdateType } from "./constants";
|
|
20
|
+
import { Badge as Bdg, KeywordInput } from "@rsdoctor/components";
|
|
21
|
+
import { ModuleHashPattern, getTargetColumnPropsForModuleRow } from "./row";
|
|
22
|
+
import { Size } from "../../../constants";
|
|
23
|
+
function getUpdateType(e) {
|
|
24
|
+
if (e.baseline && !e.current) {
|
|
25
|
+
return UpdateType.Deleted;
|
|
26
|
+
}
|
|
27
|
+
if (!e.baseline && e.current) {
|
|
28
|
+
return UpdateType.New;
|
|
29
|
+
}
|
|
30
|
+
if (e.baseline && e.current) {
|
|
31
|
+
if (e.baseline.size.sourceSize === e.current.size.sourceSize && e.baseline.size.parsedSize === e.current.size.parsedSize) {
|
|
32
|
+
return UpdateType.NotChanged;
|
|
33
|
+
}
|
|
34
|
+
return UpdateType.Changed;
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Update Type not match");
|
|
37
|
+
}
|
|
38
|
+
const FileUpdateTypeTag = ({ type }) => {
|
|
39
|
+
if (type === UpdateType.NotChanged) {
|
|
40
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: "It hasn't changed between Baseline and Current", children: /* @__PURE__ */ jsx(Tag, { color: "success", children: "Not Changed" }) });
|
|
41
|
+
}
|
|
42
|
+
if (type === UpdateType.Changed) {
|
|
43
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: "It has been changed between Baseline and Current", children: /* @__PURE__ */ jsx(Tag, { color: "warning", children: "Changed" }) });
|
|
44
|
+
}
|
|
45
|
+
if (type === UpdateType.New) {
|
|
46
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: "It is created in Current", children: /* @__PURE__ */ jsx(Tag, { color: "error", children: "New" }) });
|
|
47
|
+
}
|
|
48
|
+
if (type === UpdateType.Deleted) {
|
|
49
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: "It has been deleted in Current", children: /* @__PURE__ */ jsx(Tag, { color: "error", children: "Deleted" }) });
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
const Modules = ({
|
|
54
|
+
baseline,
|
|
55
|
+
current
|
|
56
|
+
}) => {
|
|
57
|
+
const bModules = useMemo(
|
|
58
|
+
() => useUniqModules(baseline.moduleGraph.modules),
|
|
59
|
+
[baseline]
|
|
60
|
+
);
|
|
61
|
+
const cModules = useMemo(
|
|
62
|
+
() => useUniqModules(current.moduleGraph.modules),
|
|
63
|
+
[current]
|
|
64
|
+
);
|
|
65
|
+
const bChunks = baseline.chunkGraph.chunks;
|
|
66
|
+
const cChunks = current.chunkGraph.chunks;
|
|
67
|
+
const bRoot = baseline.root;
|
|
68
|
+
const cRoot = current.root;
|
|
69
|
+
const [keyword, setKeyword] = useState();
|
|
70
|
+
const [selectedUpdateTypes, setSelectedUpdateTypes] = useState(
|
|
71
|
+
[]
|
|
72
|
+
);
|
|
73
|
+
const dataSource = useMemo(() => {
|
|
74
|
+
const res = {};
|
|
75
|
+
bModules.forEach((mod) => {
|
|
76
|
+
const modPath = mod.webpackId?.replace(ModuleHashPattern, "") || mod.path?.replace(ModuleHashPattern, "");
|
|
77
|
+
if (!res[modPath]) {
|
|
78
|
+
res[modPath] = {
|
|
79
|
+
path: modPath,
|
|
80
|
+
baseline: mod
|
|
81
|
+
};
|
|
82
|
+
} else {
|
|
83
|
+
console.warn("[Baseline Module Exists]: ", mod, res);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
cModules.forEach((mod) => {
|
|
87
|
+
const modPath = mod.webpackId?.replace(ModuleHashPattern, "") || mod.path?.replace(ModuleHashPattern, "");
|
|
88
|
+
if (!res[modPath]) {
|
|
89
|
+
res[modPath] = {
|
|
90
|
+
path: modPath
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
res[modPath].current = mod;
|
|
94
|
+
});
|
|
95
|
+
return values(res);
|
|
96
|
+
}, [bModules, cModules]);
|
|
97
|
+
const filteredDataSource = useMemo(() => {
|
|
98
|
+
let list = dataSource.slice();
|
|
99
|
+
if (keyword) {
|
|
100
|
+
list = list.filter((e) => e.path.indexOf(keyword) > -1);
|
|
101
|
+
}
|
|
102
|
+
if (selectedUpdateTypes.length) {
|
|
103
|
+
list = list.filter((e) => {
|
|
104
|
+
return includes(selectedUpdateTypes, getUpdateType(e));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return list;
|
|
108
|
+
}, [dataSource, keyword, selectedUpdateTypes]);
|
|
109
|
+
const { bFilteredModulesLength, cFilteredModulesLength } = useMemo(() => {
|
|
110
|
+
return {
|
|
111
|
+
bFilteredModulesLength: filteredDataSource.filter((e) => e.baseline).length,
|
|
112
|
+
cFilteredModulesLength: filteredDataSource.filter((e) => e.current).length
|
|
113
|
+
};
|
|
114
|
+
}, [filteredDataSource]);
|
|
115
|
+
return /* @__PURE__ */ jsxs(Row, { gutter: [Size.BasePadding, Size.BasePadding], children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsxs(Space, { wrap: true, children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
KeywordInput,
|
|
119
|
+
{
|
|
120
|
+
icon: /* @__PURE__ */ jsx(FileSearchOutlined, {}),
|
|
121
|
+
label: "",
|
|
122
|
+
labelStyle: { width: 45 },
|
|
123
|
+
placeholder: "Search by name",
|
|
124
|
+
onChange: (e) => {
|
|
125
|
+
setKeyword(e);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Select,
|
|
131
|
+
{
|
|
132
|
+
mode: "multiple",
|
|
133
|
+
placeholder: "Filter by changed type",
|
|
134
|
+
style: { width: 200 },
|
|
135
|
+
options: values(UpdateType).map((e) => ({ label: e, value: e })),
|
|
136
|
+
allowClear: true,
|
|
137
|
+
onChange: (e) => {
|
|
138
|
+
setSelectedUpdateTypes(e);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] }) }),
|
|
143
|
+
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsx(
|
|
144
|
+
Table,
|
|
145
|
+
{
|
|
146
|
+
bordered: true,
|
|
147
|
+
sticky: { offsetHeader: 54 },
|
|
148
|
+
pagination: {
|
|
149
|
+
pageSize: 20,
|
|
150
|
+
size: "small"
|
|
151
|
+
},
|
|
152
|
+
scroll: { x: 1700 },
|
|
153
|
+
dataSource: filteredDataSource,
|
|
154
|
+
rowKey: (e) => e.path,
|
|
155
|
+
columns: [
|
|
156
|
+
{
|
|
157
|
+
fixed: "left",
|
|
158
|
+
title: /* @__PURE__ */ jsxs(
|
|
159
|
+
Tooltip,
|
|
160
|
+
{
|
|
161
|
+
title: /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
162
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
|
|
163
|
+
"filtered modules is ",
|
|
164
|
+
filteredDataSource.length,
|
|
165
|
+
" (Current & Baseline)"
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
|
|
168
|
+
"total modules is ",
|
|
169
|
+
dataSource.length,
|
|
170
|
+
" (Current & Baseline)"
|
|
171
|
+
] })
|
|
172
|
+
] }),
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Modules" }),
|
|
175
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
176
|
+
/* @__PURE__ */ jsxs(
|
|
177
|
+
Typography.Text,
|
|
178
|
+
{
|
|
179
|
+
type: "secondary",
|
|
180
|
+
style: { fontSize: 10, fontWeight: 400, marginRight: 4 },
|
|
181
|
+
children: [
|
|
182
|
+
filteredDataSource.length,
|
|
183
|
+
"/",
|
|
184
|
+
dataSource.length
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
render: (_v, r) => {
|
|
193
|
+
const { alias, inNodeModules } = beautifyModulePath(
|
|
194
|
+
r.path,
|
|
195
|
+
r.baseline ? bRoot : cRoot
|
|
196
|
+
);
|
|
197
|
+
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
198
|
+
/* @__PURE__ */ jsx(Tooltip, { title: r.path, children: /* @__PURE__ */ jsx(Typography.Text, { copyable: { text: r.path }, children: alias }) }),
|
|
199
|
+
/* @__PURE__ */ jsx(FileUpdateTypeTag, { type: getUpdateType(r) }),
|
|
200
|
+
inNodeModules ? /* @__PURE__ */ jsx(Tag, { color: "warning", children: "node_modules" }) : null
|
|
201
|
+
] });
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
getTargetColumnPropsForModuleRow(
|
|
205
|
+
"current",
|
|
206
|
+
bFilteredModulesLength,
|
|
207
|
+
cFilteredModulesLength
|
|
208
|
+
),
|
|
209
|
+
getTargetColumnPropsForModuleRow(
|
|
210
|
+
"baseline",
|
|
211
|
+
bFilteredModulesLength,
|
|
212
|
+
cFilteredModulesLength
|
|
213
|
+
),
|
|
214
|
+
{
|
|
215
|
+
title: "in Assets",
|
|
216
|
+
render: (_v, r) => {
|
|
217
|
+
const b = [];
|
|
218
|
+
const c = [];
|
|
219
|
+
if (r.current) {
|
|
220
|
+
Graph.getChunksByModule(r.current, cChunks).forEach(
|
|
221
|
+
(e) => e.assets.forEach((asset) => c.push(asset))
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
if (r.baseline) {
|
|
225
|
+
Graph.getChunksByModule(r.baseline, bChunks).forEach(
|
|
226
|
+
(e) => e.assets.forEach((asset) => b.push(asset))
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (!b.length && !c.length)
|
|
230
|
+
return null;
|
|
231
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
232
|
+
uniq(c).filter(Boolean).map((e) => /* @__PURE__ */ jsx(Bdg, { label: "Current", value: e }, `c_${e}`)),
|
|
233
|
+
uniq(b).filter(Boolean).map((e) => /* @__PURE__ */ jsx(Bdg, { label: "Baseline", value: e }, `b_${e}`))
|
|
234
|
+
] });
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
title: "Actions",
|
|
239
|
+
width: 200,
|
|
240
|
+
render: (_v, r) => {
|
|
241
|
+
const isChanged = getUpdateType(r) === UpdateType.Changed;
|
|
242
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { maxWidth: 170 }, children: [
|
|
243
|
+
isChanged ? /* @__PURE__ */ jsx(
|
|
244
|
+
ViewChanges,
|
|
245
|
+
{
|
|
246
|
+
text: "View Changes",
|
|
247
|
+
file: r.path,
|
|
248
|
+
data: [
|
|
249
|
+
{
|
|
250
|
+
baseline: baseline.moduleCodeMap[r.baseline?.id]?.source,
|
|
251
|
+
current: current.moduleCodeMap[r.current?.id]?.source,
|
|
252
|
+
group: "Source"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
baseline: baseline.moduleCodeMap[r.baseline?.id]?.transformed,
|
|
256
|
+
current: current.moduleCodeMap[r.current?.id]?.transformed,
|
|
257
|
+
group: "Transformed Source"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
baseline: baseline.moduleCodeMap[r.baseline?.id]?.parsedSource,
|
|
261
|
+
current: current.moduleCodeMap[r.current?.id]?.parsedSource,
|
|
262
|
+
group: "Parsed Source"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
) : null,
|
|
267
|
+
/* @__PURE__ */ jsx(
|
|
268
|
+
ViewChanges,
|
|
269
|
+
{
|
|
270
|
+
text: "Current Result Viewer",
|
|
271
|
+
file: r.path,
|
|
272
|
+
data: [
|
|
273
|
+
{
|
|
274
|
+
baseline: current.moduleCodeMap[r.current?.id]?.source,
|
|
275
|
+
current: current.moduleCodeMap[r.current?.id]?.transformed,
|
|
276
|
+
baselineTitle: "Current Source",
|
|
277
|
+
currentTitle: "Current Transformed Source",
|
|
278
|
+
group: "Transformed Source"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
baseline: current.moduleCodeMap[r.current?.id]?.source,
|
|
282
|
+
current: current.moduleCodeMap[r.current?.id]?.parsedSource,
|
|
283
|
+
baselineTitle: "Current Source",
|
|
284
|
+
currentTitle: "Current Parsed Source",
|
|
285
|
+
group: "Parsed Source"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
) })
|
|
296
|
+
] });
|
|
297
|
+
};
|
|
298
|
+
export {
|
|
299
|
+
FileUpdateTypeTag,
|
|
300
|
+
Modules,
|
|
301
|
+
getUpdateType
|
|
302
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Space, Table, Tag, Typography } from "antd";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { formatDiffSize } from "./utils";
|
|
5
|
+
import { Color, Size } from "../../../constants";
|
|
6
|
+
import { formatSize } from "../../../utils";
|
|
7
|
+
import { Percent } from "./diff";
|
|
8
|
+
const Overview = ({ assetsDiffResult }) => {
|
|
9
|
+
const dataSource = [
|
|
10
|
+
{
|
|
11
|
+
type: "JS",
|
|
12
|
+
data: assetsDiffResult.js
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: "CSS",
|
|
16
|
+
data: assetsDiffResult.css
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: "Imgs",
|
|
20
|
+
data: assetsDiffResult.imgs
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "Fonts",
|
|
24
|
+
data: assetsDiffResult.fonts
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: "Media",
|
|
28
|
+
data: assetsDiffResult.media
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "HTML",
|
|
32
|
+
data: assetsDiffResult.html
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "Others",
|
|
36
|
+
data: assetsDiffResult.others
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
Table,
|
|
41
|
+
{
|
|
42
|
+
bordered: true,
|
|
43
|
+
pagination: false,
|
|
44
|
+
dataSource,
|
|
45
|
+
rowKey: (v) => v.type,
|
|
46
|
+
style: { marginTop: Size.BasePadding - Size.BasePadding / 4 },
|
|
47
|
+
columns: [
|
|
48
|
+
{
|
|
49
|
+
title: `File Type`,
|
|
50
|
+
dataIndex: "type",
|
|
51
|
+
key: "type",
|
|
52
|
+
render: (v) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: v })
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: `Size`,
|
|
56
|
+
dataIndex: "data",
|
|
57
|
+
key: "size",
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
title: "Current",
|
|
61
|
+
dataIndex: "data",
|
|
62
|
+
key: "csize",
|
|
63
|
+
render: (v) => {
|
|
64
|
+
const total = /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatSize(v.total.size.current) }),
|
|
66
|
+
/* @__PURE__ */ jsx(Percent, { percent: v.total.percent, state: v.total.state }),
|
|
67
|
+
formatDiffSize(
|
|
68
|
+
v.total.size.baseline,
|
|
69
|
+
v.total.size.current,
|
|
70
|
+
v.total.state
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
if (v.initial) {
|
|
74
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Total" }),
|
|
77
|
+
total
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Initial" }),
|
|
81
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatSize(v.initial.size.current) }),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
Percent,
|
|
84
|
+
{
|
|
85
|
+
percent: v.initial.percent,
|
|
86
|
+
state: v.initial.state
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
formatDiffSize(
|
|
90
|
+
v.initial.size.baseline,
|
|
91
|
+
v.initial.size.current,
|
|
92
|
+
v.initial.state
|
|
93
|
+
)
|
|
94
|
+
] })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
return /* @__PURE__ */ jsx(Space, { children: total });
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: "Baseline",
|
|
102
|
+
dataIndex: "data",
|
|
103
|
+
key: "bsize",
|
|
104
|
+
render: (v) => {
|
|
105
|
+
const total = /* @__PURE__ */ jsx(Typography.Text, { children: formatSize(v.total.size.baseline) });
|
|
106
|
+
if (v.initial) {
|
|
107
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
108
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Total" }),
|
|
110
|
+
total
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
113
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Initial" }),
|
|
114
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: formatSize(v.initial.size.baseline) })
|
|
115
|
+
] })
|
|
116
|
+
] });
|
|
117
|
+
}
|
|
118
|
+
return total;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: `Count`,
|
|
125
|
+
dataIndex: "data",
|
|
126
|
+
key: "count",
|
|
127
|
+
children: [
|
|
128
|
+
{
|
|
129
|
+
title: "Current",
|
|
130
|
+
dataIndex: "data",
|
|
131
|
+
key: "ccount",
|
|
132
|
+
render: (v) => {
|
|
133
|
+
const total = /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: v.total.count.current });
|
|
134
|
+
if (v.initial) {
|
|
135
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
136
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
137
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Total" }),
|
|
138
|
+
total
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
141
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Initial" }),
|
|
142
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: v.initial.count.current })
|
|
143
|
+
] })
|
|
144
|
+
] });
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ jsx(Space, { children: total });
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: "Baseline",
|
|
151
|
+
dataIndex: "data",
|
|
152
|
+
key: "bcount",
|
|
153
|
+
render: (v) => {
|
|
154
|
+
const total = /* @__PURE__ */ jsx(Typography.Text, { children: v.total.count.baseline });
|
|
155
|
+
if (v.initial) {
|
|
156
|
+
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
157
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
158
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Total" }),
|
|
159
|
+
total
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Tag, { color: Color.Blue, children: "Initial" }),
|
|
163
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: v.initial.count.baseline })
|
|
164
|
+
] })
|
|
165
|
+
] });
|
|
166
|
+
}
|
|
167
|
+
return /* @__PURE__ */ jsx(Space, { children: total });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
export {
|
|
177
|
+
Overview
|
|
178
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { UpdateType } from './constants';
|
|
4
|
+
export declare const PackagesStatistic: React.FC<{
|
|
5
|
+
dataSource: ReturnType<typeof getPackagesTableDataSource>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const getPackagesTableDataSource: ({ baseline, current, }: {
|
|
8
|
+
baseline: SDK.PackageGraphData;
|
|
9
|
+
current: SDK.PackageGraphData;
|
|
10
|
+
}) => {
|
|
11
|
+
updateType: UpdateType;
|
|
12
|
+
name: string;
|
|
13
|
+
baseline?: SDK.PackageData[] | undefined;
|
|
14
|
+
current?: SDK.PackageData[] | undefined;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const Packages: React.FC<{
|
|
17
|
+
baseline: SDK.PackageGraphData;
|
|
18
|
+
current: SDK.PackageGraphData;
|
|
19
|
+
}>;
|