@hansenexus/hud 0.3.0 → 0.5.0
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 +782 -6
- package/dist/a11y-B5DUaiCs.js +246 -0
- package/dist/a11y-panel-p_t4eD7p.js +207 -0
- package/dist/access-C7zlaqj6.js +100 -0
- package/dist/access-D_ewAEJG.d.ts +61 -0
- package/dist/access-panel-CEfTr9ZI.js +123 -0
- package/dist/adapter-BYoxPYTI.d.ts +33 -0
- package/dist/adapter-hcwmJtNx.js +65 -0
- package/dist/auto/runtime.d.ts +65 -0
- package/dist/auto/runtime.js +50 -0
- package/dist/auto.d.ts +15 -0
- package/dist/auto.js +33 -0
- package/dist/capabilities-rDSKjXpq.js +110 -0
- package/dist/capture-CwrIwLqi.js +300 -0
- package/dist/capture-buffer-Bbbo6omF.d.ts +35 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +275 -0
- package/dist/data-panel-DhxAmP91.js +817 -0
- package/dist/data-store-ChF1td_P.js +164 -0
- package/dist/define-hud-CHPedaQ5.d.ts +50 -0
- package/dist/design-D0kGgPoP.js +87 -0
- package/dist/detect-BxHZ0pxW.d.ts +25 -0
- package/dist/detect-CHZiSeZs.js +63 -0
- package/dist/dispatch-panel-B-xr_Giy.js +279 -0
- package/dist/env-CApnbI0r.d.ts +19 -0
- package/dist/env-CaiFPIhF.js +31 -0
- package/dist/file-xdSaQ2uR.js +103 -0
- package/dist/flags-DVtaJ8pQ.d.ts +58 -0
- package/dist/flags.d.ts +2 -0
- package/dist/flags.js +82 -0
- package/dist/force-state-BaqWsmrf.js +153 -0
- package/dist/force-state-CCqoTfVB.d.ts +23 -0
- package/dist/force-state-panel-_otVYh9i.js +97 -0
- package/dist/generate-C8lQl3Eh.js +53 -0
- package/dist/handler-BpVhxEmU.js +106 -0
- package/dist/handler-DtYVCZY6.d.ts +39 -0
- package/dist/index-BAV_1W8a.d.ts +43 -0
- package/dist/index-BJ26pse9.d.ts +70 -0
- package/dist/index-BnQ0dTZf.d.ts +19 -0
- package/dist/index-CwfX-W87.d.ts +72 -0
- package/dist/index-DcH9V3cU.d.ts +48 -0
- package/dist/index-DqOyNf1u.d.ts +65 -0
- package/dist/index-DstI_ike.d.ts +66 -0
- package/dist/index-Dxz4fn4j.d.ts +42 -0
- package/dist/index-Hhh7OXzU.d.ts +129 -0
- package/dist/index-ReFbhQ9p.d.ts +25 -0
- package/dist/index-RgXfMBuW.d.ts +48 -0
- package/dist/index-gCZBO53s.d.ts +73 -0
- package/dist/index.d.ts +6 -36
- package/dist/index.js +798 -240
- package/dist/inspect-C9Ft8fqn.js +142 -0
- package/dist/inspect-root-BkaupBMp.js +429 -0
- package/dist/marker-C66LxOhJ.d.ts +9 -0
- package/dist/marker-CMrvxPmS.d.ts +12 -0
- package/dist/marker-DjeGvL-F.js +9 -0
- package/dist/marker-uZYPOJ4M.js +12 -0
- package/dist/markers.d.ts +3 -0
- package/dist/markers.js +3 -0
- package/dist/meta-Bv0sEao3.js +6 -0
- package/dist/meta-C_G7MB5w.d.ts +49 -0
- package/dist/mocks-CA-wM2SB.d.ts +109 -0
- package/dist/mocks-ESiRqk9o.js +150 -0
- package/dist/msw-browser-wjaYgkB7.d.ts +31 -0
- package/dist/next/config.d.ts +52 -0
- package/dist/next/config.js +78 -0
- package/dist/next.d.ts +14 -19
- package/dist/next.js +7 -30
- package/dist/observe-CdDnDBRP.js +89 -0
- package/dist/observe-panel-Cgp1M8oT.js +347 -0
- package/dist/ops-panel-CEqDe_UT.js +234 -0
- package/dist/payload-MUQ9ciER.d.ts +92 -0
- package/dist/plugins/a11y.d.ts +2 -0
- package/dist/plugins/a11y.js +2 -0
- package/dist/plugins/access/server.d.ts +122 -0
- package/dist/plugins/access/server.js +340 -0
- package/dist/plugins/access.d.ts +41 -0
- package/dist/plugins/access.js +51 -0
- package/dist/plugins/agent/server.d.ts +94 -0
- package/dist/plugins/agent/server.js +455 -0
- package/dist/plugins/agent.d.ts +37 -0
- package/dist/plugins/agent.js +69 -0
- package/dist/plugins/capture/server.d.ts +92 -0
- package/dist/plugins/capture/server.js +248 -0
- package/dist/plugins/capture.d.ts +24 -0
- package/dist/plugins/capture.js +70 -0
- package/dist/plugins/data/msw-browser.d.ts +2 -0
- package/dist/plugins/data/msw-browser.js +39 -0
- package/dist/plugins/data/msw-node.d.ts +36 -0
- package/dist/plugins/data/msw-node.js +68 -0
- package/dist/plugins/data/server.d.ts +257 -0
- package/dist/plugins/data/server.js +717 -0
- package/dist/plugins/data.d.ts +6 -0
- package/dist/plugins/data.js +51 -0
- package/dist/plugins/design/server.d.ts +54 -0
- package/dist/plugins/design/server.js +198 -0
- package/dist/plugins/design.d.ts +5 -0
- package/dist/plugins/design.js +4 -0
- package/dist/plugins/inspect/convex.d.ts +2 -0
- package/dist/plugins/inspect/convex.js +486 -0
- package/dist/plugins/inspect/react-query.d.ts +2 -0
- package/dist/plugins/inspect/react-query.js +225 -0
- package/dist/plugins/inspect/sockets.d.ts +51 -0
- package/dist/plugins/inspect/sockets.js +397 -0
- package/dist/plugins/inspect/swr.d.ts +2 -0
- package/dist/plugins/inspect/swr.js +218 -0
- package/dist/plugins/inspect.d.ts +4 -0
- package/dist/plugins/inspect.js +3 -0
- package/dist/plugins/observe.d.ts +4 -0
- package/dist/plugins/observe.js +2 -0
- package/dist/plugins/ops/server.d.ts +82 -0
- package/dist/plugins/ops/server.js +381 -0
- package/dist/plugins/ops.d.ts +27 -0
- package/dist/plugins/ops.js +41 -0
- package/dist/plugins/routes/server.d.ts +88 -0
- package/dist/plugins/routes/server.js +62 -0
- package/dist/plugins/routes.d.ts +3 -0
- package/dist/plugins/routes.js +216 -0
- package/dist/plugins/seo.d.ts +2 -0
- package/dist/plugins/seo.js +2 -0
- package/dist/plugins/vitals.d.ts +2 -25
- package/dist/plugins/vitals.js +4 -86
- package/dist/plugins-BZvDqGx5.d.ts +144 -0
- package/dist/{plugins-CzUiTn_r.js → plugins-DVy_vaYr.js} +3 -1
- package/dist/poll-CjKsWZi8.js +89 -0
- package/dist/requests-BwD6MKEq.js +282 -0
- package/dist/requests-CJrUf465.d.ts +50 -0
- package/dist/review.d.ts +181 -0
- package/dist/review.js +1017 -0
- package/dist/same-origin-BGet22CC.js +21 -0
- package/dist/scan-DzJNXqOk.js +165 -0
- package/dist/selector-NSYSe7AZ.js +28 -0
- package/dist/seo-Dq9q_QkO.js +551 -0
- package/dist/seo-panel-CfiY-TnT.js +124 -0
- package/dist/server.d.ts +3 -39
- package/dist/server.js +2 -105
- package/dist/sessions-panel-COvhPAzv.js +98 -0
- package/dist/shortcut-s_mjGeU8.js +179 -0
- package/dist/state-CjjZPjPJ.js +40 -0
- package/dist/state-boundary.d.ts +26 -0
- package/dist/state-boundary.js +61 -0
- package/dist/store/convex.d.ts +33 -0
- package/dist/store/convex.js +52 -0
- package/dist/store-CQqIIKTc.js +59 -0
- package/dist/store-Ync9eb1G.js +67 -0
- package/dist/store.d.ts +76 -0
- package/dist/store.js +188 -0
- package/dist/styles-BA8ueHoV.js +342 -0
- package/dist/styles-DKU_P8MH.js +139 -0
- package/dist/styles-DPpDPmzi.js +68 -0
- package/dist/tokens-panel-CbMQfasZ.js +142 -0
- package/dist/types-B-ulf2Jp.js +8 -0
- package/dist/types-BIgGf-0C.d.ts +25 -0
- package/dist/types-BIkI-qN8.js +30 -0
- package/dist/types-Cxh4twqc.d.ts +50 -0
- package/dist/types-DIdPfjtV.js +6 -0
- package/dist/types-DaJcsEjO.d.ts +44 -0
- package/dist/types-Dn68psVz.d.ts +118 -0
- package/dist/types-f3jlNxzw.d.ts +92 -0
- package/dist/types-szkr2QOF.d.ts +39 -0
- package/dist/unlock-store-4V3vR4Eg.js +96 -0
- package/dist/variant-groups-TIfO3NIj.js +137 -0
- package/dist/variant-groups-aAIrcNK5.d.ts +36 -0
- package/dist/variants-panel-BDoSkwBJ.js +457 -0
- package/dist/variants-types-CcRf119M.d.ts +63 -0
- package/dist/variants.d.ts +43 -0
- package/dist/variants.js +83 -0
- package/dist/vitals-panel-BCmMUntW.js +30 -0
- package/dist/vite.d.ts +37 -0
- package/dist/vite.js +134 -0
- package/package.json +85 -5
- package/dist/define-hud-BHQR8Lbv.d.ts +0 -31
- package/dist/plugins-1QmTmZyL.d.ts +0 -76
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { i as definePlugin } from "./plugins-DVy_vaYr.js";
|
|
2
|
+
import { a as isRequestError, l as requestBuffer, o as markReplay } from "./requests-BwD6MKEq.js";
|
|
3
|
+
import { t as installCapture } from "./capture-CwrIwLqi.js";
|
|
4
|
+
import { lazy, useEffect, useSyncExternalStore } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/plugins/inspect/view.ts
|
|
7
|
+
const FILTERS = [
|
|
8
|
+
"all",
|
|
9
|
+
"fetch",
|
|
10
|
+
"xhr",
|
|
11
|
+
"actions",
|
|
12
|
+
"errors"
|
|
13
|
+
];
|
|
14
|
+
function matches(entry, filter) {
|
|
15
|
+
switch (filter) {
|
|
16
|
+
case "all": return true;
|
|
17
|
+
case "errors": return isRequestError(entry);
|
|
18
|
+
case "actions": return entry.actionId !== void 0;
|
|
19
|
+
default: return entry.transport === filter && entry.actionId === void 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const REQUESTS_TAB = "requests";
|
|
23
|
+
let view = {
|
|
24
|
+
filter: "all",
|
|
25
|
+
selected: null,
|
|
26
|
+
tab: REQUESTS_TAB
|
|
27
|
+
};
|
|
28
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
29
|
+
function setView(next) {
|
|
30
|
+
view = {
|
|
31
|
+
...view,
|
|
32
|
+
...next
|
|
33
|
+
};
|
|
34
|
+
for (const listener of listeners) listener();
|
|
35
|
+
}
|
|
36
|
+
function subscribe(listener) {
|
|
37
|
+
listeners.add(listener);
|
|
38
|
+
return () => listeners.delete(listener);
|
|
39
|
+
}
|
|
40
|
+
const getView = () => view;
|
|
41
|
+
function useView() {
|
|
42
|
+
return useSyncExternalStore(subscribe, getView, getView);
|
|
43
|
+
}
|
|
44
|
+
function useRequests() {
|
|
45
|
+
return useSyncExternalStore(requestBuffer.subscribe, requestBuffer.getSnapshot, requestBuffer.getSnapshot);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/plugins/inspect/replay.ts
|
|
49
|
+
/**
|
|
50
|
+
* Why a request cannot be replayed, or `null` when it can. Bodies the capture
|
|
51
|
+
* could only describe (blobs, streams, files) cannot be rebuilt.
|
|
52
|
+
*/
|
|
53
|
+
function replayBlocker(entry) {
|
|
54
|
+
const { request } = entry;
|
|
55
|
+
if (request.form?.some(([, value]) => value.startsWith("[file "))) return "has a file upload";
|
|
56
|
+
if (request.bodyNote && request.body === void 0) return `body is ${request.bodyNote}`;
|
|
57
|
+
if (request.bodyTruncated) return "body was truncated";
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Sends the request again through the page's `fetch`, so the capture records
|
|
62
|
+
* the replay as a new entry tagged `replayOf`. Redacted headers and fields
|
|
63
|
+
* are not resent (their values are gone); cookies go along with
|
|
64
|
+
* `credentials: "include"`. Resolves once the response has arrived.
|
|
65
|
+
*/
|
|
66
|
+
async function replay(entry) {
|
|
67
|
+
const blocker = replayBlocker(entry);
|
|
68
|
+
if (blocker) throw new Error(`hud: cannot replay, ${blocker}`);
|
|
69
|
+
const headers = new Headers();
|
|
70
|
+
for (const [name, value] of Object.entries(entry.request.headers)) if (value !== "[redacted]") headers.set(name, value);
|
|
71
|
+
let body;
|
|
72
|
+
if (entry.request.form) {
|
|
73
|
+
const form = new FormData();
|
|
74
|
+
for (const [name, value] of entry.request.form) form.append(name, value);
|
|
75
|
+
body = form;
|
|
76
|
+
headers.delete("content-type");
|
|
77
|
+
} else if (entry.request.body !== void 0 && entry.method !== "GET" && entry.method !== "HEAD") body = entry.request.body;
|
|
78
|
+
markReplay(entry.id);
|
|
79
|
+
return fetch(entry.url, {
|
|
80
|
+
method: entry.method,
|
|
81
|
+
headers,
|
|
82
|
+
credentials: "include",
|
|
83
|
+
...body !== void 0 ? { body } : {}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/plugins/inspect/index.tsx
|
|
88
|
+
const InspectRoot = lazy(() => import("./inspect-root-BkaupBMp.js"));
|
|
89
|
+
const INSPECT_CAPABILITY = "inspect.read";
|
|
90
|
+
/**
|
|
91
|
+
* Data inspector on top of the observe capture: every fetch, XHR and Next
|
|
92
|
+
* Server Action with timing, status, headers and bodies, and a replay
|
|
93
|
+
* button. `authorization`, `cookie`, `set-cookie` and known token fields are
|
|
94
|
+
* redacted before anything is stored. Needs `inspect.read`.
|
|
95
|
+
*
|
|
96
|
+
* Capture starts when the HUD mounts, so requests made before the panel
|
|
97
|
+
* opens are already listed. It works with or without the observe plugin.
|
|
98
|
+
* Adapters add a tab each; without them the panel is the request list alone.
|
|
99
|
+
*/
|
|
100
|
+
function inspect({ ignore, adapters = [] } = {}) {
|
|
101
|
+
const ids = /* @__PURE__ */ new Set();
|
|
102
|
+
for (const adapter of adapters) {
|
|
103
|
+
if (adapter.id === "requests" || ids.has(adapter.id)) throw new Error(`hud: duplicate inspect adapter id "${adapter.id}"`);
|
|
104
|
+
ids.add(adapter.id);
|
|
105
|
+
}
|
|
106
|
+
function InspectPill() {
|
|
107
|
+
useEffect(() => installCapture({
|
|
108
|
+
requests: true,
|
|
109
|
+
...ignore ? { ignore } : {}
|
|
110
|
+
}), []);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
for (const adapter of adapters) adapter.install?.();
|
|
113
|
+
}, []);
|
|
114
|
+
const entries = useRequests();
|
|
115
|
+
const failed = entries.filter(isRequestError).length;
|
|
116
|
+
const pending = entries.some((entry) => entry.status === void 0);
|
|
117
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "dot",
|
|
119
|
+
"data-rating": failed > 0 ? "poor" : pending ? "needs-improvement" : "good"
|
|
120
|
+
}), entries.length === 1 ? "1 req" : `${entries.length} req`] });
|
|
121
|
+
}
|
|
122
|
+
function Panel() {
|
|
123
|
+
return /* @__PURE__ */ jsx(InspectRoot, { adapters });
|
|
124
|
+
}
|
|
125
|
+
return definePlugin({
|
|
126
|
+
id: "inspect",
|
|
127
|
+
title: "Inspect",
|
|
128
|
+
capability: INSPECT_CAPABILITY,
|
|
129
|
+
pill: InspectPill,
|
|
130
|
+
panel: Panel,
|
|
131
|
+
commands: [{
|
|
132
|
+
id: "clear",
|
|
133
|
+
title: "Clear captured requests",
|
|
134
|
+
run: () => {
|
|
135
|
+
requestBuffer.clear();
|
|
136
|
+
setView({ selected: null });
|
|
137
|
+
}
|
|
138
|
+
}]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { FILTERS as a, setView as c, replayBlocker as i, useRequests as l, inspect as n, REQUESTS_TAB as o, replay as r, matches as s, INSPECT_CAPABILITY as t, useView as u };
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { a as isRequestError, l as requestBuffer } from "./requests-BwD6MKEq.js";
|
|
2
|
+
import { a as FILTERS, c as setView, i as replayBlocker, l as useRequests, o as REQUESTS_TAB, r as replay, s as matches, u as useView } from "./inspect-C9Ft8fqn.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/plugins/inspect/inspect-panel.tsx
|
|
6
|
+
function statusLevel(entry) {
|
|
7
|
+
if (entry.status === void 0) return "pending";
|
|
8
|
+
if (isRequestError(entry)) return "error";
|
|
9
|
+
return entry.status >= 400 ? "warn" : "ok";
|
|
10
|
+
}
|
|
11
|
+
function statusText(entry) {
|
|
12
|
+
if (entry.status === void 0) return "…";
|
|
13
|
+
return entry.status === 0 ? "ERR" : String(entry.status);
|
|
14
|
+
}
|
|
15
|
+
/** The URL without the page's own origin, so rows read as paths. */
|
|
16
|
+
function shortUrl(url) {
|
|
17
|
+
if (typeof location === "undefined") return url;
|
|
18
|
+
return url.startsWith(location.origin) ? url.slice(location.origin.length) || "/" : url;
|
|
19
|
+
}
|
|
20
|
+
/** JSON bodies are pretty-printed; anything else is shown as captured. */
|
|
21
|
+
function pretty(body) {
|
|
22
|
+
if (!/^\s*[[{]/.test(body)) return body;
|
|
23
|
+
try {
|
|
24
|
+
return JSON.stringify(JSON.parse(body), null, 2);
|
|
25
|
+
} catch {
|
|
26
|
+
return body;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Requests, newest first; click a row for headers, bodies and replay. */
|
|
30
|
+
function InspectPanel() {
|
|
31
|
+
const entries = useRequests();
|
|
32
|
+
const { filter, selected } = useView();
|
|
33
|
+
const rows = entries.filter((entry) => matches(entry, filter)).slice(-100).reverse();
|
|
34
|
+
const current = selected === null ? void 0 : entries.find((e) => e.id === selected);
|
|
35
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: "insp-toolbar",
|
|
38
|
+
role: "toolbar",
|
|
39
|
+
"aria-label": "Filter requests",
|
|
40
|
+
children: [FILTERS.map((f) => /* @__PURE__ */ jsxs("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
className: "insp-chip",
|
|
43
|
+
"aria-pressed": filter === f,
|
|
44
|
+
onClick: () => setView({ filter: f }),
|
|
45
|
+
children: [f, f !== "all" && /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "insp-count",
|
|
47
|
+
children: entries.filter((e) => matches(e, f)).length
|
|
48
|
+
})]
|
|
49
|
+
}, f)), /* @__PURE__ */ jsx("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
className: "insp-chip insp-clear",
|
|
52
|
+
onClick: () => {
|
|
53
|
+
requestBuffer.clear();
|
|
54
|
+
setView({ selected: null });
|
|
55
|
+
},
|
|
56
|
+
children: "clear"
|
|
57
|
+
})]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: "insp-log",
|
|
61
|
+
role: "listbox",
|
|
62
|
+
"aria-label": "Requests",
|
|
63
|
+
children: rows.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
64
|
+
className: "empty",
|
|
65
|
+
children: filter === "all" ? "No requests yet. fetch, XHR and Server Actions land here." : `No ${filter} captured.`
|
|
66
|
+
}) : rows.map((entry) => /* @__PURE__ */ jsxs("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
role: "option",
|
|
69
|
+
className: "insp-row",
|
|
70
|
+
"aria-selected": entry.id === selected,
|
|
71
|
+
onClick: () => setView({ selected: entry.id === selected ? null : entry.id }),
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: "insp-method",
|
|
75
|
+
children: entry.method
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: "insp-url",
|
|
79
|
+
title: entry.url,
|
|
80
|
+
children: shortUrl(entry.url)
|
|
81
|
+
}),
|
|
82
|
+
entry.actionId !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: "insp-badge",
|
|
84
|
+
"data-kind": "action",
|
|
85
|
+
title: entry.actionId,
|
|
86
|
+
children: "action"
|
|
87
|
+
}),
|
|
88
|
+
entry.replayOf !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "insp-badge",
|
|
90
|
+
"data-kind": "replay",
|
|
91
|
+
children: "replay"
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "insp-status",
|
|
95
|
+
"data-level": statusLevel(entry),
|
|
96
|
+
children: statusText(entry)
|
|
97
|
+
}),
|
|
98
|
+
entry.durationMs !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
99
|
+
className: "insp-ms",
|
|
100
|
+
children: [entry.durationMs, " ms"]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
}, entry.id))
|
|
104
|
+
}),
|
|
105
|
+
current && /* @__PURE__ */ jsx(Detail, { entry: current })
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
function Detail({ entry }) {
|
|
109
|
+
const [replayError, setReplayError] = useState(null);
|
|
110
|
+
const [replaying, setReplaying] = useState(false);
|
|
111
|
+
const blocker = replayBlocker(entry);
|
|
112
|
+
const onReplay = async () => {
|
|
113
|
+
setReplayError(null);
|
|
114
|
+
setReplaying(true);
|
|
115
|
+
try {
|
|
116
|
+
await replay(entry);
|
|
117
|
+
const sent = requestBuffer.getSnapshot().filter((e) => e.replayOf === entry.id).at(-1);
|
|
118
|
+
if (sent) setView({ selected: sent.id });
|
|
119
|
+
} catch (error) {
|
|
120
|
+
setReplayError(error instanceof Error ? error.message : String(error));
|
|
121
|
+
} finally {
|
|
122
|
+
setReplaying(false);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
126
|
+
className: "insp-detail",
|
|
127
|
+
"aria-label": "Request detail",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsxs("div", {
|
|
130
|
+
className: "insp-head",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx("span", {
|
|
133
|
+
className: "insp-method",
|
|
134
|
+
children: entry.method
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: "insp-url",
|
|
138
|
+
title: entry.url,
|
|
139
|
+
children: entry.url
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsx("button", {
|
|
142
|
+
type: "button",
|
|
143
|
+
className: "insp-replay",
|
|
144
|
+
disabled: replaying || blocker !== null,
|
|
145
|
+
title: blocker ? `Cannot replay: ${blocker}` : "Send this request again",
|
|
146
|
+
onClick: onReplay,
|
|
147
|
+
children: replaying ? "Replaying…" : "Replay"
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs("div", {
|
|
152
|
+
className: "insp-meta",
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsxs("span", { children: ["status ", /* @__PURE__ */ jsx("b", { children: statusText(entry) })] }),
|
|
155
|
+
entry.durationMs !== void 0 && /* @__PURE__ */ jsxs("span", { children: ["time ", /* @__PURE__ */ jsxs("b", { children: [entry.durationMs, " ms"] })] }),
|
|
156
|
+
/* @__PURE__ */ jsxs("span", { children: ["via ", /* @__PURE__ */ jsx("b", { children: entry.transport })] }),
|
|
157
|
+
entry.actionId !== void 0 && /* @__PURE__ */ jsxs("span", { children: ["Server Action ", /* @__PURE__ */ jsx("b", { children: entry.actionId })] }),
|
|
158
|
+
entry.replayOf !== void 0 && /* @__PURE__ */ jsxs("span", { children: ["replay of ", /* @__PURE__ */ jsxs("b", { children: ["#", entry.replayOf] })] }),
|
|
159
|
+
entry.error && /* @__PURE__ */ jsx("span", {
|
|
160
|
+
className: "insp-error",
|
|
161
|
+
children: entry.error
|
|
162
|
+
}),
|
|
163
|
+
replayError && /* @__PURE__ */ jsx("span", {
|
|
164
|
+
className: "insp-error",
|
|
165
|
+
children: replayError
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ jsx(Section, {
|
|
170
|
+
title: "Request",
|
|
171
|
+
payload: entry.request
|
|
172
|
+
}),
|
|
173
|
+
entry.response && /* @__PURE__ */ jsx(Section, {
|
|
174
|
+
title: "Response",
|
|
175
|
+
payload: entry.response
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function Section({ title, payload }) {
|
|
181
|
+
const headers = Object.entries(payload.headers);
|
|
182
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
183
|
+
className: "insp-section",
|
|
184
|
+
open: true,
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ jsxs("summary", { children: [
|
|
187
|
+
title,
|
|
188
|
+
" (",
|
|
189
|
+
headers.length,
|
|
190
|
+
" headers)"
|
|
191
|
+
] }),
|
|
192
|
+
headers.length > 0 && /* @__PURE__ */ jsx("dl", {
|
|
193
|
+
className: "insp-headers",
|
|
194
|
+
children: headers.map(([name, value]) => /* @__PURE__ */ jsxs("div", {
|
|
195
|
+
style: { display: "contents" },
|
|
196
|
+
children: [/* @__PURE__ */ jsx("dt", { children: name }), /* @__PURE__ */ jsx("dd", { children: value })]
|
|
197
|
+
}, name))
|
|
198
|
+
}),
|
|
199
|
+
payload.body !== void 0 ? /* @__PURE__ */ jsxs("pre", {
|
|
200
|
+
className: "insp-body",
|
|
201
|
+
"data-section": title.toLowerCase(),
|
|
202
|
+
children: [pretty(payload.body), payload.bodyTruncated ? "\n… (truncated)" : ""]
|
|
203
|
+
}) : payload.bodyNote ? /* @__PURE__ */ jsx("div", {
|
|
204
|
+
className: "insp-note",
|
|
205
|
+
children: payload.bodyNote
|
|
206
|
+
}) : null
|
|
207
|
+
]
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/plugins/inspect/styles.ts
|
|
212
|
+
/**
|
|
213
|
+
* The inspect panel's styles. Rendered in the panel's own `<style>` inside the
|
|
214
|
+
* HUD's shadow root, so they ship only with this plugin and build on the
|
|
215
|
+
* shell's `--hud-*` tokens.
|
|
216
|
+
*/
|
|
217
|
+
const INSPECT_CSS = `
|
|
218
|
+
.insp { display: flex; flex-direction: column; gap: 8px; width: 396px; max-width: 100%; }
|
|
219
|
+
|
|
220
|
+
.insp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hud-border); }
|
|
221
|
+
.hud .insp-tab {
|
|
222
|
+
padding: 2px 8px 4px;
|
|
223
|
+
margin-bottom: -1px;
|
|
224
|
+
border-bottom: 2px solid transparent;
|
|
225
|
+
font-size: 11px;
|
|
226
|
+
font-weight: 500;
|
|
227
|
+
color: var(--hud-fg-muted);
|
|
228
|
+
}
|
|
229
|
+
.hud .insp-tab:hover { color: var(--hud-fg); }
|
|
230
|
+
.hud .insp-tab[aria-selected="true"] { color: var(--hud-fg); border-bottom-color: var(--hud-accent); }
|
|
231
|
+
.insp-tab .insp-count { margin-left: 4px; font-family: var(--hud-mono); opacity: 0.6; }
|
|
232
|
+
.insp-tabpanel { display: flex; flex-direction: column; gap: 8px; }
|
|
233
|
+
|
|
234
|
+
/* Shared by the adapters: a secondary row line, a key/value grid and inline actions. */
|
|
235
|
+
.insp-sub { flex-basis: 100%; padding-left: 50px; color: var(--hud-fg-muted); font-size: 10px; }
|
|
236
|
+
.insp-row[data-idle="true"] { opacity: 0.6; }
|
|
237
|
+
.insp-kv {
|
|
238
|
+
display: grid;
|
|
239
|
+
grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
|
|
240
|
+
gap: 1px 10px;
|
|
241
|
+
margin: 0;
|
|
242
|
+
font-family: var(--hud-mono);
|
|
243
|
+
font-size: 11px;
|
|
244
|
+
}
|
|
245
|
+
.insp-kv dt { color: var(--hud-fg-muted); }
|
|
246
|
+
.insp-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
|
247
|
+
.insp-actions { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
248
|
+
.hud .insp-action {
|
|
249
|
+
padding: 1px 8px;
|
|
250
|
+
border: 1px solid var(--hud-border);
|
|
251
|
+
border-radius: 999px;
|
|
252
|
+
font-family: var(--hud-font);
|
|
253
|
+
font-size: 11px;
|
|
254
|
+
}
|
|
255
|
+
.hud .insp-action:hover:not(:disabled) { background: var(--hud-bg-subtle); }
|
|
256
|
+
.hud .insp-action:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
257
|
+
.insp-heading {
|
|
258
|
+
margin: 0;
|
|
259
|
+
font-family: var(--hud-font);
|
|
260
|
+
font-size: 10px;
|
|
261
|
+
font-weight: 600;
|
|
262
|
+
letter-spacing: 0.06em;
|
|
263
|
+
text-transform: uppercase;
|
|
264
|
+
color: var(--hud-fg-muted);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.insp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
|
|
268
|
+
.hud .insp-chip {
|
|
269
|
+
padding: 1px 7px;
|
|
270
|
+
border-radius: 999px;
|
|
271
|
+
font-family: var(--hud-mono);
|
|
272
|
+
font-size: 11px;
|
|
273
|
+
color: var(--hud-fg-muted);
|
|
274
|
+
}
|
|
275
|
+
.hud .insp-chip:hover { background: var(--hud-bg-subtle); }
|
|
276
|
+
.hud .insp-chip[aria-pressed="true"] { background: var(--hud-bg-subtle); color: var(--hud-fg); }
|
|
277
|
+
.insp-chip .insp-count { margin-left: 4px; opacity: 0.6; }
|
|
278
|
+
.hud .insp-clear { margin-left: auto; }
|
|
279
|
+
|
|
280
|
+
.insp-log {
|
|
281
|
+
max-height: 200px;
|
|
282
|
+
overflow: auto;
|
|
283
|
+
border: 1px solid var(--hud-border);
|
|
284
|
+
border-radius: 4px;
|
|
285
|
+
font-family: var(--hud-mono);
|
|
286
|
+
font-size: 11px;
|
|
287
|
+
}
|
|
288
|
+
.hud .insp-row {
|
|
289
|
+
display: flex;
|
|
290
|
+
flex-wrap: wrap;
|
|
291
|
+
align-items: baseline;
|
|
292
|
+
gap: 0 6px;
|
|
293
|
+
width: 100%;
|
|
294
|
+
padding: 2px 6px;
|
|
295
|
+
text-align: left;
|
|
296
|
+
}
|
|
297
|
+
.hud .insp-row:hover { background: var(--hud-bg-subtle); }
|
|
298
|
+
.hud .insp-row[aria-selected="true"] { background: var(--hud-bg-subtle); box-shadow: inset 2px 0 var(--hud-accent); }
|
|
299
|
+
.insp-row + .insp-row { border-top: 1px solid var(--hud-border); }
|
|
300
|
+
.insp-method { flex-shrink: 0; width: 44px; color: var(--hud-fg-muted); }
|
|
301
|
+
.insp-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
302
|
+
.insp-badge {
|
|
303
|
+
flex-shrink: 0;
|
|
304
|
+
padding: 0 5px;
|
|
305
|
+
border-radius: 999px;
|
|
306
|
+
background: var(--hud-accent);
|
|
307
|
+
color: var(--hud-accent-fg);
|
|
308
|
+
font-size: 9px;
|
|
309
|
+
line-height: 14px;
|
|
310
|
+
text-transform: uppercase;
|
|
311
|
+
}
|
|
312
|
+
.insp-badge[data-kind="replay"] { background: var(--hud-bg-subtle); color: var(--hud-fg-muted); }
|
|
313
|
+
.insp-status { flex-shrink: 0; color: var(--hud-good); }
|
|
314
|
+
.insp-status[data-level="warn"] { color: var(--hud-warn); }
|
|
315
|
+
.insp-status[data-level="error"] { color: var(--hud-poor); }
|
|
316
|
+
.insp-status[data-level="pending"] { color: var(--hud-fg-muted); }
|
|
317
|
+
.insp-ms { flex-shrink: 0; color: var(--hud-fg-muted); }
|
|
318
|
+
.insp-log .empty { margin: 0; padding: 6px; }
|
|
319
|
+
|
|
320
|
+
.insp-detail { display: flex; flex-direction: column; gap: 6px; font-family: var(--hud-mono); font-size: 11px; }
|
|
321
|
+
.insp-head { display: flex; align-items: center; gap: 8px; }
|
|
322
|
+
.insp-head .insp-url { font-weight: 600; }
|
|
323
|
+
.hud .insp-replay {
|
|
324
|
+
flex-shrink: 0;
|
|
325
|
+
padding: 1px 8px;
|
|
326
|
+
border: 1px solid var(--hud-border);
|
|
327
|
+
border-radius: 999px;
|
|
328
|
+
font-family: var(--hud-font);
|
|
329
|
+
}
|
|
330
|
+
.hud .insp-replay:hover:not(:disabled) { background: var(--hud-bg-subtle); }
|
|
331
|
+
.hud .insp-replay:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
332
|
+
.insp-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--hud-fg-muted); }
|
|
333
|
+
.insp-meta b { color: var(--hud-fg); font-weight: 500; }
|
|
334
|
+
.insp-error { color: var(--hud-poor); }
|
|
335
|
+
|
|
336
|
+
.insp-section { border: 1px solid var(--hud-border); border-radius: 4px; }
|
|
337
|
+
.insp-section > summary {
|
|
338
|
+
padding: 3px 6px;
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
font-family: var(--hud-font);
|
|
341
|
+
font-size: 10px;
|
|
342
|
+
font-weight: 600;
|
|
343
|
+
letter-spacing: 0.06em;
|
|
344
|
+
text-transform: uppercase;
|
|
345
|
+
color: var(--hud-fg-muted);
|
|
346
|
+
}
|
|
347
|
+
.insp-headers {
|
|
348
|
+
display: grid;
|
|
349
|
+
grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
|
|
350
|
+
gap: 1px 10px;
|
|
351
|
+
margin: 0;
|
|
352
|
+
padding: 2px 6px 4px;
|
|
353
|
+
border-top: 1px solid var(--hud-border);
|
|
354
|
+
}
|
|
355
|
+
.insp-headers dt { color: var(--hud-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
356
|
+
.insp-headers dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
|
357
|
+
.insp-body {
|
|
358
|
+
margin: 0;
|
|
359
|
+
padding: 4px 6px;
|
|
360
|
+
max-height: 160px;
|
|
361
|
+
overflow: auto;
|
|
362
|
+
border-top: 1px solid var(--hud-border);
|
|
363
|
+
white-space: pre-wrap;
|
|
364
|
+
overflow-wrap: anywhere;
|
|
365
|
+
font: inherit;
|
|
366
|
+
}
|
|
367
|
+
.insp-note { padding: 2px 6px 4px; border-top: 1px solid var(--hud-border); color: var(--hud-fg-muted); }
|
|
368
|
+
`;
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/plugins/inspect/inspect-root.tsx
|
|
371
|
+
/**
|
|
372
|
+
* The panel entry, loaded on first open: the scoped stylesheet plus the
|
|
373
|
+
* request list, or the request list and one tab per adapter.
|
|
374
|
+
*/
|
|
375
|
+
function InspectRoot({ adapters }) {
|
|
376
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
377
|
+
className: "insp",
|
|
378
|
+
children: [/* @__PURE__ */ jsx("style", { children: INSPECT_CSS }), adapters.length === 0 ? /* @__PURE__ */ jsx(InspectPanel, {}) : /* @__PURE__ */ jsx(Tabs, { adapters })]
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/** The request list plus one tab per adapter; the open tab survives closing the panel. */
|
|
382
|
+
function Tabs({ adapters }) {
|
|
383
|
+
const { tab } = useView();
|
|
384
|
+
const requests = useRequests();
|
|
385
|
+
const active = adapters.find((adapter) => adapter.id === tab);
|
|
386
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
387
|
+
className: "insp-tabs",
|
|
388
|
+
role: "tablist",
|
|
389
|
+
"aria-label": "Inspect sources",
|
|
390
|
+
children: [/* @__PURE__ */ jsx(TabButton, {
|
|
391
|
+
id: REQUESTS_TAB,
|
|
392
|
+
title: "Requests",
|
|
393
|
+
count: requests.length,
|
|
394
|
+
selected: active === void 0
|
|
395
|
+
}), adapters.map((adapter) => /* @__PURE__ */ jsx(AdapterTab, {
|
|
396
|
+
adapter,
|
|
397
|
+
selected: adapter === active
|
|
398
|
+
}, adapter.id))]
|
|
399
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
400
|
+
role: "tabpanel",
|
|
401
|
+
"aria-label": active?.title ?? "Requests",
|
|
402
|
+
className: "insp-tabpanel",
|
|
403
|
+
children: active ? /* @__PURE__ */ jsx(active.Panel, {}) : /* @__PURE__ */ jsx(InspectPanel, {})
|
|
404
|
+
})] });
|
|
405
|
+
}
|
|
406
|
+
function AdapterTab({ adapter, selected }) {
|
|
407
|
+
const count = adapter.useCount?.();
|
|
408
|
+
return /* @__PURE__ */ jsx(TabButton, {
|
|
409
|
+
id: adapter.id,
|
|
410
|
+
title: adapter.title,
|
|
411
|
+
...count !== void 0 ? { count } : {},
|
|
412
|
+
selected
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
function TabButton({ id, title, count, selected }) {
|
|
416
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
417
|
+
type: "button",
|
|
418
|
+
role: "tab",
|
|
419
|
+
className: "insp-tab",
|
|
420
|
+
"aria-selected": selected,
|
|
421
|
+
onClick: () => setView({ tab: id }),
|
|
422
|
+
children: [title, count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
423
|
+
className: "insp-count",
|
|
424
|
+
children: count
|
|
425
|
+
})]
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
export { InspectRoot as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/review/marker.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Literal on the review entrypoint's root. A consumer's bundle gate expects it
|
|
4
|
+
* where the review widget is meant to ship and nowhere else; it never appears
|
|
5
|
+
* next to `HUD_DEV_MARKER`, which belongs to the dev shell alone.
|
|
6
|
+
*/
|
|
7
|
+
declare const HUD_REVIEW_MARKER = "__HANSENEXUS_HUD_REVIEW__";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { HUD_REVIEW_MARKER as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/core/marker.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Literal a consumer's CI bundle gate greps for in production client chunks.
|
|
4
|
+
* It is rendered as an attribute on the HUD root, so a bundler cannot drop it
|
|
5
|
+
* while keeping the HUD, and it is unmistakably deliberate rather than an
|
|
6
|
+
* incidental string a refactor could rename away.
|
|
7
|
+
*/
|
|
8
|
+
declare const HUD_DEV_MARKER = "__HANSENEXUS_HUD_DEV__";
|
|
9
|
+
/** Tag name of the element that hosts the HUD's shadow root. */
|
|
10
|
+
declare const HUD_HOST_TAG = "hn-hud";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { HUD_HOST_TAG as n, HUD_DEV_MARKER as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/review/marker.ts
|
|
2
|
+
/**
|
|
3
|
+
* Literal on the review entrypoint's root. A consumer's bundle gate expects it
|
|
4
|
+
* where the review widget is meant to ship and nowhere else; it never appears
|
|
5
|
+
* next to `HUD_DEV_MARKER`, which belongs to the dev shell alone.
|
|
6
|
+
*/
|
|
7
|
+
const HUD_REVIEW_MARKER = "__HANSENEXUS_HUD_REVIEW__";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { HUD_REVIEW_MARKER as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/core/marker.ts
|
|
2
|
+
/**
|
|
3
|
+
* Literal a consumer's CI bundle gate greps for in production client chunks.
|
|
4
|
+
* It is rendered as an attribute on the HUD root, so a bundler cannot drop it
|
|
5
|
+
* while keeping the HUD, and it is unmistakably deliberate rather than an
|
|
6
|
+
* incidental string a refactor could rename away.
|
|
7
|
+
*/
|
|
8
|
+
const HUD_DEV_MARKER = "__HANSENEXUS_HUD_DEV__";
|
|
9
|
+
/** Tag name of the element that hosts the HUD's shadow root. */
|
|
10
|
+
const HUD_HOST_TAG = "hn-hud";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { HUD_HOST_TAG as n, HUD_DEV_MARKER as t };
|
package/dist/markers.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/plugins/routes/types.d.ts
|
|
2
|
+
/** One dynamic segment of a route pattern. */
|
|
3
|
+
interface RouteSegment {
|
|
4
|
+
/** Folder token: `[slug]`, `[...parts]`, `[[...parts]]`. */
|
|
5
|
+
raw: string;
|
|
6
|
+
/** Param name without brackets or spread: `slug`, `parts`. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** `[...x]` or `[[...x]]`. */
|
|
9
|
+
catchAll: boolean;
|
|
10
|
+
/** `[[...x]]`. */
|
|
11
|
+
optional: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** One concrete URL of a route, with the fixture values that built it. */
|
|
14
|
+
interface RouteUrl {
|
|
15
|
+
url: string;
|
|
16
|
+
/** Fixture value per dynamic segment. */
|
|
17
|
+
params: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
/** One page of the app's `app/` tree. */
|
|
20
|
+
interface RouteEntry {
|
|
21
|
+
/** Folder pattern: `/(marketing)/posts/[slug]`. */
|
|
22
|
+
pattern: string;
|
|
23
|
+
/** URL pattern without groups: `/posts/[slug]`. */
|
|
24
|
+
path: string;
|
|
25
|
+
/** Outermost route group, or null. */
|
|
26
|
+
group: string | null;
|
|
27
|
+
/** Dynamic segments in path order. */
|
|
28
|
+
segments: RouteSegment[];
|
|
29
|
+
/** Concrete URLs, one per fixture combination; empty while a segment has no fixture. */
|
|
30
|
+
urls: RouteUrl[];
|
|
31
|
+
/** Param names without a fixture. */
|
|
32
|
+
unresolved: string[];
|
|
33
|
+
/** Page file relative to the app directory. */
|
|
34
|
+
source: string;
|
|
35
|
+
}
|
|
36
|
+
/** `GET <apiBase>/routes/routes`. */
|
|
37
|
+
interface RoutesResponse {
|
|
38
|
+
ok: true;
|
|
39
|
+
/** App directory the scanner walked, relative to the server's cwd when inside it. */
|
|
40
|
+
dir: string;
|
|
41
|
+
routes: RouteEntry[];
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/plugins/routes/meta.d.ts
|
|
45
|
+
/** Shared by both halves, so client and server gate on the same capability. */
|
|
46
|
+
declare const ROUTES_ID = "routes";
|
|
47
|
+
declare const ROUTES_CAPABILITY = "routes.read";
|
|
48
|
+
//#endregion
|
|
49
|
+
export { RouteUrl as a, RouteSegment as i, ROUTES_ID as n, RoutesResponse as o, RouteEntry as r, ROUTES_CAPABILITY as t };
|