@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,109 @@
|
|
|
1
|
+
//#region src/plugins/data/mocks.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Mock scenarios, the msw-free half: how a scenario is declared, how the
|
|
4
|
+
* active set is stored, and how a request is matched against the active
|
|
5
|
+
* scenarios to produce a mocked answer. The same resolver runs in the
|
|
6
|
+
* browser (behind an MSW worker, `msw-browser`) and in Node (behind an MSW
|
|
7
|
+
* server started from `instrumentation.ts`, `msw-node`); only those two
|
|
8
|
+
* entries import `msw`, so the panel, the server half and an app's scenario
|
|
9
|
+
* module never depend on it.
|
|
10
|
+
*/
|
|
11
|
+
type HudMockMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
|
|
12
|
+
interface HudMockContext {
|
|
13
|
+
/** Values of `:name` segments in the matched endpoint path. */
|
|
14
|
+
params: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One alternative answer for one endpoint. Scenarios with the same `endpoint`
|
|
18
|
+
* are exclusive: the panel shows them as `real | empty | error | slow` and at
|
|
19
|
+
* most one is active per endpoint.
|
|
20
|
+
*/
|
|
21
|
+
interface HudMockScenario {
|
|
22
|
+
/** Unique across the app: `orders:empty`. */
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* `METHOD path`: `GET /api/orders`, `GET /api/orders/:id`, `* /api/*`,
|
|
26
|
+
* `POST https://api.example.com/v1/orders`. A relative path matches on
|
|
27
|
+
* every origin; `:name` captures one segment; a trailing `*` matches the rest.
|
|
28
|
+
*/
|
|
29
|
+
endpoint: string;
|
|
30
|
+
/** Shown on the segment: `empty`, `error`, `slow`. */
|
|
31
|
+
label: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Waits this long before answering, or before passing through when nothing else is set: the "slow" scenario. */
|
|
34
|
+
delay?: number;
|
|
35
|
+
/** HTTP status of the mocked answer. Default 200 when `json` is set; alone it answers an empty body. */
|
|
36
|
+
status?: number;
|
|
37
|
+
/** JSON body of the mocked answer. */
|
|
38
|
+
json?: unknown;
|
|
39
|
+
headers?: Record<string, string>;
|
|
40
|
+
/** Full control: return a `Response`, or `undefined` to pass the request through to the real endpoint. */
|
|
41
|
+
respond?: (request: Request, ctx: HudMockContext) => Response | undefined | Promise<Response | undefined>;
|
|
42
|
+
}
|
|
43
|
+
/** What the browser is told about a scenario: the definition without its behaviour. */
|
|
44
|
+
interface HudMockScenarioInfo {
|
|
45
|
+
id: string;
|
|
46
|
+
endpoint: string;
|
|
47
|
+
label: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
}
|
|
50
|
+
/** The active set: endpoint → the id of the scenario answering it. */
|
|
51
|
+
type HudMockActive = Readonly<Record<string, string>>;
|
|
52
|
+
/** Scenario and seed ids: slugs with dots and colons, one line, bounded. */
|
|
53
|
+
declare const MOCK_SCENARIO_ID: RegExp;
|
|
54
|
+
/** The store collection the active set lives in: `.hud/mocks.json` with `file()`. */
|
|
55
|
+
declare const MOCKS_COLLECTION = "mocks";
|
|
56
|
+
/** The one document in that collection: `{ active: { "GET /api/orders": "orders:empty" } }`. */
|
|
57
|
+
declare const MOCKS_DOCUMENT = "active";
|
|
58
|
+
/** Answers a request from the active scenarios, or `undefined` to let it through. */
|
|
59
|
+
type HudMockResolve = (request: Request) => Promise<Response | undefined>;
|
|
60
|
+
interface ParsedEndpoint {
|
|
61
|
+
method: HudMockMethod | "*";
|
|
62
|
+
/** Set when the path was absolute: only that origin matches. */
|
|
63
|
+
origin: string | null;
|
|
64
|
+
segments: string[];
|
|
65
|
+
}
|
|
66
|
+
/** `GET /api/orders/:id` → method, origin and path segments; throws on anything else. */
|
|
67
|
+
declare function parseEndpoint(endpoint: string): ParsedEndpoint;
|
|
68
|
+
/** The params when `endpoint` matches `method` + `url`, else `null`. Query strings are ignored. */
|
|
69
|
+
declare function matchEndpoint(endpoint: ParsedEndpoint, method: string, url: URL): Record<string, string> | null;
|
|
70
|
+
interface ValidatedScenario {
|
|
71
|
+
scenario: HudMockScenario;
|
|
72
|
+
endpoint: ParsedEndpoint;
|
|
73
|
+
}
|
|
74
|
+
/** Parses every endpoint and rejects duplicate or malformed ids; a developer error throws. */
|
|
75
|
+
declare function validateScenarios(scenarios: readonly HudMockScenario[]): Map<string, ValidatedScenario>;
|
|
76
|
+
/**
|
|
77
|
+
* The active set out of the store's document, keeping only entries that
|
|
78
|
+
* name a registered scenario under its own endpoint (a stale file names
|
|
79
|
+
* scenarios that no longer exist).
|
|
80
|
+
*/
|
|
81
|
+
declare function toMockActive(value: unknown, scenarios: ReadonlyMap<string, ValidatedScenario>): HudMockActive;
|
|
82
|
+
/**
|
|
83
|
+
* The resolver both MSW halves run: the first active scenario whose
|
|
84
|
+
* endpoint matches the request answers it. `getActive` is read on every
|
|
85
|
+
* request, so a toggle applies to the next fetch without re-registering
|
|
86
|
+
* handlers.
|
|
87
|
+
*/
|
|
88
|
+
declare function createMockResolver(scenarios: ReadonlyMap<string, ValidatedScenario>, getActive: () => HudMockActive): HudMockResolve;
|
|
89
|
+
/** Where the Node MSW server reports and takes the active set from. */
|
|
90
|
+
interface HudMockNodeStatus {
|
|
91
|
+
/** `live`: `startMockServer()` listens. `off`: nobody started it. `failed`: it tried; `hint` says why. */
|
|
92
|
+
status: "live" | "off" | "failed";
|
|
93
|
+
hint?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The hand-off between `startMockServer()` (run once from
|
|
97
|
+
* `instrumentation.ts`) and `dataServer()` (run per request, possibly from
|
|
98
|
+
* another bundle of the same process): a registry on `globalThis`.
|
|
99
|
+
*/
|
|
100
|
+
interface HudMockRegistry {
|
|
101
|
+
status: HudMockNodeStatus;
|
|
102
|
+
active: () => HudMockActive;
|
|
103
|
+
/** Called after every write, so the next server-side fetch sees the new set. */
|
|
104
|
+
apply: (active: HudMockActive) => void;
|
|
105
|
+
close: () => void;
|
|
106
|
+
}
|
|
107
|
+
declare function readMockRegistry(): HudMockRegistry | undefined;
|
|
108
|
+
//#endregion
|
|
109
|
+
export { validateScenarios as _, HudMockRegistry as a, HudMockScenarioInfo as c, MOCK_SCENARIO_ID as d, createMockResolver as f, toMockActive as g, readMockRegistry as h, HudMockNodeStatus as i, MOCKS_COLLECTION as l, parseEndpoint as m, HudMockContext as n, HudMockResolve as o, matchEndpoint as p, HudMockMethod as r, HudMockScenario as s, HudMockActive as t, MOCKS_DOCUMENT as u };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//#region src/plugins/data/mocks.ts
|
|
2
|
+
const METHODS = [
|
|
3
|
+
"GET",
|
|
4
|
+
"POST",
|
|
5
|
+
"PUT",
|
|
6
|
+
"PATCH",
|
|
7
|
+
"DELETE",
|
|
8
|
+
"HEAD",
|
|
9
|
+
"OPTIONS"
|
|
10
|
+
];
|
|
11
|
+
/** Scenario and seed ids: slugs with dots and colons, one line, bounded. */
|
|
12
|
+
const MOCK_SCENARIO_ID = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,99}$/;
|
|
13
|
+
/** The store collection the active set lives in: `.hud/mocks.json` with `file()`. */
|
|
14
|
+
const MOCKS_COLLECTION = "mocks";
|
|
15
|
+
/** The one document in that collection: `{ active: { "GET /api/orders": "orders:empty" } }`. */
|
|
16
|
+
const MOCKS_DOCUMENT = "active";
|
|
17
|
+
const ENDPOINT = /^(\S+)\s+(\S+)$/;
|
|
18
|
+
function splitPath(pathname) {
|
|
19
|
+
return pathname.split("/").filter(Boolean);
|
|
20
|
+
}
|
|
21
|
+
/** `GET /api/orders/:id` → method, origin and path segments; throws on anything else. */
|
|
22
|
+
function parseEndpoint(endpoint) {
|
|
23
|
+
const match = ENDPOINT.exec(endpoint.trim());
|
|
24
|
+
if (!match) throw new Error(`hud mocks: endpoint "${endpoint}" must be "METHOD /path"`);
|
|
25
|
+
const [, rawMethod = "", rawPath = ""] = match;
|
|
26
|
+
const method = rawMethod.toUpperCase();
|
|
27
|
+
if (method !== "*" && method !== "ALL" && !METHODS.includes(method)) throw new Error(`hud mocks: endpoint "${endpoint}" has an unknown method "${rawMethod}"`);
|
|
28
|
+
let origin = null;
|
|
29
|
+
let pathname = rawPath;
|
|
30
|
+
if (/^https?:\/\//i.test(rawPath)) {
|
|
31
|
+
const url = new URL(rawPath);
|
|
32
|
+
origin = url.origin;
|
|
33
|
+
pathname = url.pathname;
|
|
34
|
+
} else if (!rawPath.startsWith("/")) throw new Error(`hud mocks: endpoint "${endpoint}" path must start with "/" or "http"`);
|
|
35
|
+
return {
|
|
36
|
+
method: method === "ALL" ? "*" : method,
|
|
37
|
+
origin,
|
|
38
|
+
segments: splitPath(pathname)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** The params when `endpoint` matches `method` + `url`, else `null`. Query strings are ignored. */
|
|
42
|
+
function matchEndpoint(endpoint, method, url) {
|
|
43
|
+
if (endpoint.method !== "*" && endpoint.method !== method.toUpperCase()) return null;
|
|
44
|
+
if (endpoint.origin !== null && endpoint.origin !== url.origin) return null;
|
|
45
|
+
const actual = splitPath(url.pathname);
|
|
46
|
+
const params = {};
|
|
47
|
+
for (const [i, pattern] of endpoint.segments.entries()) {
|
|
48
|
+
if (pattern === "*" && i === endpoint.segments.length - 1) return params;
|
|
49
|
+
const segment = actual[i];
|
|
50
|
+
if (segment === void 0) return null;
|
|
51
|
+
if (pattern.startsWith(":")) try {
|
|
52
|
+
params[pattern.slice(1)] = decodeURIComponent(segment);
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
else if (pattern !== "*" && pattern !== segment) return null;
|
|
57
|
+
}
|
|
58
|
+
return actual.length === endpoint.segments.length ? params : null;
|
|
59
|
+
}
|
|
60
|
+
/** Parses every endpoint and rejects duplicate or malformed ids; a developer error throws. */
|
|
61
|
+
function validateScenarios(scenarios) {
|
|
62
|
+
const byId = /* @__PURE__ */ new Map();
|
|
63
|
+
for (const scenario of scenarios) {
|
|
64
|
+
if (!MOCK_SCENARIO_ID.test(scenario.id)) throw new Error(`hud mocks: scenario id "${scenario.id}" must match ${MOCK_SCENARIO_ID}`);
|
|
65
|
+
if (byId.has(scenario.id)) throw new Error(`hud mocks: duplicate scenario id "${scenario.id}"`);
|
|
66
|
+
byId.set(scenario.id, {
|
|
67
|
+
scenario,
|
|
68
|
+
endpoint: parseEndpoint(scenario.endpoint)
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return byId;
|
|
72
|
+
}
|
|
73
|
+
/** What the browser may know: no `respond`, `json` or `headers`. */
|
|
74
|
+
function scenarioInfo({ id, endpoint, label, description }) {
|
|
75
|
+
return description === void 0 ? {
|
|
76
|
+
id,
|
|
77
|
+
endpoint,
|
|
78
|
+
label
|
|
79
|
+
} : {
|
|
80
|
+
id,
|
|
81
|
+
endpoint,
|
|
82
|
+
label,
|
|
83
|
+
description
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function isRecord(value) {
|
|
87
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The active set out of the store's document, keeping only entries that
|
|
91
|
+
* name a registered scenario under its own endpoint (a stale file names
|
|
92
|
+
* scenarios that no longer exist).
|
|
93
|
+
*/
|
|
94
|
+
function toMockActive(value, scenarios) {
|
|
95
|
+
if (!isRecord(value) || !isRecord(value.active)) return {};
|
|
96
|
+
const active = {};
|
|
97
|
+
for (const [endpoint, id] of Object.entries(value.active)) {
|
|
98
|
+
if (typeof id !== "string") continue;
|
|
99
|
+
const known = scenarios.get(id);
|
|
100
|
+
if (known && known.scenario.endpoint === endpoint) active[endpoint] = id;
|
|
101
|
+
}
|
|
102
|
+
return active;
|
|
103
|
+
}
|
|
104
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
105
|
+
/** The scenario's answer for a matched request, or `undefined` to pass it through. */
|
|
106
|
+
async function respondWith(scenario, request, ctx) {
|
|
107
|
+
if (scenario.delay !== void 0 && scenario.delay > 0) await sleep(scenario.delay);
|
|
108
|
+
if (scenario.respond) return scenario.respond(request, ctx);
|
|
109
|
+
const init = {
|
|
110
|
+
status: scenario.status ?? 200,
|
|
111
|
+
headers: scenario.headers ?? {}
|
|
112
|
+
};
|
|
113
|
+
if (scenario.json !== void 0) return Response.json(scenario.json, init);
|
|
114
|
+
if (scenario.status !== void 0) return new Response(null, init);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The resolver both MSW halves run: the first active scenario whose
|
|
118
|
+
* endpoint matches the request answers it. `getActive` is read on every
|
|
119
|
+
* request, so a toggle applies to the next fetch without re-registering
|
|
120
|
+
* handlers.
|
|
121
|
+
*/
|
|
122
|
+
function createMockResolver(scenarios, getActive) {
|
|
123
|
+
return async (request) => {
|
|
124
|
+
const active = getActive();
|
|
125
|
+
if (Object.keys(active).length === 0) return void 0;
|
|
126
|
+
const url = new URL(request.url);
|
|
127
|
+
for (const id of Object.values(active)) {
|
|
128
|
+
const entry = scenarios.get(id);
|
|
129
|
+
if (!entry) continue;
|
|
130
|
+
const params = matchEndpoint(entry.endpoint, request.method, url);
|
|
131
|
+
if (params) return respondWith(entry.scenario, request, { params });
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const REGISTRY_KEY = Symbol.for("hansenexus.hud.mocks");
|
|
136
|
+
function readMockRegistry() {
|
|
137
|
+
return globalThis[REGISTRY_KEY];
|
|
138
|
+
}
|
|
139
|
+
function writeMockRegistry(registry) {
|
|
140
|
+
globalThis[REGISTRY_KEY] = registry;
|
|
141
|
+
}
|
|
142
|
+
/** What `dataServer()` reports about the Node side. */
|
|
143
|
+
function nodeMockStatus() {
|
|
144
|
+
return readMockRegistry()?.status ?? {
|
|
145
|
+
status: "off",
|
|
146
|
+
hint: "Server fetches are not mocked: call startMockServer() from @hansenexus/hud/plugins/data/msw-node in instrumentation.ts."
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
export { matchEndpoint as a, readMockRegistry as c, validateScenarios as d, writeMockRegistry as f, createMockResolver as i, scenarioInfo as l, MOCKS_DOCUMENT as n, nodeMockStatus as o, MOCK_SCENARIO_ID as r, parseEndpoint as s, MOCKS_COLLECTION as t, toMockActive as u };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { o as HudMockResolve } from "./mocks-CA-wM2SB.js";
|
|
2
|
+
//#region src/plugins/data/msw-browser.d.ts
|
|
3
|
+
interface MockWorkerOptions {
|
|
4
|
+
/** URL of the worker script. Default `/mockServiceWorker.js` (`npx msw init public/`). */
|
|
5
|
+
workerUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
interface HudMockWorkerHandle {
|
|
8
|
+
stop: () => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What `data({ mocks: { worker } })` loads: this module, or one of your own
|
|
12
|
+
* when the app already runs an MSW worker (register the HUD's catch-all on
|
|
13
|
+
* it with `worker.use(http.all("*", ({ request }) => resolve(request)))`).
|
|
14
|
+
*/
|
|
15
|
+
interface HudMockWorkerModule {
|
|
16
|
+
startMockWorker: (resolve: HudMockResolve, options?: MockWorkerOptions) => Promise<HudMockWorkerHandle>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Starts an MSW worker whose one handler asks the HUD's resolver, so client
|
|
20
|
+
* fetches follow the active scenarios. The data plugin loads this module on
|
|
21
|
+
* demand through the `worker` loader:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* data({ mocks: { scenarios, worker: () => import("@hansenexus/hud/plugins/data/msw-browser") } })
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Needs `msw` and its worker script in the app's public directory.
|
|
28
|
+
*/
|
|
29
|
+
declare function startMockWorker(resolve: HudMockResolve, { workerUrl }?: MockWorkerOptions): Promise<HudMockWorkerHandle>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { startMockWorker as i, HudMockWorkerModule as n, MockWorkerOptions as r, HudMockWorkerHandle as t };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { t as HudAutoDetected } from "../detect-BxHZ0pxW.js";
|
|
2
|
+
//#region src/next/config.d.ts
|
|
3
|
+
/** What the app imports; the wrapper aliases it to the generated file. */
|
|
4
|
+
export declare const AUTO_ID = "@hansenexus/hud/auto";
|
|
5
|
+
/** Where the generated module lives, relative to the app dir. Add it to .gitignore. */
|
|
6
|
+
export declare const AUTO_FILE = ".hud/auto.mjs";
|
|
7
|
+
export interface WithHudOptions {
|
|
8
|
+
/** The app directory. Default: `process.cwd()`, which is where Next loads next.config from. */
|
|
9
|
+
dir?: string;
|
|
10
|
+
/** The package.json detection reads. Default: `<dir>/package.json`. */
|
|
11
|
+
packageJson?: string;
|
|
12
|
+
}
|
|
13
|
+
interface WebpackConfigLike {
|
|
14
|
+
resolve?: {
|
|
15
|
+
alias?: Record<string, unknown> | unknown[] | undefined;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The slice of `NextConfig` the wrapper touches, structurally, so `next` is
|
|
22
|
+
* neither imported nor a peer. Method syntax keeps Next's own `webpack`
|
|
23
|
+
* signature assignable.
|
|
24
|
+
*/
|
|
25
|
+
export interface NextConfigLike {
|
|
26
|
+
turbopack?: {
|
|
27
|
+
resolveAlias?: Record<string, unknown> | undefined;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
} | undefined;
|
|
30
|
+
webpack?(config: WebpackConfigLike, context: unknown): WebpackConfigLike;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/** Reads, detects and writes `.hud/auto.mjs`; returns the detection and the file's absolute path. */
|
|
34
|
+
export declare function writeAutoModule({ dir, packageJson }?: WithHudOptions): {
|
|
35
|
+
detected: HudAutoDetected;
|
|
36
|
+
file: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Wraps next.config: reads the app's package.json, writes `.hud/auto.mjs`
|
|
40
|
+
* (a module importing only the plugins the dependencies call for) and
|
|
41
|
+
* aliases `@hansenexus/hud/auto` to it, for Turbopack and webpack alike.
|
|
42
|
+
* Runs on every `next dev` and `next build`, so the file follows
|
|
43
|
+
* package.json; it belongs in .gitignore.
|
|
44
|
+
*
|
|
45
|
+
* ```js
|
|
46
|
+
* // next.config.js
|
|
47
|
+
* import { withHud } from "@hansenexus/hud/next/config";
|
|
48
|
+
* export default withHud({ reactStrictMode: true });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function withHud<C extends NextConfigLike>(config?: C, options?: WithHudOptions): C;
|
|
52
|
+
//#endregion
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { n as detectHudAuto, r as parsePackageJson } from "../detect-CHZiSeZs.js";
|
|
2
|
+
import { t as generateAutoModule } from "../generate-C8lQl3Eh.js";
|
|
3
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
//#region src/next/config.ts
|
|
6
|
+
/** What the app imports; the wrapper aliases it to the generated file. */
|
|
7
|
+
const AUTO_ID = "@hansenexus/hud/auto";
|
|
8
|
+
/** Where the generated module lives, relative to the app dir. Add it to .gitignore. */
|
|
9
|
+
const AUTO_FILE = ".hud/auto.mjs";
|
|
10
|
+
/** Reads, detects and writes `.hud/auto.mjs`; returns the detection and the file's absolute path. */
|
|
11
|
+
function writeAutoModule({ dir = process.cwd(), packageJson } = {}) {
|
|
12
|
+
const manifest = packageJson ?? resolve(dir, "package.json");
|
|
13
|
+
let text = "{}";
|
|
14
|
+
try {
|
|
15
|
+
text = readFileSync(manifest, "utf8");
|
|
16
|
+
} catch {
|
|
17
|
+
console.warn(`hud: ${manifest} not found; @hansenexus/hud/auto enables the base plugins only`);
|
|
18
|
+
}
|
|
19
|
+
const detected = detectHudAuto(parsePackageJson(text));
|
|
20
|
+
const file = resolve(dir, AUTO_FILE);
|
|
21
|
+
const source = generateAutoModule(detected, manifest);
|
|
22
|
+
let current;
|
|
23
|
+
try {
|
|
24
|
+
current = readFileSync(file, "utf8");
|
|
25
|
+
} catch {}
|
|
26
|
+
if (current !== source) {
|
|
27
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
28
|
+
writeFileSync(file, source, "utf8");
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
detected,
|
|
32
|
+
file
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Wraps next.config: reads the app's package.json, writes `.hud/auto.mjs`
|
|
37
|
+
* (a module importing only the plugins the dependencies call for) and
|
|
38
|
+
* aliases `@hansenexus/hud/auto` to it, for Turbopack and webpack alike.
|
|
39
|
+
* Runs on every `next dev` and `next build`, so the file follows
|
|
40
|
+
* package.json; it belongs in .gitignore.
|
|
41
|
+
*
|
|
42
|
+
* ```js
|
|
43
|
+
* // next.config.js
|
|
44
|
+
* import { withHud } from "@hansenexus/hud/next/config";
|
|
45
|
+
* export default withHud({ reactStrictMode: true });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
function withHud(config, options = {}) {
|
|
49
|
+
const base = config ?? {};
|
|
50
|
+
const { file } = writeAutoModule(options);
|
|
51
|
+
const webpack = base.webpack;
|
|
52
|
+
return {
|
|
53
|
+
...base,
|
|
54
|
+
turbopack: {
|
|
55
|
+
...base.turbopack,
|
|
56
|
+
resolveAlias: {
|
|
57
|
+
...base.turbopack?.resolveAlias,
|
|
58
|
+
[AUTO_ID]: `./${AUTO_FILE}`
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
webpack(webpackConfig, context) {
|
|
62
|
+
const own = webpack ? webpack.call(base, webpackConfig, context) : webpackConfig;
|
|
63
|
+
const resolveOptions = own.resolve ?? {};
|
|
64
|
+
const alias = resolveOptions.alias;
|
|
65
|
+
resolveOptions.alias = Array.isArray(alias) ? [...alias, {
|
|
66
|
+
name: AUTO_ID,
|
|
67
|
+
alias: file
|
|
68
|
+
}] : {
|
|
69
|
+
...alias,
|
|
70
|
+
[`${AUTO_ID}$`]: file
|
|
71
|
+
};
|
|
72
|
+
own.resolve = resolveOptions;
|
|
73
|
+
return own;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { AUTO_FILE, AUTO_ID, withHud, writeAutoModule };
|
package/dist/next.d.ts
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as HudMountProps } from "./define-hud-CHPedaQ5.js";
|
|
2
|
+
import { n as hudEnvLabel, r as resolveHudEnv, t as HudEnv } from "./env-CApnbI0r.js";
|
|
2
3
|
import { ComponentType } from "react";
|
|
3
|
-
//#region src/next/env.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Where the HUD believes it runs. An explicit `NEXT_PUBLIC_HUD_ENV` wins over
|
|
6
|
-
* heuristics because k3s deploys have no `VERCEL_ENV`.
|
|
7
|
-
*/
|
|
8
|
-
type HudEnv = "development" | "preview" | "staging" | "production" | "disabled";
|
|
9
|
-
/**
|
|
10
|
-
* Env ladder: kill switch → `NODE_ENV` (inlined by Next, so production
|
|
11
|
-
* bundles fold the development branch) → `NEXT_PUBLIC_HUD_ENV` (k8s overlays)
|
|
12
|
-
* → `VERCEL_ENV` → production.
|
|
13
|
-
*
|
|
14
|
-
* Each read is a literal `process.env.X` so Next can inline it in client code.
|
|
15
|
-
*/
|
|
16
|
-
export declare function resolveHudEnv(): HudEnv;
|
|
17
|
-
export declare function hudEnvLabel(env?: HudEnv): string;
|
|
18
|
-
//#endregion
|
|
19
4
|
//#region src/next/loader.d.ts
|
|
20
5
|
type HudModuleLoader = () => Promise<{
|
|
21
6
|
default: ComponentType<HudMountProps>;
|
|
22
7
|
}>;
|
|
8
|
+
interface HudLoaderOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The tier, when the env ladder cannot read it. A Vite client has no
|
|
11
|
+
* `process`, so pass a literal the bundler folds:
|
|
12
|
+
* `import.meta.env.DEV ? "development" : "production"`. Default: `resolveHudEnv()`.
|
|
13
|
+
*/
|
|
14
|
+
env?: HudEnv;
|
|
15
|
+
}
|
|
23
16
|
/**
|
|
24
17
|
* Mounts the app's `defineHud` module, lazily and client side only.
|
|
25
18
|
*
|
|
@@ -42,7 +35,9 @@ type HudModuleLoader = () => Promise<{
|
|
|
42
35
|
* do that: the `import()` would still sit in the consumer's module and the
|
|
43
36
|
* chunk would ship unreachable but readable (hn-monorepo#1283). Pass `null`
|
|
44
37
|
* and the loader renders nothing.
|
|
38
|
+
*
|
|
39
|
+
* Outside Next (Vite), gate on `import.meta.env.DEV` and pass `{ env }`.
|
|
45
40
|
*/
|
|
46
|
-
export declare function createHudLoader(load: HudModuleLoader | null): ComponentType<HudMountProps>;
|
|
41
|
+
export declare function createHudLoader(load: HudModuleLoader | null, options?: HudLoaderOptions): ComponentType<HudMountProps>;
|
|
47
42
|
//#endregion
|
|
48
|
-
export type
|
|
43
|
+
export { type HudEnv, type HudLoaderOptions, type HudModuleLoader, type HudMountProps, hudEnvLabel, resolveHudEnv };
|
package/dist/next.js
CHANGED
|
@@ -1,32 +1,6 @@
|
|
|
1
|
+
import { n as resolveHudEnv, t as hudEnvLabel } from "./env-CaiFPIhF.js";
|
|
1
2
|
import { Suspense, lazy, useEffect, useState } from "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/next/env.ts
|
|
4
|
-
/**
|
|
5
|
-
* Env ladder: kill switch → `NODE_ENV` (inlined by Next, so production
|
|
6
|
-
* bundles fold the development branch) → `NEXT_PUBLIC_HUD_ENV` (k8s overlays)
|
|
7
|
-
* → `VERCEL_ENV` → production.
|
|
8
|
-
*
|
|
9
|
-
* Each read is a literal `process.env.X` so Next can inline it in client code.
|
|
10
|
-
*/
|
|
11
|
-
function resolveHudEnv() {
|
|
12
|
-
if (process.env.NEXT_PUBLIC_HUD_DISABLED === "true") return "disabled";
|
|
13
|
-
if (process.env.NODE_ENV === "development") return "development";
|
|
14
|
-
const explicit = process.env.NEXT_PUBLIC_HUD_ENV;
|
|
15
|
-
if (explicit === "staging" || explicit === "preview" || explicit === "production") return explicit;
|
|
16
|
-
if (process.env.VERCEL_ENV === "preview") return "preview";
|
|
17
|
-
return "production";
|
|
18
|
-
}
|
|
19
|
-
const LABELS = {
|
|
20
|
-
development: "DEV",
|
|
21
|
-
preview: "PREVIEW",
|
|
22
|
-
staging: "STAGING",
|
|
23
|
-
production: "PROD",
|
|
24
|
-
disabled: "OFF"
|
|
25
|
-
};
|
|
26
|
-
function hudEnvLabel(env = resolveHudEnv()) {
|
|
27
|
-
return LABELS[env];
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
4
|
//#region src/next/loader.tsx
|
|
31
5
|
/**
|
|
32
6
|
* Mounts the app's `defineHud` module, lazily and client side only.
|
|
@@ -50,21 +24,24 @@ function hudEnvLabel(env = resolveHudEnv()) {
|
|
|
50
24
|
* do that: the `import()` would still sit in the consumer's module and the
|
|
51
25
|
* chunk would ship unreachable but readable (hn-monorepo#1283). Pass `null`
|
|
52
26
|
* and the loader renders nothing.
|
|
27
|
+
*
|
|
28
|
+
* Outside Next (Vite), gate on `import.meta.env.DEV` and pass `{ env }`.
|
|
53
29
|
*/
|
|
54
|
-
function createHudLoader(load) {
|
|
30
|
+
function createHudLoader(load, options = {}) {
|
|
55
31
|
if (!load) return NoHud;
|
|
56
32
|
const LazyHud = lazy(load);
|
|
57
33
|
function HudLoader(props) {
|
|
58
34
|
const [mounted, setMounted] = useState(false);
|
|
59
35
|
useEffect(() => setMounted(true), []);
|
|
60
36
|
if (!mounted) return null;
|
|
61
|
-
const env = resolveHudEnv();
|
|
37
|
+
const env = options.env ?? resolveHudEnv();
|
|
62
38
|
if (env === "disabled") return null;
|
|
63
39
|
return /* @__PURE__ */ jsx(Suspense, {
|
|
64
40
|
fallback: null,
|
|
65
41
|
children: /* @__PURE__ */ jsx(LazyHud, {
|
|
66
42
|
envLabel: hudEnvLabel(env),
|
|
67
|
-
...props
|
|
43
|
+
...props,
|
|
44
|
+
env
|
|
68
45
|
})
|
|
69
46
|
});
|
|
70
47
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { i as definePlugin } from "./plugins-DVy_vaYr.js";
|
|
2
|
+
import { _ as captureBuffer, v as isError } from "./requests-BwD6MKEq.js";
|
|
3
|
+
import { t as installCapture } from "./capture-CwrIwLqi.js";
|
|
4
|
+
import { r as startVitals } from "./store-CQqIIKTc.js";
|
|
5
|
+
import { lazy, useEffect, useSyncExternalStore } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/plugins/observe/view.ts
|
|
8
|
+
const FILTERS = [
|
|
9
|
+
"all",
|
|
10
|
+
"errors",
|
|
11
|
+
"warn",
|
|
12
|
+
"log",
|
|
13
|
+
"fetch",
|
|
14
|
+
"xhr",
|
|
15
|
+
"longtask"
|
|
16
|
+
];
|
|
17
|
+
function matches(entry, filter) {
|
|
18
|
+
if (filter === "all") return true;
|
|
19
|
+
if (filter === "errors") return isError(entry);
|
|
20
|
+
return entry.kind === filter;
|
|
21
|
+
}
|
|
22
|
+
let view = {
|
|
23
|
+
tab: "console",
|
|
24
|
+
filter: "all"
|
|
25
|
+
};
|
|
26
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
27
|
+
function setView(next) {
|
|
28
|
+
view = {
|
|
29
|
+
...view,
|
|
30
|
+
...next
|
|
31
|
+
};
|
|
32
|
+
for (const listener of listeners) listener();
|
|
33
|
+
}
|
|
34
|
+
function subscribe(listener) {
|
|
35
|
+
listeners.add(listener);
|
|
36
|
+
return () => listeners.delete(listener);
|
|
37
|
+
}
|
|
38
|
+
const getView = () => view;
|
|
39
|
+
function useView() {
|
|
40
|
+
return useSyncExternalStore(subscribe, getView, getView);
|
|
41
|
+
}
|
|
42
|
+
function useCapture() {
|
|
43
|
+
return useSyncExternalStore(captureBuffer.subscribe, captureBuffer.getSnapshot, captureBuffer.getSnapshot);
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/plugins/observe/index.tsx
|
|
47
|
+
const Panel = lazy(() => import("./observe-panel-Cgp1M8oT.js"));
|
|
48
|
+
const NO_ENV = {};
|
|
49
|
+
const noUser = () => void 0;
|
|
50
|
+
function useErrorCount() {
|
|
51
|
+
return useCapture().filter(isError).length;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Console and network capture, an app/build/browser/user snapshot and the
|
|
55
|
+
* page's Web Vitals. The pill counts errors; opening the panel while there are
|
|
56
|
+
* any lands on the console filtered to them.
|
|
57
|
+
*/
|
|
58
|
+
function observe({ env = NO_ENV, useUser = noUser, ignore } = {}) {
|
|
59
|
+
function ObservePill() {
|
|
60
|
+
useEffect(() => installCapture(ignore ? { ignore } : {}), []);
|
|
61
|
+
useEffect(() => startVitals(), []);
|
|
62
|
+
const errors = useErrorCount();
|
|
63
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "dot",
|
|
65
|
+
"data-rating": errors > 0 ? "poor" : "good"
|
|
66
|
+
}), errors === 1 ? "1 error" : `${errors} errors`] });
|
|
67
|
+
}
|
|
68
|
+
function ObservePanel({ ctx }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(Panel, {
|
|
70
|
+
ctx,
|
|
71
|
+
env,
|
|
72
|
+
useUser
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return definePlugin({
|
|
76
|
+
id: "observe",
|
|
77
|
+
title: "Observe",
|
|
78
|
+
pill: ObservePill,
|
|
79
|
+
pillPriority: 20,
|
|
80
|
+
panel: ObservePanel,
|
|
81
|
+
commands: [{
|
|
82
|
+
id: "clear",
|
|
83
|
+
title: "Clear console capture",
|
|
84
|
+
run: () => captureBuffer.clear()
|
|
85
|
+
}]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { useCapture as a, setView as i, FILTERS as n, useView as o, matches as r, observe as t };
|