modviz 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +261 -0
- package/dist/client/_shell.html +0 -0
- package/dist/client/android-chrome-192x192.png +0 -0
- package/dist/client/android-chrome-512x512.png +0 -0
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/app-Sjrldkrg.css +2 -0
- package/dist/client/assets/button-aOWckyNs.js +1 -0
- package/dist/client/assets/check-C0EQe2S8.js +1 -0
- package/dist/client/assets/chevron-down-DrspihmT.js +1 -0
- package/dist/client/assets/chevron-right-DIJHr8AN.js +1 -0
- package/dist/client/assets/colors-CQoWjU5E.js +1 -0
- package/dist/client/assets/command-kkF7_wdz.js +45 -0
- package/dist/client/assets/compare-K6jVFsiI.js +1 -0
- package/dist/client/assets/compare-TOnoe1EP.js +2 -0
- package/dist/client/assets/configure-DnlSnhtN.js +1 -0
- package/dist/client/assets/explorer-C7NclVKg.js +2 -0
- package/dist/client/assets/explorer-Xu2X6XXF.js +1 -0
- package/dist/client/assets/external-link-B9eNA-li.js +1 -0
- package/dist/client/assets/flamegraph-CRVZSAlj.js +13 -0
- package/dist/client/assets/floating-ui.dom-DLIT5tPE.js +1 -0
- package/dist/client/assets/formatting-CiC0SYI8.js +1 -0
- package/dist/client/assets/graph-6Vr74V1k.js +2 -0
- package/dist/client/assets/graph-CVzypIGU.js +2 -0
- package/dist/client/assets/graph-command-menu-D2MoVT2B.js +4 -0
- package/dist/client/assets/graph-command-menu-VWiiW3qy.css +1 -0
- package/dist/client/assets/hierarchy-C8xxGb_u.js +2 -0
- package/dist/client/assets/hierarchy-iO7d4oSK.js +2 -0
- package/dist/client/assets/import-display-D-jRyyjM.js +5 -0
- package/dist/client/assets/imports-CPggnrs-.js +2 -0
- package/dist/client/assets/imports-CodbPyUJ.js +1 -0
- package/dist/client/assets/index-Dj_rhLdR.js +12 -0
- package/dist/client/assets/input-BCFMF0aR.js +1 -0
- package/dist/client/assets/jsx-runtime-DWSWI4JT.js +1 -0
- package/dist/client/assets/lazyRouteComponent-PTSyFp1J.js +1 -0
- package/dist/client/assets/loading-state-CyC_hrTF.js +1 -0
- package/dist/client/assets/modviz-data-BiRqoDI5.js +1 -0
- package/dist/client/assets/modviz-layout-Do93E-IB.js +1 -0
- package/dist/client/assets/modviz-sigma-Xl8qHaxK.js +312 -0
- package/dist/client/assets/portal-BgAm3V3j.js +1 -0
- package/dist/client/assets/routes-DBtN8hrZ.js +1 -0
- package/dist/client/assets/schemas-B4zfTepZ.js +39 -0
- package/dist/client/assets/search-BYHxNrYn.js +1 -0
- package/dist/client/assets/search-params-BaZRBvGI.js +1 -0
- package/dist/client/assets/setup-view-j1o0TuZz.js +1 -0
- package/dist/client/assets/summary-D703Zh3x.js +1 -0
- package/dist/client/assets/tooltip-B1VDU9HG.js +1 -0
- package/dist/client/assets/trace-B67CM5s2.js +2 -0
- package/dist/client/assets/trace-Bwwdw3AM.js +1 -0
- package/dist/client/assets/treemap-BZf2shzY.js +5 -0
- package/dist/client/assets/treemap-Csroy8Gy.js +2 -0
- package/dist/client/assets/utils-DkkZd0ys.js +1 -0
- package/dist/client/favicon-16x16.png +0 -0
- package/dist/client/favicon-32x32.png +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/site.webmanifest +19 -0
- package/dist/mod/cli-options.js +225 -0
- package/dist/mod/cli.js +519 -0
- package/dist/mod/index.js +3 -0
- package/dist/mod/llm-analysis.js +29 -0
- package/dist/mod/llm-output.js +742 -0
- package/dist/mod/module-graph-plugins.js +60 -0
- package/dist/mod/production-server.js +103 -0
- package/dist/mod/runtime-host.js +217 -0
- package/dist/mod/snapshot-history.js +73 -0
- package/dist/mod/types.js +3 -0
- package/dist/server/assets/__23tanstack-start-plugin-adapters-3QxJs4a0.js +5 -0
- package/dist/server/assets/_tanstack-start-manifest_v-DMytuIue.js +188 -0
- package/dist/server/assets/button-Bqnnid5i.js +41 -0
- package/dist/server/assets/colors-DhAxrYua.js +100 -0
- package/dist/server/assets/command-SdxShIbL.js +138 -0
- package/dist/server/assets/compare-BFMiiUsB.js +562 -0
- package/dist/server/assets/compare-CpOqTpYu.js +10 -0
- package/dist/server/assets/configure-Bvd45DTI.js +288 -0
- package/dist/server/assets/explorer-C7dODpSv.js +379 -0
- package/dist/server/assets/explorer-CpSb0JTa.js +20 -0
- package/dist/server/assets/flamegraph-CdW-VG6I.js +198 -0
- package/dist/server/assets/formatting-iDlL4tA-.js +4 -0
- package/dist/server/assets/graph-C1G9H5O4.js +438 -0
- package/dist/server/assets/graph-DAGFGioS.js +45 -0
- package/dist/server/assets/graph-command-menu-BV5GtOWx.js +249 -0
- package/dist/server/assets/hierarchy-B4K-Zfn9.js +16 -0
- package/dist/server/assets/hierarchy-BGpWSG-f.js +104 -0
- package/dist/server/assets/import-display-BVIOWcsm.js +124 -0
- package/dist/server/assets/imports-B6JBDl_h.js +379 -0
- package/dist/server/assets/imports-BGe5tZJT.js +28 -0
- package/dist/server/assets/input-C5r-hBix.js +19 -0
- package/dist/server/assets/loading-state-CrvCWTtw.js +23 -0
- package/dist/server/assets/modviz-data-CUyTorv0.js +197 -0
- package/dist/server/assets/modviz-layout-BAH2ogse.js +253 -0
- package/dist/server/assets/modviz-server-DoMlAyFW.js +195 -0
- package/dist/server/assets/modviz-sigma-XYxARWqd.js +1441 -0
- package/dist/server/assets/rolldown-runtime-rSIU-vHC.js +13 -0
- package/dist/server/assets/router-DYJ-zDbU.js +353 -0
- package/dist/server/assets/routes-DInCacpY.js +244 -0
- package/dist/server/assets/search-params-BNApPgkX.js +26 -0
- package/dist/server/assets/setup-view-DjI49Iqr.js +91 -0
- package/dist/server/assets/start-Ba3KII43.js +4 -0
- package/dist/server/assets/summary-z3lXkLCQ.js +208 -0
- package/dist/server/assets/tooltip-Ck0DDfF7.js +24 -0
- package/dist/server/assets/trace-ColKOf9g.js +16 -0
- package/dist/server/assets/trace-eVs-hIZO.js +578 -0
- package/dist/server/assets/treemap-BbZ9M4GF.js +17 -0
- package/dist/server/assets/treemap-CrgWFoCF.js +912 -0
- package/dist/server/assets/utils-BQZm0uva.js +8 -0
- package/dist/server/server.js +5259 -0
- package/dist/shared/modviz-compare.js +120 -0
- package/dist/shared/modviz-trace.js +244 -0
- package/package.json +135 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { t as Button } from "./button-Bqnnid5i.js";
|
|
2
|
+
import { t as Input } from "./input-C5r-hBix.js";
|
|
3
|
+
import { f as isModvizBundleReady, m as useModvizBundle } from "./modviz-data-CUyTorv0.js";
|
|
4
|
+
import { t as Route$1 } from "./imports-BGe5tZJT.js";
|
|
5
|
+
import { t as ModvizLayout } from "./modviz-layout-BAH2ogse.js";
|
|
6
|
+
import { t as ImportDisplay } from "./import-display-BVIOWcsm.js";
|
|
7
|
+
import { t as SetupView } from "./setup-view-DjI49Iqr.js";
|
|
8
|
+
import { startTransition, useMemo } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronDown } from "lucide-react";
|
|
11
|
+
//#region src/components/modviz/import-search-view.tsx
|
|
12
|
+
var formatNumber = new Intl.NumberFormat("en-US");
|
|
13
|
+
var splitTokens = (value) => value.split(/[\n,]+/).map((token) => token.trim()).filter(Boolean);
|
|
14
|
+
var createMatcher = (query, mode) => {
|
|
15
|
+
if (!query.trim()) return () => true;
|
|
16
|
+
if (mode === "regex") {
|
|
17
|
+
const regex = new RegExp(query, "i");
|
|
18
|
+
return (value) => regex.test(value);
|
|
19
|
+
}
|
|
20
|
+
if (mode === "exact") {
|
|
21
|
+
const normalized = query.trim().toLowerCase();
|
|
22
|
+
return (value) => value.trim().toLowerCase() === normalized;
|
|
23
|
+
}
|
|
24
|
+
const normalized = query.trim().toLowerCase();
|
|
25
|
+
return (value) => value.toLowerCase().includes(normalized);
|
|
26
|
+
};
|
|
27
|
+
var matchesSourceToken = (node, token, mode) => {
|
|
28
|
+
const matcher = createMatcher(token, mode);
|
|
29
|
+
return [
|
|
30
|
+
node.path,
|
|
31
|
+
node.name,
|
|
32
|
+
node.cluster,
|
|
33
|
+
node.package?.name,
|
|
34
|
+
node.package?.path
|
|
35
|
+
].filter(Boolean).some((value) => matcher(String(value)));
|
|
36
|
+
};
|
|
37
|
+
var isWorkspaceImport = (importItem, workspacePackageNames) => {
|
|
38
|
+
if (importItem.module.startsWith(".") || importItem.module.startsWith("/")) return true;
|
|
39
|
+
for (const packageName of workspacePackageNames) if (importItem.module === packageName || importItem.module.startsWith(`${packageName}/`)) return true;
|
|
40
|
+
return false;
|
|
41
|
+
};
|
|
42
|
+
function ImportSearchView(props) {
|
|
43
|
+
const { graph } = props.bundle;
|
|
44
|
+
const { exclude: excludeSources, include: includeSources, mode: matchMode, module: moduleQuery, preset, scope: targetScope, symbol: symbolQuery } = props.search;
|
|
45
|
+
const workspacePackageNames = useMemo(() => new Set(graph.metadata.packages.map((pkg) => pkg.name)), [graph.metadata.packages]);
|
|
46
|
+
const updateSearch = (patch) => startTransition(() => props.onSearchChange(patch));
|
|
47
|
+
const search = useMemo(() => {
|
|
48
|
+
try {
|
|
49
|
+
const moduleMatcher = createMatcher(moduleQuery, matchMode);
|
|
50
|
+
const symbolMatcher = createMatcher(symbolQuery, matchMode);
|
|
51
|
+
const includeTokens = splitTokens(includeSources);
|
|
52
|
+
const excludeTokens = splitTokens(excludeSources);
|
|
53
|
+
const results = graph.nodes.map((node) => {
|
|
54
|
+
const matches = node.imports.filter((importItem) => {
|
|
55
|
+
const moduleMatches = moduleMatcher(importItem.module);
|
|
56
|
+
const symbolMatches = symbolQuery.trim() ? [importItem.name, importItem.declaration].filter(Boolean).some((value) => symbolMatcher(String(value))) : true;
|
|
57
|
+
const workspaceImport = isWorkspaceImport(importItem, workspacePackageNames);
|
|
58
|
+
return moduleMatches && symbolMatches && (targetScope === "all" || targetScope === "workspace" && workspaceImport || targetScope === "external" && !workspaceImport);
|
|
59
|
+
});
|
|
60
|
+
if (!matches.length) return null;
|
|
61
|
+
if (includeTokens.length && !includeTokens.every((token) => matchesSourceToken(node, token, matchMode))) return null;
|
|
62
|
+
if (excludeTokens.some((token) => matchesSourceToken(node, token, matchMode))) return null;
|
|
63
|
+
return {
|
|
64
|
+
node,
|
|
65
|
+
matches
|
|
66
|
+
};
|
|
67
|
+
}).filter(Boolean);
|
|
68
|
+
results.sort((left, right) => {
|
|
69
|
+
const matchCountOrder = right.matches.length - left.matches.length;
|
|
70
|
+
return matchCountOrder !== 0 ? matchCountOrder : left.node.path.localeCompare(right.node.path);
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
results,
|
|
74
|
+
error: null
|
|
75
|
+
};
|
|
76
|
+
} catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
results: [],
|
|
79
|
+
error: error instanceof Error ? error.message : "Invalid search expression"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}, [
|
|
83
|
+
excludeSources,
|
|
84
|
+
graph.nodes,
|
|
85
|
+
includeSources,
|
|
86
|
+
matchMode,
|
|
87
|
+
moduleQuery,
|
|
88
|
+
symbolQuery,
|
|
89
|
+
targetScope,
|
|
90
|
+
workspacePackageNames
|
|
91
|
+
]);
|
|
92
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
93
|
+
className: "space-y-6",
|
|
94
|
+
children: [/* @__PURE__ */ jsxs("details", {
|
|
95
|
+
open: true,
|
|
96
|
+
className: "group sticky top-0 z-10 rounded-[24px] border border-slate-200/70 bg-white/90 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] transition-all dark:border-slate-800 dark:bg-slate-950/70",
|
|
97
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
98
|
+
className: "flex cursor-pointer list-none items-center justify-between p-5",
|
|
99
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
100
|
+
className: "text-sm font-semibold text-slate-900 dark:text-slate-100",
|
|
101
|
+
children: "Filter options"
|
|
102
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
103
|
+
className: "rounded p-1 hover:bg-slate-100 dark:hover:bg-slate-800",
|
|
104
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 -rotate-90 transition-transform group-open:rotate-0" })
|
|
105
|
+
})]
|
|
106
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: "border-t border-slate-200/70 px-5 py-4 dark:border-slate-800",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", {
|
|
110
|
+
className: "grid gap-4 lg:grid-cols-2 xl:grid-cols-3",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsxs("div", {
|
|
113
|
+
className: "space-y-2",
|
|
114
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
115
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
116
|
+
children: "Imported module"
|
|
117
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
118
|
+
placeholder: "lodash-es, ./router, @weliihq/backend...",
|
|
119
|
+
value: moduleQuery,
|
|
120
|
+
onChange: (event) => updateSearch({
|
|
121
|
+
module: event.currentTarget.value,
|
|
122
|
+
preset: ""
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", {
|
|
127
|
+
className: "space-y-2",
|
|
128
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
129
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
130
|
+
children: "Imported symbol"
|
|
131
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
132
|
+
placeholder: "omit, mapValues, OrganizationRouter...",
|
|
133
|
+
value: symbolQuery,
|
|
134
|
+
onChange: (event) => updateSearch({
|
|
135
|
+
symbol: event.currentTarget.value,
|
|
136
|
+
preset: ""
|
|
137
|
+
})
|
|
138
|
+
})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: "space-y-2",
|
|
142
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
143
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
144
|
+
children: "Match mode"
|
|
145
|
+
}), /* @__PURE__ */ jsxs("select", {
|
|
146
|
+
className: "flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
147
|
+
value: matchMode,
|
|
148
|
+
onChange: (event) => updateSearch({
|
|
149
|
+
mode: event.currentTarget.value,
|
|
150
|
+
preset: ""
|
|
151
|
+
}),
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ jsx("option", {
|
|
154
|
+
value: "contains",
|
|
155
|
+
children: "contains"
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ jsx("option", {
|
|
158
|
+
value: "exact",
|
|
159
|
+
children: "exact"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx("option", {
|
|
162
|
+
value: "regex",
|
|
163
|
+
children: "regex"
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
})]
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ jsxs("div", {
|
|
169
|
+
className: "space-y-2",
|
|
170
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
171
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
172
|
+
children: "Target scope"
|
|
173
|
+
}), /* @__PURE__ */ jsxs("select", {
|
|
174
|
+
className: "flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
175
|
+
value: targetScope,
|
|
176
|
+
onChange: (event) => updateSearch({
|
|
177
|
+
scope: event.currentTarget.value,
|
|
178
|
+
preset: ""
|
|
179
|
+
}),
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsx("option", {
|
|
182
|
+
value: "all",
|
|
183
|
+
children: "all imports"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx("option", {
|
|
186
|
+
value: "workspace",
|
|
187
|
+
children: "workspace or monorepo imports"
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ jsx("option", {
|
|
190
|
+
value: "external",
|
|
191
|
+
children: "external package imports"
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})]
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ jsxs("div", {
|
|
197
|
+
className: "space-y-2",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx("label", {
|
|
200
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
201
|
+
children: "Only imported from"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
204
|
+
className: "min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
205
|
+
placeholder: "@weliihq/backend\\nrouters/organization",
|
|
206
|
+
value: includeSources,
|
|
207
|
+
onChange: (event) => updateSearch({
|
|
208
|
+
include: event.currentTarget.value,
|
|
209
|
+
preset: ""
|
|
210
|
+
})
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ jsxs("p", {
|
|
213
|
+
className: "text-xs leading-5 text-slate-500 dark:text-slate-400",
|
|
214
|
+
children: [
|
|
215
|
+
"Regex helpers: use ",
|
|
216
|
+
/* @__PURE__ */ jsx("code", { children: "routers/organization" }),
|
|
217
|
+
", ",
|
|
218
|
+
/* @__PURE__ */ jsx("code", { children: "(router|service)" }),
|
|
219
|
+
", or ",
|
|
220
|
+
/* @__PURE__ */ jsx("code", { children: "^apps/backend/" }),
|
|
221
|
+
" when match mode is regex."
|
|
222
|
+
]
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ jsxs("div", {
|
|
227
|
+
className: "space-y-2",
|
|
228
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
229
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
230
|
+
children: "Exclude imported from"
|
|
231
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
232
|
+
className: "min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
233
|
+
placeholder: "test, stories, generated",
|
|
234
|
+
value: excludeSources,
|
|
235
|
+
onChange: (event) => updateSearch({
|
|
236
|
+
exclude: event.currentTarget.value,
|
|
237
|
+
preset: ""
|
|
238
|
+
})
|
|
239
|
+
})]
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx("div", {
|
|
244
|
+
className: "mt-4 flex flex-wrap gap-2",
|
|
245
|
+
children: [
|
|
246
|
+
{
|
|
247
|
+
id: "external-hunt",
|
|
248
|
+
label: "External package hunt",
|
|
249
|
+
apply: () => updateSearch({
|
|
250
|
+
preset: "external-hunt",
|
|
251
|
+
scope: "external",
|
|
252
|
+
mode: "contains"
|
|
253
|
+
})
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "workspace-path-regex",
|
|
257
|
+
label: "Workspace path regex",
|
|
258
|
+
apply: () => updateSearch({
|
|
259
|
+
preset: "workspace-path-regex",
|
|
260
|
+
scope: "workspace",
|
|
261
|
+
mode: "regex",
|
|
262
|
+
include: includeSources || "(@weliihq/backend|apps/backend).*(routers|organization)"
|
|
263
|
+
})
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: "lodash-omit",
|
|
267
|
+
label: "Find lodash omit",
|
|
268
|
+
apply: () => updateSearch({
|
|
269
|
+
preset: "lodash-omit",
|
|
270
|
+
module: "lodash-es",
|
|
271
|
+
symbol: "omit",
|
|
272
|
+
scope: "external",
|
|
273
|
+
mode: "contains"
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
].map((presetItem) => /* @__PURE__ */ jsx(Button, {
|
|
277
|
+
variant: preset === presetItem.id ? "default" : "outline",
|
|
278
|
+
size: "sm",
|
|
279
|
+
onClick: presetItem.apply,
|
|
280
|
+
children: presetItem.label
|
|
281
|
+
}, presetItem.id))
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ jsxs("div", {
|
|
284
|
+
className: "mt-4 flex flex-wrap gap-3 text-sm text-slate-500 dark:text-slate-400",
|
|
285
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
286
|
+
variant: "outline",
|
|
287
|
+
onClick: () => {
|
|
288
|
+
updateSearch({
|
|
289
|
+
module: "",
|
|
290
|
+
symbol: "",
|
|
291
|
+
include: "",
|
|
292
|
+
exclude: "",
|
|
293
|
+
mode: "contains",
|
|
294
|
+
scope: "all",
|
|
295
|
+
preset: ""
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
children: "Reset filters"
|
|
299
|
+
}), /* @__PURE__ */ jsx("span", { children: "Try: module = lodash-es, symbol = omit, include = @weliihq/backend and routers/organization." })]
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
})]
|
|
303
|
+
}), /* @__PURE__ */ jsxs("section", {
|
|
304
|
+
className: "rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70",
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ jsxs("div", {
|
|
307
|
+
className: "flex flex-wrap items-center justify-between gap-4",
|
|
308
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
309
|
+
className: "text-lg font-semibold text-slate-900 dark:text-slate-100",
|
|
310
|
+
children: "Matches"
|
|
311
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
312
|
+
className: "mt-1 text-sm text-slate-500 dark:text-slate-400",
|
|
313
|
+
children: "Importer files or modules whose import list matches the current filters."
|
|
314
|
+
})] }), /* @__PURE__ */ jsxs("div", {
|
|
315
|
+
className: "rounded-full bg-slate-950 px-4 py-2 text-sm font-semibold text-white dark:bg-slate-100 dark:text-slate-950",
|
|
316
|
+
children: [formatNumber.format(search.results.length), " result(s)"]
|
|
317
|
+
})]
|
|
318
|
+
}),
|
|
319
|
+
search.error ? /* @__PURE__ */ jsx("p", {
|
|
320
|
+
className: "mt-4 rounded-2xl border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/30 dark:text-red-300",
|
|
321
|
+
children: search.error
|
|
322
|
+
}) : null,
|
|
323
|
+
/* @__PURE__ */ jsxs("div", {
|
|
324
|
+
className: "mt-4 space-y-4",
|
|
325
|
+
children: [search.results.map((result) => /* @__PURE__ */ jsxs("article", {
|
|
326
|
+
className: "rounded-[22px] border border-slate-200/80 bg-slate-50/90 p-4 dark:border-slate-800 dark:bg-slate-900/70",
|
|
327
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
328
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
329
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
330
|
+
className: "text-sm font-semibold text-slate-900 dark:text-slate-100",
|
|
331
|
+
children: result.node.path
|
|
332
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
333
|
+
className: "mt-1 text-xs text-slate-500 dark:text-slate-400",
|
|
334
|
+
children: [result.node.package?.name ? `${result.node.package.name} • ` : "", result.node.cluster ?? result.node.type]
|
|
335
|
+
})] }), /* @__PURE__ */ jsxs("div", {
|
|
336
|
+
className: "rounded-full bg-white px-3 py-1 text-xs font-semibold text-slate-700 shadow-sm dark:bg-slate-950 dark:text-slate-200",
|
|
337
|
+
children: [formatNumber.format(result.matches.length), " matching import(s)"]
|
|
338
|
+
})]
|
|
339
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
340
|
+
className: "mt-3",
|
|
341
|
+
children: /* @__PURE__ */ jsx(ImportDisplay, {
|
|
342
|
+
imports: result.matches,
|
|
343
|
+
showViewToggle: false
|
|
344
|
+
})
|
|
345
|
+
})]
|
|
346
|
+
}, result.node.path)), !search.error && !search.results.length ? /* @__PURE__ */ jsx("p", {
|
|
347
|
+
className: "rounded-2xl border border-dashed border-slate-300 px-4 py-6 text-sm text-slate-500 dark:border-slate-700 dark:text-slate-400",
|
|
348
|
+
children: "No imports matched the current query."
|
|
349
|
+
}) : null]
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
})]
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/routes/imports.tsx?tsr-split=component
|
|
357
|
+
function ImportsRoute() {
|
|
358
|
+
const bundle = useModvizBundle();
|
|
359
|
+
const search = Route$1.useSearch();
|
|
360
|
+
const navigate = Route$1.useNavigate();
|
|
361
|
+
return /* @__PURE__ */ jsx(ModvizLayout, {
|
|
362
|
+
projectTitle: bundle.projectTitle,
|
|
363
|
+
title: "Import Search",
|
|
364
|
+
description: "Search by imported module or symbol, then scope the results to monorepo packages, folders, or specific files with include and exclude filters.",
|
|
365
|
+
children: isModvizBundleReady(bundle) ? /* @__PURE__ */ jsx(ImportSearchView, {
|
|
366
|
+
bundle,
|
|
367
|
+
search,
|
|
368
|
+
onSearchChange: (patch) => navigate({
|
|
369
|
+
replace: true,
|
|
370
|
+
search: (previous) => ({
|
|
371
|
+
...previous,
|
|
372
|
+
...patch
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
}) : /* @__PURE__ */ jsx(SetupView, { bundle })
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
export { ImportsRoute as component };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/routes/imports.tsx
|
|
4
|
+
var $$splitComponentImporter = () => import("./imports-B6JBDl_h.js");
|
|
5
|
+
var importSearchSchema = z.object({
|
|
6
|
+
module: z.string().catch(""),
|
|
7
|
+
symbol: z.string().catch(""),
|
|
8
|
+
include: z.string().catch(""),
|
|
9
|
+
exclude: z.string().catch(""),
|
|
10
|
+
mode: z.enum([
|
|
11
|
+
"contains",
|
|
12
|
+
"exact",
|
|
13
|
+
"regex"
|
|
14
|
+
]).catch("contains"),
|
|
15
|
+
scope: z.enum([
|
|
16
|
+
"all",
|
|
17
|
+
"workspace",
|
|
18
|
+
"external"
|
|
19
|
+
]).catch("all"),
|
|
20
|
+
preset: z.string().catch("")
|
|
21
|
+
});
|
|
22
|
+
var Route = createFileRoute("/imports")({
|
|
23
|
+
ssr: false,
|
|
24
|
+
validateSearch: (search) => importSearchSchema.parse(search),
|
|
25
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Route as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as cn } from "./utils-BQZm0uva.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createAnatomy } from "@ark-ui/react/anatomy";
|
|
5
|
+
import { ark } from "@ark-ui/react/factory";
|
|
6
|
+
//#region src/components/ui/input.tsx
|
|
7
|
+
var parts = createAnatomy("input").parts("root").build();
|
|
8
|
+
var Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(ark.input, {
|
|
10
|
+
ref,
|
|
11
|
+
...parts.root.attrs,
|
|
12
|
+
type,
|
|
13
|
+
className: cn("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground/70 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none", type === "file" && "p-0 pr-3 text-muted-foreground/70 italic file:me-3 file:h-full file:border-0 file:border-input file:border-r file:border-solid file:bg-transparent file:px-3 file:font-medium file:text-foreground file:text-sm file:not-italic", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
Input.displayName = "Input";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Input as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderCircle } from "lucide-react";
|
|
3
|
+
//#region src/components/ui/loading-state.tsx
|
|
4
|
+
function LoadingState(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
+
className: ["flex h-full min-h-[12rem] flex-col items-center justify-center gap-3 text-center", props.className].filter(Boolean).join(" "),
|
|
7
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
8
|
+
className: "rounded-full border border-sky-200 bg-sky-50 p-3 text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-200",
|
|
9
|
+
children: /* @__PURE__ */ jsx(LoaderCircle, { className: "size-5 animate-spin" })
|
|
10
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: "space-y-1",
|
|
12
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
13
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
14
|
+
children: props.label
|
|
15
|
+
}), props.description ? /* @__PURE__ */ jsx("p", {
|
|
16
|
+
className: "text-xs text-slate-500 dark:text-slate-400",
|
|
17
|
+
children: props.description
|
|
18
|
+
}) : null]
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { LoadingState as t };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { getRouteApi } from "@tanstack/react-router";
|
|
2
|
+
//#region src/utils/modviz-data.ts
|
|
3
|
+
var ACTIVE_SNAPSHOT_SELECTION_STORAGE_KEY = "modviz.active-snapshot-selection";
|
|
4
|
+
var normalizeActiveSnapshotSelection = (selection) => {
|
|
5
|
+
const snapshotId = typeof selection?.snapshotId === "string" ? selection.snapshotId.trim() : "";
|
|
6
|
+
const graphPath = typeof selection?.graphPath === "string" ? selection.graphPath.trim() : "";
|
|
7
|
+
return snapshotId ? {
|
|
8
|
+
snapshotId,
|
|
9
|
+
graphPath: ""
|
|
10
|
+
} : {
|
|
11
|
+
snapshotId: "",
|
|
12
|
+
graphPath
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
var getActiveSnapshotSelection = () => {
|
|
16
|
+
if (typeof window === "undefined") return {
|
|
17
|
+
snapshotId: "",
|
|
18
|
+
graphPath: ""
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
const raw = window.localStorage.getItem(ACTIVE_SNAPSHOT_SELECTION_STORAGE_KEY);
|
|
22
|
+
if (!raw) return {
|
|
23
|
+
snapshotId: "",
|
|
24
|
+
graphPath: ""
|
|
25
|
+
};
|
|
26
|
+
return normalizeActiveSnapshotSelection(JSON.parse(raw));
|
|
27
|
+
} catch {
|
|
28
|
+
return {
|
|
29
|
+
snapshotId: "",
|
|
30
|
+
graphPath: ""
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var setActiveSnapshotSelection = (selection) => {
|
|
35
|
+
if (typeof window === "undefined") return;
|
|
36
|
+
const normalized = normalizeActiveSnapshotSelection(selection);
|
|
37
|
+
if (!normalized.snapshotId && !normalized.graphPath) {
|
|
38
|
+
window.localStorage.removeItem(ACTIVE_SNAPSHOT_SELECTION_STORAGE_KEY);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
window.localStorage.setItem(ACTIVE_SNAPSHOT_SELECTION_STORAGE_KEY, JSON.stringify(normalized));
|
|
42
|
+
};
|
|
43
|
+
var appendActiveSnapshotSelection = (pathname) => {
|
|
44
|
+
if (typeof window === "undefined") return pathname;
|
|
45
|
+
const selection = getActiveSnapshotSelection();
|
|
46
|
+
if (!selection.snapshotId && !selection.graphPath) return pathname;
|
|
47
|
+
const url = new URL(pathname, window.location.origin);
|
|
48
|
+
if (selection.snapshotId) {
|
|
49
|
+
url.searchParams.set("snapshotId", selection.snapshotId);
|
|
50
|
+
url.searchParams.delete("graphPath");
|
|
51
|
+
} else if (selection.graphPath) {
|
|
52
|
+
url.searchParams.set("graphPath", selection.graphPath);
|
|
53
|
+
url.searchParams.delete("snapshotId");
|
|
54
|
+
}
|
|
55
|
+
return `${url.pathname}${url.search}`;
|
|
56
|
+
};
|
|
57
|
+
var isModvizBundleReady = (bundle) => Boolean(bundle.graph && bundle.summary && bundle.setup.status === "ready");
|
|
58
|
+
var isExternalNode = (node, workspacePackageNames) => {
|
|
59
|
+
if (node.path.includes("node_modules")) return true;
|
|
60
|
+
if (!node.package?.name) return false;
|
|
61
|
+
return !workspacePackageNames.has(node.package.name);
|
|
62
|
+
};
|
|
63
|
+
var getWorkspacePackageNames = (graph) => new Set(graph.metadata.packages.map((pkg) => pkg.name));
|
|
64
|
+
var getNodeScope = (node, workspacePackageNames) => isExternalNode(node, workspacePackageNames) ? "external" : "workspace";
|
|
65
|
+
var getExternalPackageName = (node) => {
|
|
66
|
+
if (!node.path.includes("node_modules")) return node.package?.name ?? "external";
|
|
67
|
+
if (node.package?.name && node.package.name !== "node_modules") return node.package.name;
|
|
68
|
+
const segments = node.path.split(/[\\/]/).filter(Boolean);
|
|
69
|
+
const nodeModulesIndex = segments.lastIndexOf("node_modules");
|
|
70
|
+
if (nodeModulesIndex === -1) return "node_modules";
|
|
71
|
+
const scopeOrName = segments[nodeModulesIndex + 1];
|
|
72
|
+
const maybeName = segments[nodeModulesIndex + 2];
|
|
73
|
+
if (!scopeOrName) return "node_modules";
|
|
74
|
+
return scopeOrName.startsWith("@") && maybeName ? `${scopeOrName}/${maybeName}` : scopeOrName;
|
|
75
|
+
};
|
|
76
|
+
var getNodeGroupingLabel = (node, workspacePackageNames, externalGrouping) => {
|
|
77
|
+
if (getNodeScope(node, workspacePackageNames) === "external") return externalGrouping === "package" ? getExternalPackageName(node) : "node_modules";
|
|
78
|
+
return node.cluster ?? node.package?.name ?? "workspace";
|
|
79
|
+
};
|
|
80
|
+
var filterNodesByScope = (nodes, workspacePackageNames, scope) => {
|
|
81
|
+
if (scope === "all") return nodes;
|
|
82
|
+
return nodes.filter((node) => getNodeScope(node, workspacePackageNames) === scope);
|
|
83
|
+
};
|
|
84
|
+
var countBy = (items, getKey) => {
|
|
85
|
+
const counts = /* @__PURE__ */ new Map();
|
|
86
|
+
for (const item of items) {
|
|
87
|
+
const key = getKey(item);
|
|
88
|
+
if (!key) continue;
|
|
89
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
90
|
+
}
|
|
91
|
+
return counts;
|
|
92
|
+
};
|
|
93
|
+
var sortSummaryItems = (items) => items.sort((left, right) => {
|
|
94
|
+
const valueOrder = right.value - left.value;
|
|
95
|
+
return valueOrder !== 0 ? valueOrder : left.label.localeCompare(right.label);
|
|
96
|
+
}).slice(0, 8);
|
|
97
|
+
var buildReachableCountByPath = (nodes) => {
|
|
98
|
+
const adjacency = new Map(nodes.map((node) => [node.path, node.importees]));
|
|
99
|
+
const reachableCountByPath = /* @__PURE__ */ new Map();
|
|
100
|
+
for (const node of nodes) {
|
|
101
|
+
const visited = /* @__PURE__ */ new Set();
|
|
102
|
+
const stack = [...node.importees];
|
|
103
|
+
while (stack.length > 0) {
|
|
104
|
+
const nextPath = stack.pop();
|
|
105
|
+
if (!nextPath || visited.has(nextPath)) continue;
|
|
106
|
+
visited.add(nextPath);
|
|
107
|
+
const importees = adjacency.get(nextPath);
|
|
108
|
+
if (!importees) continue;
|
|
109
|
+
for (const importeePath of importees) if (importeePath !== node.path && !visited.has(importeePath)) stack.push(importeePath);
|
|
110
|
+
}
|
|
111
|
+
reachableCountByPath.set(node.path, visited.size);
|
|
112
|
+
}
|
|
113
|
+
return reachableCountByPath;
|
|
114
|
+
};
|
|
115
|
+
var buildModvizSummary = (graph, llm) => {
|
|
116
|
+
const workspacePackageNames = new Set(graph.metadata.packages.map((pkg) => pkg.name));
|
|
117
|
+
const externalNodes = graph.nodes.filter((node) => isExternalNode(node, workspacePackageNames));
|
|
118
|
+
const workspaceNodes = graph.nodes.filter((node) => !isExternalNode(node, workspacePackageNames));
|
|
119
|
+
const externalPackageCounts = countBy(externalNodes, (node) => getExternalPackageName(node));
|
|
120
|
+
const reachableCountByPath = buildReachableCountByPath(graph.nodes);
|
|
121
|
+
const clusterCounts = countBy(graph.nodes, (node) => {
|
|
122
|
+
return node.cluster ?? node.package?.name ?? node.type ?? "unclassified";
|
|
123
|
+
});
|
|
124
|
+
const topImportedBy = sortSummaryItems([...graph.nodes].map((node) => ({
|
|
125
|
+
label: node.name,
|
|
126
|
+
path: node.path,
|
|
127
|
+
value: node.importedBy.length,
|
|
128
|
+
description: `${node.importees.length} outgoing imports`
|
|
129
|
+
})));
|
|
130
|
+
const topImporters = sortSummaryItems([...graph.nodes].map((node) => ({
|
|
131
|
+
label: node.name,
|
|
132
|
+
path: node.path,
|
|
133
|
+
value: node.importees.length,
|
|
134
|
+
description: `${node.importedBy.length} inbound imports`
|
|
135
|
+
})));
|
|
136
|
+
const topClusters = sortSummaryItems(Array.from(clusterCounts.entries()).map(([label, value]) => ({
|
|
137
|
+
label,
|
|
138
|
+
path: label,
|
|
139
|
+
value
|
|
140
|
+
})));
|
|
141
|
+
const topExternalPackages = sortSummaryItems(Array.from(externalPackageCounts.entries()).map(([label, value]) => ({
|
|
142
|
+
label,
|
|
143
|
+
path: label,
|
|
144
|
+
value
|
|
145
|
+
})));
|
|
146
|
+
const hotspots = llm ? sortSummaryItems(llm.summary.topHotspots.map((hotspot) => ({
|
|
147
|
+
label: hotspot.displayPath,
|
|
148
|
+
path: hotspot.path,
|
|
149
|
+
value: hotspot.reachableModulesCount,
|
|
150
|
+
description: `${hotspot.reachableModulesCount} transitive imports • ${hotspot.directImporterCount} direct importers`
|
|
151
|
+
}))) : sortSummaryItems([...graph.nodes].map((node) => ({
|
|
152
|
+
label: node.name,
|
|
153
|
+
path: node.path,
|
|
154
|
+
value: reachableCountByPath.get(node.path) ?? 0,
|
|
155
|
+
description: `${reachableCountByPath.get(node.path) ?? 0} transitive imports • ${node.importees.length} direct imports • ${node.importedBy.length} inbound imports`
|
|
156
|
+
})));
|
|
157
|
+
return {
|
|
158
|
+
overview: {
|
|
159
|
+
totalNodes: graph.nodes.length,
|
|
160
|
+
workspaceNodes: workspaceNodes.length,
|
|
161
|
+
externalNodes: externalNodes.length,
|
|
162
|
+
barrelFiles: graph.nodes.filter((node) => node.isBarrelFile).length,
|
|
163
|
+
entrypoints: graph.metadata.entrypoints.length,
|
|
164
|
+
workspacePackages: graph.metadata.packages.length,
|
|
165
|
+
externalPackages: externalPackageCounts.size
|
|
166
|
+
},
|
|
167
|
+
hotspots,
|
|
168
|
+
topImportedBy,
|
|
169
|
+
topImporters,
|
|
170
|
+
topClusters,
|
|
171
|
+
topExternalPackages,
|
|
172
|
+
hasLlm: Boolean(llm)
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
var readErrorMessage = async (response) => {
|
|
176
|
+
if ((response.headers.get("content-type") ?? "").includes("application/json")) {
|
|
177
|
+
const body = await response.json().catch(() => null);
|
|
178
|
+
if (body?.error) return body.error;
|
|
179
|
+
}
|
|
180
|
+
return await response.text().catch(() => "") || response.statusText;
|
|
181
|
+
};
|
|
182
|
+
var fetchJson = async (pathname, options) => {
|
|
183
|
+
const response = await fetch(options?.includeActiveSnapshot === false ? pathname : appendActiveSnapshotSelection(pathname), {
|
|
184
|
+
cache: "no-store",
|
|
185
|
+
headers: { accept: "application/json" }
|
|
186
|
+
});
|
|
187
|
+
if (!response.ok) throw new Error(await readErrorMessage(response));
|
|
188
|
+
return await response.json();
|
|
189
|
+
};
|
|
190
|
+
var fetchModvizBundle = () => import("./modviz-server-DoMlAyFW.js").then((n) => n.r).then(({ loadModvizBundle }) => loadModvizBundle());
|
|
191
|
+
var fetchSnapshotHistory = () => fetchJson("/api/snapshot-history", { includeActiveSnapshot: false });
|
|
192
|
+
var fetchSnapshotGraph = (snapshotId) => fetchJson(`/api/snapshot-history/${encodeURIComponent(snapshotId)}`, { includeActiveSnapshot: false });
|
|
193
|
+
var rootRouteApi = getRouteApi("__root__");
|
|
194
|
+
var useModvizBundle = () => rootRouteApi.useLoaderData();
|
|
195
|
+
var fetchModvizJsonStatus = () => fetchJson("/api/json-status");
|
|
196
|
+
//#endregion
|
|
197
|
+
export { fetchSnapshotHistory as a, getExternalPackageName as c, getWorkspacePackageNames as d, isModvizBundleReady as f, fetchSnapshotGraph as i, getNodeGroupingLabel as l, useModvizBundle as m, fetchModvizBundle as n, filterNodesByScope as o, setActiveSnapshotSelection as p, fetchModvizJsonStatus as r, getActiveSnapshotSelection as s, buildModvizSummary as t, getNodeScope as u };
|