@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,70 @@
|
|
|
1
|
+
.errorNumber_3c2f5,
|
|
2
|
+
.warningNumber_3c2f5,
|
|
3
|
+
.successNumber_3c2f5 {
|
|
4
|
+
font-size: 36px;
|
|
5
|
+
font-weight: 500;
|
|
6
|
+
line-height: 54px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.errorNumber_3c2f5,
|
|
10
|
+
.errorText_3c2f5 {
|
|
11
|
+
color: #f5222d;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.warningNumber_3c2f5,
|
|
15
|
+
.warningText_3c2f5 {
|
|
16
|
+
color: #fa8c16;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.successNumber_3c2f5,
|
|
20
|
+
.successText_3c2f5 {
|
|
21
|
+
color: #52c41a;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.errorButton_3c2f5,
|
|
25
|
+
.warningButton_3c2f5,
|
|
26
|
+
.successButton_3c2f5 {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 90px !important;
|
|
29
|
+
color: inherit;
|
|
30
|
+
font-size: inherit !important;
|
|
31
|
+
padding: 4px 0 8px !important;
|
|
32
|
+
border-radius: 12px !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.errorButton_3c2f5 {
|
|
36
|
+
background-color: rgba(245, 34, 45, 0.08);
|
|
37
|
+
}
|
|
38
|
+
.errorButton_3c2f5:hover {
|
|
39
|
+
background-color: rgba(245, 34, 45, 0.15) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.warningButton_3c2f5 {
|
|
43
|
+
background-color: rgba(250, 139, 22, 0.08);
|
|
44
|
+
}
|
|
45
|
+
.warningButton_3c2f5:hover {
|
|
46
|
+
background-color: rgba(250, 139, 22, 0.15) !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.successButton_3c2f5 {
|
|
50
|
+
background-color: rgba(82, 196, 26, 0.08);
|
|
51
|
+
}
|
|
52
|
+
.successButton_3c2f5:hover {
|
|
53
|
+
background-color: rgba(82, 196, 26, 0.15) !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.errorText_3c2f5,
|
|
57
|
+
.warningText_3c2f5,
|
|
58
|
+
.successText_3c2f5 {
|
|
59
|
+
opacity: 0.75;
|
|
60
|
+
font-size: 13px;
|
|
61
|
+
padding-bottom: 6px;
|
|
62
|
+
margin-top: -2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.container_3c2f5 {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
margin-bottom: 16px;
|
|
70
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Space, Typography, Tag, Row, Col, Descriptions } from "antd";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Client, SDK } from "@rsdoctor/types";
|
|
5
|
+
import { ExceptionOutlined } from "@ant-design/icons";
|
|
6
|
+
import { useNavigate } from "react-router-dom";
|
|
7
|
+
import { createFileStructures, formatSize, useDuplicatePackagesByErrors, useI18n } from "../../utils";
|
|
8
|
+
import { DuplicatePackageDrawerWithServer, TextDrawer } from "../TextDrawer";
|
|
9
|
+
import { Card } from "../Card";
|
|
10
|
+
import { ServerAPIProvider } from "../Manifest";
|
|
11
|
+
import { FileTree } from "../FileTree";
|
|
12
|
+
import listStyles from "./list.module";
|
|
13
|
+
import cardStyles from "./card.module";
|
|
14
|
+
import numberButtonStyles from "./NumberButton.module";
|
|
15
|
+
import { NumberButton } from "./NumberButton";
|
|
16
|
+
const getFilesWithDrawer = (data) => {
|
|
17
|
+
const fileStructures = useMemo(() => {
|
|
18
|
+
if (!data.files.length)
|
|
19
|
+
return [];
|
|
20
|
+
return createFileStructures({
|
|
21
|
+
files: data.files.map((e) => e.path),
|
|
22
|
+
fileTitle(file, basename) {
|
|
23
|
+
const { size, initial } = data.files.find((e) => e.path === file);
|
|
24
|
+
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: basename }),
|
|
26
|
+
/* @__PURE__ */ jsx(Tag, { color: "success", style: { marginRight: 0 }, children: formatSize(size) }),
|
|
27
|
+
initial ? /* @__PURE__ */ jsx(Tag, { color: "cyan", children: "Initial" }) : null
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}, [data.files]);
|
|
32
|
+
return /* @__PURE__ */ jsx(Fragment, { children: data.files.length ? /* @__PURE__ */ jsx(
|
|
33
|
+
TextDrawer,
|
|
34
|
+
{
|
|
35
|
+
buttonProps: {
|
|
36
|
+
size: "small"
|
|
37
|
+
},
|
|
38
|
+
buttonStyle: {
|
|
39
|
+
fontSize: "inherit"
|
|
40
|
+
},
|
|
41
|
+
text: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
data.count,
|
|
43
|
+
" ",
|
|
44
|
+
/* @__PURE__ */ jsx(ExceptionOutlined, {})
|
|
45
|
+
] }),
|
|
46
|
+
children: /* @__PURE__ */ jsx(FileTree, { treeData: fileStructures, defaultExpandAll: true })
|
|
47
|
+
}
|
|
48
|
+
) : data.count });
|
|
49
|
+
};
|
|
50
|
+
const BundleDescriptions = ({ res }) => {
|
|
51
|
+
const items = [
|
|
52
|
+
{
|
|
53
|
+
key: "total-files-count",
|
|
54
|
+
label: "Total files",
|
|
55
|
+
children: res.all.total.count
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "total-files-size",
|
|
59
|
+
label: "",
|
|
60
|
+
children: ""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "js-files-count",
|
|
64
|
+
label: "JS files",
|
|
65
|
+
children: getFilesWithDrawer(res.js.total)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "js-files-size",
|
|
69
|
+
label: "JS size",
|
|
70
|
+
children: formatSize(res.js.total.size)
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "css-files-count",
|
|
74
|
+
label: "CSS files",
|
|
75
|
+
children: getFilesWithDrawer(res.css.total)
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "css-files-size",
|
|
79
|
+
label: "CSS size",
|
|
80
|
+
children: formatSize(res.css.total.size)
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "font-files-count",
|
|
84
|
+
label: "Font files",
|
|
85
|
+
children: getFilesWithDrawer(res.fonts.total)
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "font-files-size",
|
|
89
|
+
label: "Font size",
|
|
90
|
+
children: formatSize(res.fonts.total.size)
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "html-files-count",
|
|
94
|
+
label: "HTML files",
|
|
95
|
+
children: getFilesWithDrawer(res.html.total)
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "html-files-size",
|
|
99
|
+
label: "HTML size",
|
|
100
|
+
children: formatSize(res.html.total.size)
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "image-files-count",
|
|
104
|
+
label: "Image files",
|
|
105
|
+
children: getFilesWithDrawer(res.imgs.total)
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "image-files-size",
|
|
109
|
+
label: "Image size",
|
|
110
|
+
children: formatSize(res.imgs.total.size)
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: "media-files-count",
|
|
114
|
+
label: "Media files",
|
|
115
|
+
children: getFilesWithDrawer(res.media.total)
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: "media-files-size",
|
|
119
|
+
label: "Media size",
|
|
120
|
+
children: formatSize(res.media.total.size)
|
|
121
|
+
}
|
|
122
|
+
];
|
|
123
|
+
return /* @__PURE__ */ jsx(Descriptions, { className: listStyles.root, size: "small", column: 2, items });
|
|
124
|
+
};
|
|
125
|
+
const BundleOverall = ({ errors, cwd }) => {
|
|
126
|
+
const { t } = useI18n();
|
|
127
|
+
const navigate = useNavigate();
|
|
128
|
+
const duplicatePackages = useDuplicatePackagesByErrors(errors);
|
|
129
|
+
return /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetAssetsSummary, body: { withFileContent: false }, children: (res) => {
|
|
130
|
+
const totalSizeStr = formatSize(res.all.total.size);
|
|
131
|
+
return /* @__PURE__ */ jsxs(Card, { title: t("Bundle Overall"), className: cardStyles.card, children: [
|
|
132
|
+
/* @__PURE__ */ jsxs(Row, { gutter: 16, children: [
|
|
133
|
+
/* @__PURE__ */ jsx(Col, { span: 12, className: numberButtonStyles.container, children: /* @__PURE__ */ jsx(
|
|
134
|
+
NumberButton,
|
|
135
|
+
{
|
|
136
|
+
theme: "success",
|
|
137
|
+
number: totalSizeStr,
|
|
138
|
+
description: "Total Size",
|
|
139
|
+
numberFontSize: "30px",
|
|
140
|
+
onClick: () => {
|
|
141
|
+
navigate(Client.RsdoctorClientRoutes.BundleSize);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
) }),
|
|
145
|
+
/* @__PURE__ */ jsx(Col, { span: 12, className: numberButtonStyles.container, children: /* @__PURE__ */ jsx(
|
|
146
|
+
DuplicatePackageDrawerWithServer,
|
|
147
|
+
{
|
|
148
|
+
cwd,
|
|
149
|
+
duplicatePackages,
|
|
150
|
+
button: /* @__PURE__ */ jsx(
|
|
151
|
+
NumberButton,
|
|
152
|
+
{
|
|
153
|
+
theme: duplicatePackages.length === 0 ? "success" : "warning",
|
|
154
|
+
number: duplicatePackages.length,
|
|
155
|
+
description: "Duplicate Packages"
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
) })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsx(BundleDescriptions, { res })
|
|
162
|
+
] });
|
|
163
|
+
} });
|
|
164
|
+
};
|
|
165
|
+
export {
|
|
166
|
+
BundleOverall
|
|
167
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Summary } from "@rsdoctor/utils/common";
|
|
3
|
+
import { Divider, Progress, Space, Typography } from "antd";
|
|
4
|
+
import { formatCosts, useI18n } from "../../utils";
|
|
5
|
+
import { Card } from "../Card";
|
|
6
|
+
import { BootstrapChartContainer } from "../Charts/bootstrap";
|
|
7
|
+
import { DoneChartContainer } from "../Charts/done";
|
|
8
|
+
import { MinifyChartContainer } from "../Charts/minify";
|
|
9
|
+
import cardStyles from "./card.module";
|
|
10
|
+
import styles from "./compile.module";
|
|
11
|
+
const Stage = ({ children, name, showDivider = true }) => {
|
|
12
|
+
return /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { color: "inherit" }, children: name }),
|
|
14
|
+
showDivider ? /* @__PURE__ */ jsx(Divider, { type: "vertical" }) : null,
|
|
15
|
+
children
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
const getProgressColor = (percent) => {
|
|
19
|
+
if (percent < 33.3) {
|
|
20
|
+
return { "0%": "#95de64", "100%": "#5cdbd3" };
|
|
21
|
+
}
|
|
22
|
+
return { "0%": "#ff9c6e", "100%": "#ff7875" };
|
|
23
|
+
};
|
|
24
|
+
const CompileOverall = ({ summary }) => {
|
|
25
|
+
const { t } = useI18n();
|
|
26
|
+
if (!summary?.costs?.length)
|
|
27
|
+
return null;
|
|
28
|
+
const maxCosts = Math.max(...summary.costs.map((item) => item.costs));
|
|
29
|
+
return /* @__PURE__ */ jsx(Card, { title: t("Compile Overall"), className: cardStyles.card, children: /* @__PURE__ */ jsx(Space, { style: { wordBreak: "break-all", width: "100%" }, size: 20, direction: "vertical", children: summary.costs.map((e) => {
|
|
30
|
+
const { name, costs } = e;
|
|
31
|
+
const percent = costs * 100 / maxCosts;
|
|
32
|
+
const ProgressBar = /* @__PURE__ */ jsx(
|
|
33
|
+
Progress,
|
|
34
|
+
{
|
|
35
|
+
className: styles.progress,
|
|
36
|
+
percent,
|
|
37
|
+
status: "normal",
|
|
38
|
+
strokeColor: getProgressColor(percent),
|
|
39
|
+
format: () => formatCosts(costs)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
switch (name) {
|
|
43
|
+
case Summary.SummaryCostsDataName.Bootstrap:
|
|
44
|
+
return /* @__PURE__ */ jsxs(Stage, { name: "Bootstrap ~ BeforeCompile", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(BootstrapChartContainer, { summary }),
|
|
46
|
+
ProgressBar
|
|
47
|
+
] }, name);
|
|
48
|
+
case Summary.SummaryCostsDataName.Compile:
|
|
49
|
+
return /* @__PURE__ */ jsx(Stage, { name: "Compile", showDivider: false, children: ProgressBar }, name);
|
|
50
|
+
case Summary.SummaryCostsDataName.Done:
|
|
51
|
+
return /* @__PURE__ */ jsxs(Stage, { name: "AfterCompile ~ Done", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(DoneChartContainer, { summary }),
|
|
53
|
+
ProgressBar
|
|
54
|
+
] }, name);
|
|
55
|
+
case Summary.SummaryCostsDataName.Minify:
|
|
56
|
+
return /* @__PURE__ */ jsxs(Stage, { name: "Minify", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(MinifyChartContainer, { summary }),
|
|
58
|
+
ProgressBar
|
|
59
|
+
] }, name);
|
|
60
|
+
default:
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}) }) });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
CompileOverall
|
|
67
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Space, Row, Col, Descriptions } from "antd";
|
|
3
|
+
import { filter } from "lodash-es";
|
|
4
|
+
import { useI18n } from "../../utils";
|
|
5
|
+
import { WebpackConfigurationViewer } from "../Configuration";
|
|
6
|
+
import { Card } from "../Card";
|
|
7
|
+
import listStyles from "./list.module";
|
|
8
|
+
import cardStyles from "./card.module";
|
|
9
|
+
import numberButtonStyles from "./NumberButton.module";
|
|
10
|
+
import { TextDrawer } from "../TextDrawer";
|
|
11
|
+
import { BundleAlerts, CompileAlerts, OverlayAlertsWithTips } from "../Alerts";
|
|
12
|
+
import { NumberButton } from "./NumberButton";
|
|
13
|
+
const ProjectOverall = ({ configs = [], cwd, envinfo, alerts = [] }) => {
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
const warns = filter(alerts, (e) => e.level === "warn").length;
|
|
16
|
+
const errors = alerts.length - warns;
|
|
17
|
+
const items = [
|
|
18
|
+
...Object.keys(envinfo).map((key) => {
|
|
19
|
+
const regexp = /Version$/;
|
|
20
|
+
const isVersion = regexp.test(key);
|
|
21
|
+
return {
|
|
22
|
+
key,
|
|
23
|
+
label: isVersion ? key.replace(regexp, "") : key,
|
|
24
|
+
children: envinfo ? envinfo[key] : void 0
|
|
25
|
+
};
|
|
26
|
+
}),
|
|
27
|
+
...configs.filter((item) => !!item.version).map((config) => {
|
|
28
|
+
const { name, version } = config;
|
|
29
|
+
return {
|
|
30
|
+
key: name,
|
|
31
|
+
label: name,
|
|
32
|
+
children: version
|
|
33
|
+
};
|
|
34
|
+
}),
|
|
35
|
+
{
|
|
36
|
+
key: "cwd",
|
|
37
|
+
label: "cwd",
|
|
38
|
+
children: cwd
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
return /* @__PURE__ */ jsxs(Card, { title: t("Project Overall"), extra: /* @__PURE__ */ jsx(WebpackConfigurationViewer, {}), className: cardStyles.card, children: [
|
|
42
|
+
/* @__PURE__ */ jsxs(Row, { gutter: 16, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Col, { span: 12, className: numberButtonStyles.container, children: /* @__PURE__ */ jsx(
|
|
44
|
+
TextDrawer,
|
|
45
|
+
{
|
|
46
|
+
button: /* @__PURE__ */ jsx(NumberButton, { theme: errors === 0 ? "success" : "error", number: errors, description: "Errors" }),
|
|
47
|
+
drawerProps: { title: "Errors List" },
|
|
48
|
+
children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
|
|
49
|
+
/* @__PURE__ */ jsx(OverlayAlertsWithTips, { defaultOpen: false }),
|
|
50
|
+
/* @__PURE__ */ jsx(BundleAlerts, { filter: (r) => r.level === "error" }),
|
|
51
|
+
/* @__PURE__ */ jsx(CompileAlerts, { filter: (r) => r.level === "error" })
|
|
52
|
+
] })
|
|
53
|
+
}
|
|
54
|
+
) }),
|
|
55
|
+
/* @__PURE__ */ jsx(Col, { span: 12, className: numberButtonStyles.container, children: /* @__PURE__ */ jsx(
|
|
56
|
+
TextDrawer,
|
|
57
|
+
{
|
|
58
|
+
button: /* @__PURE__ */ jsx(NumberButton, { theme: warns === 0 ? "success" : "warning", number: warns, description: "Warnings" }),
|
|
59
|
+
drawerProps: { title: "Warnings List" },
|
|
60
|
+
children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
|
|
61
|
+
/* @__PURE__ */ jsx(OverlayAlertsWithTips, { defaultOpen: false }),
|
|
62
|
+
/* @__PURE__ */ jsx(BundleAlerts, { filter: (r) => r.level === "warn" }),
|
|
63
|
+
/* @__PURE__ */ jsx(CompileAlerts, { filter: (r) => r.level === "warn" })
|
|
64
|
+
] })
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsx(Descriptions, { className: listStyles.root, items, size: "small", column: 1 })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
ProjectOverall
|
|
73
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
interface WebpackPluginsTableDataItem {
|
|
4
|
+
tapName: string;
|
|
5
|
+
hook: string;
|
|
6
|
+
key: string;
|
|
7
|
+
hookData: SDK.PluginHookData[];
|
|
8
|
+
}
|
|
9
|
+
export interface WebpackPluginsDataTableProps {
|
|
10
|
+
dataSource: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginData>;
|
|
11
|
+
}
|
|
12
|
+
export declare function useWebpackPluginsDataSource(plugin: SDK.PluginData, selectedTapNames: string[], selectedHooks: string[]): {
|
|
13
|
+
dataSource: WebpackPluginsTableDataItem[];
|
|
14
|
+
tapNames: string[];
|
|
15
|
+
hooks: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare const WebpackPluginsDataTable: React.FC<WebpackPluginsDataTableProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Table, Tooltip } from "antd";
|
|
4
|
+
import { flatten, includes, map, sumBy, uniq, values } from "lodash-es";
|
|
5
|
+
import { formatCosts } from "../../utils";
|
|
6
|
+
function useWebpackPluginsDataSource(plugin, selectedTapNames, selectedHooks) {
|
|
7
|
+
const tapNames = useMemo(() => uniq(map(flatten(values(plugin)), (e) => e.tapName)), [plugin]);
|
|
8
|
+
const hooks = useMemo(() => Object.keys(plugin), [plugin]);
|
|
9
|
+
const dataSource = useMemo(() => {
|
|
10
|
+
if (!tapNames.length)
|
|
11
|
+
return [];
|
|
12
|
+
return tapNames.reduce((total, tapName) => {
|
|
13
|
+
if (selectedTapNames.length && !includes(selectedTapNames, tapName)) {
|
|
14
|
+
return total;
|
|
15
|
+
}
|
|
16
|
+
hooks.forEach((hook) => {
|
|
17
|
+
if (selectedHooks.length && !includes(selectedHooks, hook)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const hookData = plugin[hook].filter((e) => e.tapName === tapName);
|
|
21
|
+
if (hookData.length === 0)
|
|
22
|
+
return;
|
|
23
|
+
total.push({
|
|
24
|
+
tapName,
|
|
25
|
+
hook,
|
|
26
|
+
key: `${tapName}${hook}`,
|
|
27
|
+
hookData
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return total;
|
|
31
|
+
}, []);
|
|
32
|
+
}, [plugin, selectedTapNames, selectedHooks]);
|
|
33
|
+
return {
|
|
34
|
+
dataSource,
|
|
35
|
+
tapNames,
|
|
36
|
+
hooks
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const WebpackPluginsDataTable = ({ dataSource }) => {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
Table,
|
|
42
|
+
{
|
|
43
|
+
dataSource,
|
|
44
|
+
rowKey: (v) => `${v.tapName}_${v.hook}`,
|
|
45
|
+
columns: [
|
|
46
|
+
{
|
|
47
|
+
title: `Plugin Tap Name`,
|
|
48
|
+
render: (_v, r) => r.tapName
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: `Hook`,
|
|
52
|
+
render: (_v, r) => r.hook
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: "calls",
|
|
56
|
+
render: (_v, r) => /* @__PURE__ */ jsx(Tooltip, { title: `"${r.hook}" has been called ${r.data.length} times by "${r.tapName}"`, children: r.data.length }),
|
|
57
|
+
sorter(a, b) {
|
|
58
|
+
return a.data.length - b.data.length;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: "duration(total)",
|
|
63
|
+
render: (_v, r) => formatCosts(sumBy(r.data, (e) => e.costs)),
|
|
64
|
+
sorter(a, b) {
|
|
65
|
+
return sumBy(a.data, (e) => e.costs) - sumBy(b.data, (e) => e.costs);
|
|
66
|
+
},
|
|
67
|
+
defaultSortOrder: "descend"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
WebpackPluginsDataTable,
|
|
75
|
+
useWebpackPluginsDataSource
|
|
76
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
export declare const ResolverFiles: React.FC<{
|
|
4
|
+
filename: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
resolver: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileTree>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ResolverAnalysisBase: React.FC<{
|
|
9
|
+
project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const ResolverAnalysis: React.FC<Omit<{
|
|
12
|
+
project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
|
|
13
|
+
}, "project"> & Partial<{
|
|
14
|
+
body?: any;
|
|
15
|
+
}>>;
|