@module-federation/devtools 0.0.0-next-20250925034616 → 0.0.0-perf-devtools-20260106124142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/App.js +328 -22
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +291 -5
- package/dist/es/component/DependencyGraph/index.js +205 -0
- package/dist/es/component/DependencyGraph/index.module.js +5 -0
- package/dist/es/component/DependencyGraph/index_module.css +97 -0
- package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
- package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
- package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/es/component/Form/index.js +191 -109
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +179 -25
- package/dist/es/component/Layout/index.js +288 -51
- package/dist/es/component/Layout/index.module.js +1 -1
- package/dist/es/component/Layout/index_module.css +52 -32
- package/dist/es/component/ModuleInfo/index.js +289 -0
- package/dist/es/component/ModuleInfo/index.module.js +5 -0
- package/dist/es/component/ModuleInfo/index_module.css +183 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +39 -0
- package/dist/es/component/SharedDepsExplorer/index.js +505 -0
- package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
- package/dist/es/index.css +15 -0
- package/dist/es/template/constant.js +5 -19
- package/dist/es/utils/chrome/fast-refresh.js +80 -7
- package/dist/es/utils/chrome/index.js +91 -38
- package/dist/es/utils/chrome/messages.js +6 -0
- package/dist/es/utils/chrome/post-message-listener.js +2 -1
- package/dist/es/utils/chrome/post-message-start.js +10 -2
- package/dist/es/utils/chrome/storage.js +6 -1
- package/dist/es/utils/sdk/graph.js +25 -4
- package/dist/es/utils/sdk/index.js +9 -0
- package/dist/es/worker/index.js +168 -1
- package/dist/lib/App.js +318 -17
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +291 -5
- package/dist/lib/component/DependencyGraph/index.js +227 -0
- package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraph/index_module.css +97 -0
- package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
- package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/lib/component/Form/index.js +188 -107
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +179 -25
- package/dist/lib/component/Layout/index.js +280 -48
- package/dist/lib/component/Layout/index.module.js +1 -1
- package/dist/lib/component/Layout/index_module.css +52 -32
- package/dist/lib/component/ModuleInfo/index.js +319 -0
- package/dist/lib/component/ModuleInfo/index.module.js +25 -0
- package/dist/lib/component/ModuleInfo/index_module.css +183 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +59 -0
- package/dist/lib/component/SharedDepsExplorer/index.js +512 -0
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
- package/dist/lib/index.css +15 -0
- package/dist/lib/template/constant.js +7 -17
- package/dist/lib/utils/chrome/fast-refresh.js +77 -8
- package/dist/lib/utils/chrome/index.js +94 -38
- package/dist/lib/utils/chrome/messages.js +31 -0
- package/dist/lib/utils/chrome/post-message-listener.js +2 -1
- package/dist/lib/utils/chrome/post-message-start.js +10 -2
- package/dist/lib/utils/chrome/storage.js +5 -0
- package/dist/lib/utils/sdk/graph.js +25 -4
- package/dist/lib/utils/sdk/index.js +10 -0
- package/dist/lib/worker/index.js +156 -1
- package/dist/types/src/App.d.ts +0 -1
- package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
- package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
- package/dist/types/src/component/Form/index.d.ts +2 -0
- package/dist/types/src/component/Layout/index.d.ts +0 -1
- package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
- package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
- package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
- package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/init.d.ts +0 -1
- package/dist/types/src/template/constant.d.ts +3 -5
- package/dist/types/src/utils/chrome/index.d.ts +5 -3
- package/dist/types/src/utils/chrome/messages.d.ts +2 -0
- package/dist/types/src/utils/chrome/storage.d.ts +5 -4
- package/dist/types/src/utils/sdk/graph.d.ts +2 -1
- package/dist/types/src/utils/sdk/index.d.ts +1 -0
- package/dist/types/src/utils/types/common.d.ts +4 -0
- package/dist/types/src/worker/index.d.ts +1 -0
- package/package.json +18 -14
- package/dist/es/component/Graph/index.js +0 -127
- package/dist/es/component/Graph/index.module.js +0 -5
- package/dist/es/component/Graph/index_module.css +0 -12
- package/dist/es/component/GraphItem/index.module.js +0 -5
- package/dist/es/component/GraphItem/index_module.css +0 -61
- package/dist/lib/component/Graph/index.js +0 -149
- package/dist/lib/component/Graph/index_module.css +0 -12
- package/dist/lib/component/GraphItem/index_module.css +0 -61
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { useEffect, useMemo, useState } from "react";
|
|
23
|
+
import {
|
|
24
|
+
Box,
|
|
25
|
+
Layers,
|
|
26
|
+
Network,
|
|
27
|
+
Package2,
|
|
28
|
+
Repeat,
|
|
29
|
+
Search,
|
|
30
|
+
Server
|
|
31
|
+
} from "lucide-react";
|
|
32
|
+
import {
|
|
33
|
+
Card,
|
|
34
|
+
Tag,
|
|
35
|
+
Table,
|
|
36
|
+
Input,
|
|
37
|
+
Select,
|
|
38
|
+
Collapse,
|
|
39
|
+
Popover,
|
|
40
|
+
Button
|
|
41
|
+
} from "@arco-design/web-react";
|
|
42
|
+
import {
|
|
43
|
+
normalizeShareData,
|
|
44
|
+
computeShareStats,
|
|
45
|
+
getFilterOptions,
|
|
46
|
+
groupByProviderScopePackage,
|
|
47
|
+
findPackageProvider
|
|
48
|
+
} from "./share-utils";
|
|
49
|
+
import FocusResultDisplay from "./FocusResultDisplay";
|
|
50
|
+
const ALL_VALUE = "__all__";
|
|
51
|
+
function loadedStatusLabel(status) {
|
|
52
|
+
if (status === "loaded") {
|
|
53
|
+
return "Loaded";
|
|
54
|
+
}
|
|
55
|
+
if (status === "loading") {
|
|
56
|
+
return "Loading";
|
|
57
|
+
}
|
|
58
|
+
return "Not Loaded";
|
|
59
|
+
}
|
|
60
|
+
function SharedDepsExplorer({
|
|
61
|
+
shareData: shareDataProp
|
|
62
|
+
}) {
|
|
63
|
+
const [normalized, setNormalized] = useState([]);
|
|
64
|
+
const [loadingState, setLoadingState] = useState("idle");
|
|
65
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
66
|
+
const [selectedProvider, setSelectedProvider] = useState("");
|
|
67
|
+
const [selectedPackage, setSelectedPackage] = useState("");
|
|
68
|
+
const [selectedVersion, setSelectedVersion] = useState("");
|
|
69
|
+
const [searchText, setSearchText] = useState("");
|
|
70
|
+
const [chartScope, setChartScope] = useState("default");
|
|
71
|
+
const [focusPackage, setFocusPackage] = useState("react");
|
|
72
|
+
const [focusVersion, setFocusVersion] = useState("");
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
let cancelled = false;
|
|
75
|
+
function bootstrap() {
|
|
76
|
+
return __async(this, null, function* () {
|
|
77
|
+
if (shareDataProp && Object.keys(shareDataProp).length > 0) {
|
|
78
|
+
const versions = normalizeShareData(shareDataProp);
|
|
79
|
+
if (!cancelled) {
|
|
80
|
+
setNormalized(versions);
|
|
81
|
+
setLoadingState("idle");
|
|
82
|
+
setErrorMessage(null);
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!cancelled) {
|
|
87
|
+
setLoadingState("idle");
|
|
88
|
+
setErrorMessage(null);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
bootstrap();
|
|
93
|
+
return () => {
|
|
94
|
+
cancelled = true;
|
|
95
|
+
};
|
|
96
|
+
}, [shareDataProp]);
|
|
97
|
+
const stats = useMemo(() => computeShareStats(normalized), [normalized]);
|
|
98
|
+
const filterOptions = useMemo(
|
|
99
|
+
() => getFilterOptions(normalized),
|
|
100
|
+
[normalized]
|
|
101
|
+
);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const { scopes } = filterOptions;
|
|
104
|
+
if (!scopes.length) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!scopes.includes(chartScope)) {
|
|
108
|
+
if (scopes.includes("default")) {
|
|
109
|
+
setChartScope("default");
|
|
110
|
+
} else {
|
|
111
|
+
setChartScope(scopes[0]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, [filterOptions.scopes, chartScope]);
|
|
115
|
+
const filteredVersions = useMemo(() => {
|
|
116
|
+
const keyword = searchText.trim().toLowerCase();
|
|
117
|
+
return normalized.filter((v) => {
|
|
118
|
+
if (selectedProvider && v.from !== selectedProvider) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (selectedPackage && v.packageName !== selectedPackage) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
if (selectedVersion && v.version !== selectedVersion) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (keyword && !v.packageName.toLowerCase().includes(keyword)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
}, [
|
|
133
|
+
normalized,
|
|
134
|
+
selectedProvider,
|
|
135
|
+
selectedPackage,
|
|
136
|
+
selectedVersion,
|
|
137
|
+
searchText
|
|
138
|
+
]);
|
|
139
|
+
const tree = useMemo(
|
|
140
|
+
() => groupByProviderScopePackage(filteredVersions),
|
|
141
|
+
[filteredVersions]
|
|
142
|
+
);
|
|
143
|
+
const versionsForSelectedPackage = useMemo(() => {
|
|
144
|
+
if (!selectedPackage) {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
const set = /* @__PURE__ */ new Set();
|
|
148
|
+
normalized.forEach((v) => {
|
|
149
|
+
if (v.packageName === selectedPackage) {
|
|
150
|
+
set.add(v.version);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return Array.from(set).sort();
|
|
154
|
+
}, [normalized, selectedPackage]);
|
|
155
|
+
const focusVersionsForPackage = useMemo(() => {
|
|
156
|
+
if (!focusPackage) {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
const set = /* @__PURE__ */ new Set();
|
|
160
|
+
normalized.forEach((v) => {
|
|
161
|
+
if (v.packageName === focusPackage) {
|
|
162
|
+
set.add(v.version);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return Array.from(set).sort();
|
|
166
|
+
}, [normalized, focusPackage]);
|
|
167
|
+
const focusResult = useMemo(() => {
|
|
168
|
+
if (!focusPackage) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
return findPackageProvider(
|
|
172
|
+
normalized,
|
|
173
|
+
focusPackage,
|
|
174
|
+
focusVersion || void 0
|
|
175
|
+
);
|
|
176
|
+
}, [normalized, focusPackage, focusVersion]);
|
|
177
|
+
const hasData = normalized.length > 0;
|
|
178
|
+
const columns = [
|
|
179
|
+
{
|
|
180
|
+
title: "Package / Version",
|
|
181
|
+
width: "28%",
|
|
182
|
+
render: (_, item) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "break-all font-mono text-[11px] text-zinc-800", children: item.packageName }),
|
|
184
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 text-[11px] text-zinc-500", children: [
|
|
185
|
+
"v",
|
|
186
|
+
item.version
|
|
187
|
+
] })
|
|
188
|
+
] })
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
title: "Provider / Scope",
|
|
192
|
+
width: "20%",
|
|
193
|
+
render: (_, item) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
194
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", title: item.from, children: [
|
|
195
|
+
"Provider: ",
|
|
196
|
+
item.from
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[11px] text-zinc-500", children: [
|
|
199
|
+
"scope: ",
|
|
200
|
+
item.scope
|
|
201
|
+
] })
|
|
202
|
+
] })
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: "Status",
|
|
206
|
+
width: "22%",
|
|
207
|
+
render: (_, item) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
208
|
+
["loaded", "loading"].includes(item.loadedStatus) ? /* @__PURE__ */ jsx(
|
|
209
|
+
Tag,
|
|
210
|
+
{
|
|
211
|
+
size: "small",
|
|
212
|
+
className: `w-16 flex items-center justify-center loaded-status-tag`,
|
|
213
|
+
children: loadedStatusLabel(item.loadedStatus)
|
|
214
|
+
}
|
|
215
|
+
) : null,
|
|
216
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 flex flex-wrap gap-1 text-[10px] text-zinc-500", children: [
|
|
217
|
+
item.shareConfig.singleton && /* @__PURE__ */ jsx(Tag, { size: "small", className: "scale-90 origin-left", children: "singleton" }),
|
|
218
|
+
item.shareConfig.eager && /* @__PURE__ */ jsx(Tag, { size: "small", className: "scale-90 origin-left", children: "eager" }),
|
|
219
|
+
item.shareConfig.strictVersion && /* @__PURE__ */ jsx(Tag, { size: "small", className: "scale-90 origin-left", children: "strictVersion" }),
|
|
220
|
+
item.shareConfig.requiredVersion && /* @__PURE__ */ jsxs(Tag, { size: "small", className: "scale-90 origin-left", children: [
|
|
221
|
+
"req: ",
|
|
222
|
+
item.shareConfig.requiredVersion
|
|
223
|
+
] })
|
|
224
|
+
] })
|
|
225
|
+
] })
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: "Consumers",
|
|
229
|
+
width: "18%",
|
|
230
|
+
render: (_, item) => /* @__PURE__ */ jsx(
|
|
231
|
+
Popover,
|
|
232
|
+
{
|
|
233
|
+
trigger: "click",
|
|
234
|
+
position: "right",
|
|
235
|
+
content: /* @__PURE__ */ jsxs("div", { className: "w-72", children: [
|
|
236
|
+
/* @__PURE__ */ jsx("div", { className: "mb-1 text-xs font-medium", children: "Consumer List" }),
|
|
237
|
+
item.useIn.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[11px] text-zinc-500", children: "No applications are consuming this shared dependency version." }) : /* @__PURE__ */ jsx("ul", { className: "space-y-1 text-[11px] text-zinc-700", children: item.useIn.map((c) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1", children: [
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-emerald-500" }),
|
|
239
|
+
/* @__PURE__ */ jsx("span", { className: "break-all", children: c })
|
|
240
|
+
] }, c)) })
|
|
241
|
+
] }),
|
|
242
|
+
children: /* @__PURE__ */ jsx(Button, { size: "mini", type: "secondary", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
243
|
+
/* @__PURE__ */ jsx(Network, { className: "h-3 w-3 mr-1" }),
|
|
244
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
245
|
+
item.useIn.length || 0,
|
|
246
|
+
" Apps"
|
|
247
|
+
] })
|
|
248
|
+
] }) })
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
title: "Strategy",
|
|
254
|
+
width: "12%",
|
|
255
|
+
render: (_, item) => {
|
|
256
|
+
var _a;
|
|
257
|
+
return /* @__PURE__ */ jsx(Tag, { size: "small", color: "gray", children: (_a = item.strategy) != null ? _a : "-" });
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
];
|
|
261
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-4 px-3 py-4 md:px-4 md:py-6 max-w-5xl`, children: [
|
|
262
|
+
/* @__PURE__ */ jsxs("section", { className: "space-y-2", children: [
|
|
263
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-zinc-500", children: "Module Federation · Shared Dependencies" }),
|
|
264
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight text-zinc-900", children: "Overview of Shared Dependencies Usage" })
|
|
265
|
+
] }),
|
|
266
|
+
/* @__PURE__ */ jsx("section", { children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
267
|
+
/* @__PURE__ */ jsxs(Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
|
|
268
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
269
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-zinc-500", children: "Number of Providers" }),
|
|
270
|
+
/* @__PURE__ */ jsxs("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
|
|
271
|
+
/* @__PURE__ */ jsx(Server, { className: "h-5 w-5 text-zinc-400" }),
|
|
272
|
+
/* @__PURE__ */ jsx("span", { children: stats.totalProviders })
|
|
273
|
+
] })
|
|
274
|
+
] }) }),
|
|
275
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-zinc-500", children: "Number of applications/build versions exposing shared dependencies." })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsxs(Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
|
|
278
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
279
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-zinc-500", children: "Share Scope / Package" }),
|
|
280
|
+
/* @__PURE__ */ jsxs("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
|
|
281
|
+
/* @__PURE__ */ jsx(Layers, { className: "h-5 w-5 text-zinc-400" }),
|
|
282
|
+
/* @__PURE__ */ jsx("span", { children: stats.totalScopes }),
|
|
283
|
+
/* @__PURE__ */ jsx("span", { className: "text-base text-zinc-400", children: "scope" })
|
|
284
|
+
] })
|
|
285
|
+
] }) }),
|
|
286
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-zinc-500 whitespace-nowrap", children: [
|
|
287
|
+
/* @__PURE__ */ jsx("span", { className: "truncate mr-2", children: "Shared spaces under Scope dimension." }),
|
|
288
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 flex-shrink-0", children: [
|
|
289
|
+
/* @__PURE__ */ jsx(Box, { className: "h-3 w-3" }),
|
|
290
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
291
|
+
stats.totalPackages,
|
|
292
|
+
" packages"
|
|
293
|
+
] })
|
|
294
|
+
] })
|
|
295
|
+
] })
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ jsxs(Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
|
|
298
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
299
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-zinc-500", children: "Version Loading & Reuse" }),
|
|
300
|
+
/* @__PURE__ */ jsxs("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
|
|
301
|
+
/* @__PURE__ */ jsx(Package2, { className: "h-5 w-5 text-zinc-400" }),
|
|
302
|
+
/* @__PURE__ */ jsx("span", { children: stats.totalVersions })
|
|
303
|
+
] })
|
|
304
|
+
] }) }),
|
|
305
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1 text-xs text-zinc-500", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
306
|
+
/* @__PURE__ */ jsx(Tag, { className: "flex items-center gap-1 loaded-status-tag", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
307
|
+
/* @__PURE__ */ jsx(Network, { className: "h-3 w-3 mr-1" }),
|
|
308
|
+
/* @__PURE__ */ jsx("span", { children: "Loaded" }),
|
|
309
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-zinc-900 ml-1", children: stats.loadedCount })
|
|
310
|
+
] }) }),
|
|
311
|
+
/* @__PURE__ */ jsx(Tag, { className: "flex items-center gap-1 reused-status-tag", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
312
|
+
/* @__PURE__ */ jsx(Repeat, { className: "h-3 w-3 mr-1" }),
|
|
313
|
+
/* @__PURE__ */ jsx("span", { children: "Reused" }),
|
|
314
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-zinc-900 ml-1", children: stats.reusedCount })
|
|
315
|
+
] }) })
|
|
316
|
+
] }) })
|
|
317
|
+
] })
|
|
318
|
+
] }) }),
|
|
319
|
+
/* @__PURE__ */ jsx("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs(
|
|
320
|
+
Card,
|
|
321
|
+
{
|
|
322
|
+
className: "rounded-xl shadow-sm border-zinc-200",
|
|
323
|
+
title: /* @__PURE__ */ jsxs("div", { className: "text-base flex items-center gap-2", children: [
|
|
324
|
+
/* @__PURE__ */ jsx(Box, { className: "h-4 w-4 text-zinc-500" }),
|
|
325
|
+
"Who provides the current shared: '",
|
|
326
|
+
focusPackage,
|
|
327
|
+
"'?"
|
|
328
|
+
] }),
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 md:grid-cols-2 mb-3 p-2", children: [
|
|
331
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
332
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Package Name" }),
|
|
333
|
+
/* @__PURE__ */ jsx(
|
|
334
|
+
Select,
|
|
335
|
+
{
|
|
336
|
+
showSearch: true,
|
|
337
|
+
value: focusPackage,
|
|
338
|
+
onChange: (value) => {
|
|
339
|
+
setFocusPackage(value);
|
|
340
|
+
setFocusVersion("");
|
|
341
|
+
},
|
|
342
|
+
placeholder: "Select Shared Dependency Package Name",
|
|
343
|
+
className: "w-full",
|
|
344
|
+
children: filterOptions.packages.map((name) => /* @__PURE__ */ jsx(Select.Option, { value: name, children: name }, name))
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
349
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Version (Optional, inferred if empty)" }),
|
|
350
|
+
/* @__PURE__ */ jsxs(
|
|
351
|
+
Select,
|
|
352
|
+
{
|
|
353
|
+
showSearch: true,
|
|
354
|
+
value: focusVersion || ALL_VALUE,
|
|
355
|
+
onChange: (value) => setFocusVersion(value === ALL_VALUE ? "" : value),
|
|
356
|
+
placeholder: "All Versions",
|
|
357
|
+
className: "w-full",
|
|
358
|
+
children: [
|
|
359
|
+
/* @__PURE__ */ jsx(Select.Option, { value: ALL_VALUE, children: "All Versions" }),
|
|
360
|
+
focusVersionsForPackage.map((v) => /* @__PURE__ */ jsx(Select.Option, { value: v, children: v }, v))
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
] })
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-md border border-dashed border-zinc-200 bg-zinc-50 px-3 py-2 text-xs", children: /* @__PURE__ */ jsx(
|
|
367
|
+
FocusResultDisplay,
|
|
368
|
+
{
|
|
369
|
+
focusResult,
|
|
370
|
+
hasData,
|
|
371
|
+
loadedStatusLabel
|
|
372
|
+
}
|
|
373
|
+
) })
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
) }) }),
|
|
377
|
+
/* @__PURE__ */ jsx("section", { children: /* @__PURE__ */ jsxs(
|
|
378
|
+
Card,
|
|
379
|
+
{
|
|
380
|
+
className: "rounded-xl shadow-sm border-zinc-200",
|
|
381
|
+
title: /* @__PURE__ */ jsxs("div", { className: "text-base flex items-center gap-2", children: [
|
|
382
|
+
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 text-zinc-500" }),
|
|
383
|
+
"Filter / Search"
|
|
384
|
+
] }),
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 md:grid-cols-2 lg:grid-cols-3 mb-3", children: [
|
|
387
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 p-2", children: [
|
|
388
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Provider" }),
|
|
389
|
+
/* @__PURE__ */ jsx(
|
|
390
|
+
Select,
|
|
391
|
+
{
|
|
392
|
+
value: selectedProvider || void 0,
|
|
393
|
+
onChange: (value) => setSelectedProvider(value === ALL_VALUE ? "" : value),
|
|
394
|
+
placeholder: "All Providers",
|
|
395
|
+
className: "w-full",
|
|
396
|
+
allowClear: true,
|
|
397
|
+
children: filterOptions.providers.map((p) => /* @__PURE__ */ jsx(Select.Option, { value: p, children: p }, p))
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
] }),
|
|
401
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 p-2", children: [
|
|
402
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Package Name" }),
|
|
403
|
+
/* @__PURE__ */ jsx(
|
|
404
|
+
Select,
|
|
405
|
+
{
|
|
406
|
+
value: selectedPackage || void 0,
|
|
407
|
+
onChange: (value) => setSelectedPackage(value === ALL_VALUE ? "" : value),
|
|
408
|
+
placeholder: "All Packages",
|
|
409
|
+
className: "w-full",
|
|
410
|
+
allowClear: true,
|
|
411
|
+
children: filterOptions.packages.map((name) => /* @__PURE__ */ jsx(Select.Option, { value: name, children: name }, name))
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 p-2", children: [
|
|
416
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Version" }),
|
|
417
|
+
/* @__PURE__ */ jsx(
|
|
418
|
+
Select,
|
|
419
|
+
{
|
|
420
|
+
value: selectedVersion || void 0,
|
|
421
|
+
onChange: (value) => setSelectedVersion(value === ALL_VALUE ? "" : value),
|
|
422
|
+
placeholder: "All Versions",
|
|
423
|
+
className: "w-full",
|
|
424
|
+
disabled: !selectedPackage,
|
|
425
|
+
allowClear: true,
|
|
426
|
+
children: versionsForSelectedPackage.map((v) => /* @__PURE__ */ jsx(Select.Option, { value: v, children: v }, v))
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
] })
|
|
430
|
+
] }),
|
|
431
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 md:grid-cols-2 p-2", children: [
|
|
432
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
433
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-zinc-500", children: "Package Name Keyword (Fuzzy Match)" }),
|
|
434
|
+
/* @__PURE__ */ jsx(
|
|
435
|
+
Input,
|
|
436
|
+
{
|
|
437
|
+
prefix: /* @__PURE__ */ jsx(Search, { className: "text-zinc-400 h-3.5 w-3.5" }),
|
|
438
|
+
className: "text-xs",
|
|
439
|
+
placeholder: "e.g., react / axios",
|
|
440
|
+
value: searchText,
|
|
441
|
+
onChange: (val) => setSearchText(val)
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
] }),
|
|
445
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-end justify-end gap-2 text-xs text-zinc-500", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
446
|
+
"Currently Matched Versions:",
|
|
447
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-zinc-900 ml-1", children: filteredVersions.length })
|
|
448
|
+
] }) })
|
|
449
|
+
] }),
|
|
450
|
+
!hasData && loadingState === "loading" && /* @__PURE__ */ jsx("div", { className: "py-4 text-xs text-zinc-500", children: "Parsing shared dependency data..." }),
|
|
451
|
+
loadingState === "error" && /* @__PURE__ */ jsxs("div", { className: "py-3 text-xs text-red-600", children: [
|
|
452
|
+
"Failed to load shared dependency data:",
|
|
453
|
+
" ",
|
|
454
|
+
errorMessage != null ? errorMessage : "Unknown Error"
|
|
455
|
+
] }),
|
|
456
|
+
hasData && Object.keys(tree).length === 0 && /* @__PURE__ */ jsx("div", { className: "py-3 text-xs text-zinc-500", children: "No matching shared dependency versions under current filter conditions, try relaxing the filter conditions." }),
|
|
457
|
+
hasData && Object.keys(tree).length > 0 && /* @__PURE__ */ jsx("div", { className: "max-h-80 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", style: { border: 0 }, children: /* @__PURE__ */ jsx(Collapse, { children: Object.entries(tree).map(([provider, scopes]) => /* @__PURE__ */ jsx(
|
|
458
|
+
Collapse.Item,
|
|
459
|
+
{
|
|
460
|
+
name: provider,
|
|
461
|
+
header: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-1 text-left", children: [
|
|
462
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
463
|
+
/* @__PURE__ */ jsx(Server, { className: "h-3.5 w-3.5 text-zinc-500" }),
|
|
464
|
+
/* @__PURE__ */ jsx("span", { children: provider })
|
|
465
|
+
] }),
|
|
466
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 text-[10px] text-zinc-500", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
467
|
+
"Scope Count: ",
|
|
468
|
+
Object.keys(scopes).length
|
|
469
|
+
] }) })
|
|
470
|
+
] }),
|
|
471
|
+
children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: Object.entries(scopes).map(([scopeName, packages]) => {
|
|
472
|
+
const list = Object.values(packages).flat();
|
|
473
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
474
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs font-medium text-zinc-600", children: [
|
|
475
|
+
/* @__PURE__ */ jsx(Layers, { className: "h-3 w-3 text-zinc-500" }),
|
|
476
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
477
|
+
"Scope: ",
|
|
478
|
+
scopeName
|
|
479
|
+
] })
|
|
480
|
+
] }),
|
|
481
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-md border border-zinc-200 bg-zinc-50/40", children: /* @__PURE__ */ jsx(
|
|
482
|
+
Table,
|
|
483
|
+
{
|
|
484
|
+
columns,
|
|
485
|
+
data: list,
|
|
486
|
+
pagination: false,
|
|
487
|
+
rowKey: "id",
|
|
488
|
+
border: false,
|
|
489
|
+
size: "small"
|
|
490
|
+
}
|
|
491
|
+
) })
|
|
492
|
+
] }, scopeName);
|
|
493
|
+
}) })
|
|
494
|
+
},
|
|
495
|
+
provider
|
|
496
|
+
)) }) }) })
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
) })
|
|
500
|
+
] });
|
|
501
|
+
}
|
|
502
|
+
var SharedDepsExplorer_default = SharedDepsExplorer;
|
|
503
|
+
export {
|
|
504
|
+
SharedDepsExplorer_default as default
|
|
505
|
+
};
|