@hansenexus/hud 0.4.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 +603 -9
- package/dist/a11y-B5DUaiCs.js +246 -0
- package/dist/a11y-panel-p_t4eD7p.js +207 -0
- package/dist/{capabilities-CjulXFQX.js → access-C7zlaqj6.js} +1 -90
- package/dist/{access-CNvJOwKM.d.ts → access-D_ewAEJG.d.ts} +11 -4
- 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-vEjyJfPW.d.ts → env-CApnbI0r.d.ts} +2 -0
- package/dist/{env-DfxpPfs9.js → env-CaiFPIhF.js} +3 -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-panel-_otVYh9i.js +97 -0
- package/dist/generate-C8lQl3Eh.js +53 -0
- package/dist/handler-BpVhxEmU.js +106 -0
- package/dist/{handler-WmE4Lu7l.d.ts → handler-DtYVCZY6.d.ts} +1 -1
- 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-BYsdS-7d.d.ts → index-gCZBO53s.d.ts} +21 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +710 -69
- package/dist/inspect-C9Ft8fqn.js +142 -0
- package/dist/inspect-root-BkaupBMp.js +429 -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 -4
- package/dist/next.js +5 -3
- 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-CLKDVZWl.d.ts → payload-MUQ9ciER.d.ts} +25 -1
- package/dist/plugins/a11y.d.ts +2 -0
- package/dist/plugins/a11y.js +2 -0
- package/dist/plugins/access/server.d.ts +5 -5
- package/dist/plugins/access/server.js +4 -3
- package/dist/plugins/access.d.ts +5 -5
- package/dist/plugins/access.js +16 -215
- package/dist/plugins/agent/server.d.ts +3 -38
- package/dist/plugins/agent/server.js +47 -21
- package/dist/plugins/agent.d.ts +4 -4
- package/dist/plugins/agent.js +6 -348
- 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 +4 -124
- package/dist/plugins/design.js +4 -619
- 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 -64
- package/dist/plugins/observe.js +1 -616
- package/dist/plugins/ops/server.d.ts +1 -1
- package/dist/plugins/ops/server.js +2 -1
- package/dist/plugins/ops.d.ts +2 -1
- package/dist/plugins/ops.js +15 -336
- 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 +3 -2
- package/dist/{plugins-CQ_0w1ot.d.ts → plugins-BZvDqGx5.d.ts} +33 -3
- 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.js +2 -2
- package/dist/same-origin-BGet22CC.js +21 -0
- package/dist/scan-DzJNXqOk.js +165 -0
- package/dist/seo-Dq9q_QkO.js +551 -0
- package/dist/seo-panel-CfiY-TnT.js +124 -0
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -105
- package/dist/sessions-panel-COvhPAzv.js +98 -0
- package/dist/{shortcut-U6ftVY06.js → shortcut-s_mjGeU8.js} +1 -44
- package/dist/{types-QJUajwWq.js → state-CjjZPjPJ.js} +13 -8
- package/dist/store/convex.d.ts +33 -0
- package/dist/store/convex.js +52 -0
- package/dist/{vitals-panel-Dvc5dnR-.js → store-CQqIIKTc.js} +1 -29
- package/dist/store-Ync9eb1G.js +67 -0
- package/dist/store.d.ts +76 -0
- package/dist/store.js +188 -0
- package/dist/{styles--slk86ZQ.js → styles-BA8ueHoV.js} +13 -3
- 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-DADBRiGk.d.ts → types-Cxh4twqc.d.ts} +1 -1
- 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-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 +65 -5
- package/dist/define-hud-BBzsSl8b.d.ts +0 -36
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { o as HudPlugin } from "./plugins-BZvDqGx5.js";
|
|
2
|
+
import { r as HudHandlerOptions, t as HudGuard } from "./handler-DtYVCZY6.js";
|
|
3
|
+
import { Plugin } from "vite";
|
|
4
|
+
//#region src/vite/index.d.ts
|
|
5
|
+
export interface HudViteOptions extends HudHandlerOptions {
|
|
6
|
+
/** The plugins' server halves (`@hansenexus/hud/plugins/<id>/server`). Default: none. */
|
|
7
|
+
plugins?: readonly HudPlugin[];
|
|
8
|
+
/**
|
|
9
|
+
* The package.json detection reads for `@hansenexus/hud/auto`. Default:
|
|
10
|
+
* `package.json` in Vite's root.
|
|
11
|
+
*/
|
|
12
|
+
packageJson?: string;
|
|
13
|
+
}
|
|
14
|
+
/** What the app imports; the plugin resolves it to the generated module. */
|
|
15
|
+
export declare const AUTO_ID = "@hansenexus/hud/auto";
|
|
16
|
+
/** The source of `@hansenexus/hud/auto` for the package.json at `path`; a missing file detects nothing. */
|
|
17
|
+
export declare function loadAutoModule(path: string): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Two jobs. In `vite dev` the plugin routes: `createHudHandler` runs as
|
|
20
|
+
* middleware under `basePath` (default `/api/hud`), ahead of Vite's own
|
|
21
|
+
* middlewares, so `/api/hud/<plugin>/<path>` never falls through to
|
|
22
|
+
* `index.html`; `vite build` and `vite preview` never see it, and the client
|
|
23
|
+
* build gate stays the consumer's `import.meta.env.DEV` literal around the
|
|
24
|
+
* `import()`.
|
|
25
|
+
*
|
|
26
|
+
* In dev and build alike, `@hansenexus/hud/auto`: the plugin reads the app's
|
|
27
|
+
* package.json and serves a module that imports only the plugins the
|
|
28
|
+
* dependencies call for (`enforce: "pre"`, so Vite's resolver never reaches
|
|
29
|
+
* the package's stand-in). The file is watched; editing package.json
|
|
30
|
+
* regenerates the module.
|
|
31
|
+
*
|
|
32
|
+
* `guard` and `can` work as in `createHudHandler`. The default guard answers
|
|
33
|
+
* 404 unless `NODE_ENV` is `development`, which Vite sets for `vite dev`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hud(options?: HudViteOptions): Plugin;
|
|
36
|
+
//#endregion
|
|
37
|
+
export type { HudGuard, HudHandlerOptions };
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { t as createHudHandler } from "./handler-BpVhxEmU.js";
|
|
2
|
+
import { n as detectHudAuto, r as parsePackageJson } from "./detect-CHZiSeZs.js";
|
|
3
|
+
import { t as generateAutoModule } from "./generate-C8lQl3Eh.js";
|
|
4
|
+
//#region src/vite/bridge.ts
|
|
5
|
+
const BODYLESS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
6
|
+
/** Absolute URL of a Node request; the host header supplies the origin. */
|
|
7
|
+
function requestUrl(req) {
|
|
8
|
+
const host = req.headers.host;
|
|
9
|
+
const origin = `${req.socket?.encrypted ? "https" : "http"}://${typeof host === "string" && host ? host : "localhost"}`;
|
|
10
|
+
return new URL(req.url ?? "/", origin);
|
|
11
|
+
}
|
|
12
|
+
function concat(chunks) {
|
|
13
|
+
const out = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.byteLength, 0));
|
|
14
|
+
let offset = 0;
|
|
15
|
+
for (const chunk of chunks) {
|
|
16
|
+
out.set(chunk, offset);
|
|
17
|
+
offset += chunk.byteLength;
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
/** A Fetch `Request` with the Node request's method, headers and (buffered) body. */
|
|
22
|
+
async function toRequest(req, url = requestUrl(req)) {
|
|
23
|
+
const method = req.method ?? "GET";
|
|
24
|
+
const headers = new Headers();
|
|
25
|
+
for (const [name, value] of Object.entries(req.headers)) {
|
|
26
|
+
if (value === void 0) continue;
|
|
27
|
+
if (Array.isArray(value)) for (const entry of value) headers.append(name, entry);
|
|
28
|
+
else headers.set(name, value);
|
|
29
|
+
}
|
|
30
|
+
let body;
|
|
31
|
+
if (!BODYLESS.has(method)) {
|
|
32
|
+
const chunks = [];
|
|
33
|
+
for await (const chunk of req) chunks.push(chunk);
|
|
34
|
+
body = concat(chunks);
|
|
35
|
+
}
|
|
36
|
+
return new Request(url, {
|
|
37
|
+
method,
|
|
38
|
+
headers,
|
|
39
|
+
body: body ?? null
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Streams a Fetch `Response` into the Node response; every `Set-Cookie` survives. */
|
|
43
|
+
async function writeResponse(response, res) {
|
|
44
|
+
res.statusCode = response.status;
|
|
45
|
+
for (const [name, value] of response.headers) if (name !== "set-cookie") res.setHeader(name, value);
|
|
46
|
+
const cookies = response.headers.getSetCookie();
|
|
47
|
+
if (cookies.length > 0) res.setHeader("set-cookie", cookies);
|
|
48
|
+
if (!response.body) {
|
|
49
|
+
res.end();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const reader = response.body.getReader();
|
|
53
|
+
res.on("close", () => {
|
|
54
|
+
reader.cancel().catch(() => {});
|
|
55
|
+
});
|
|
56
|
+
for (;;) {
|
|
57
|
+
const { done, value } = await reader.read();
|
|
58
|
+
if (done) break;
|
|
59
|
+
res.write(value);
|
|
60
|
+
}
|
|
61
|
+
res.end();
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/vite/index.ts
|
|
65
|
+
/** What the app imports; the plugin resolves it to the generated module. */
|
|
66
|
+
const AUTO_ID = "@hansenexus/hud/auto";
|
|
67
|
+
const RESOLVED_AUTO_ID = "\0hansenexus-hud:auto";
|
|
68
|
+
function normalizeBase(basePath) {
|
|
69
|
+
return `/${basePath.split("/").filter(Boolean).join("/")}`;
|
|
70
|
+
}
|
|
71
|
+
/** The source of `@hansenexus/hud/auto` for the package.json at `path`; a missing file detects nothing. */
|
|
72
|
+
async function loadAutoModule(path) {
|
|
73
|
+
const { readFile } = await import("node:fs/promises");
|
|
74
|
+
let text = "{}";
|
|
75
|
+
try {
|
|
76
|
+
text = await readFile(path, "utf8");
|
|
77
|
+
} catch {
|
|
78
|
+
console.warn(`hud: ${path} not found; @hansenexus/hud/auto enables the base plugins only`);
|
|
79
|
+
}
|
|
80
|
+
return generateAutoModule(detectHudAuto(parsePackageJson(text)), path);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Two jobs. In `vite dev` the plugin routes: `createHudHandler` runs as
|
|
84
|
+
* middleware under `basePath` (default `/api/hud`), ahead of Vite's own
|
|
85
|
+
* middlewares, so `/api/hud/<plugin>/<path>` never falls through to
|
|
86
|
+
* `index.html`; `vite build` and `vite preview` never see it, and the client
|
|
87
|
+
* build gate stays the consumer's `import.meta.env.DEV` literal around the
|
|
88
|
+
* `import()`.
|
|
89
|
+
*
|
|
90
|
+
* In dev and build alike, `@hansenexus/hud/auto`: the plugin reads the app's
|
|
91
|
+
* package.json and serves a module that imports only the plugins the
|
|
92
|
+
* dependencies call for (`enforce: "pre"`, so Vite's resolver never reaches
|
|
93
|
+
* the package's stand-in). The file is watched; editing package.json
|
|
94
|
+
* regenerates the module.
|
|
95
|
+
*
|
|
96
|
+
* `guard` and `can` work as in `createHudHandler`. The default guard answers
|
|
97
|
+
* 404 unless `NODE_ENV` is `development`, which Vite sets for `vite dev`.
|
|
98
|
+
*/
|
|
99
|
+
function hud(options = {}) {
|
|
100
|
+
const { plugins = [], packageJson, ...handlerOptions } = options;
|
|
101
|
+
const basePath = normalizeBase(handlerOptions.basePath ?? "/api/hud");
|
|
102
|
+
const handler = createHudHandler(plugins, {
|
|
103
|
+
...handlerOptions,
|
|
104
|
+
basePath
|
|
105
|
+
});
|
|
106
|
+
let manifest = packageJson ?? "package.json";
|
|
107
|
+
return {
|
|
108
|
+
name: "hansenexus-hud",
|
|
109
|
+
enforce: "pre",
|
|
110
|
+
configResolved(config) {
|
|
111
|
+
manifest = packageJson ?? `${config.root}/package.json`;
|
|
112
|
+
},
|
|
113
|
+
resolveId(id) {
|
|
114
|
+
return id === "@hansenexus/hud/auto" ? RESOLVED_AUTO_ID : null;
|
|
115
|
+
},
|
|
116
|
+
async load(id) {
|
|
117
|
+
if (id !== RESOLVED_AUTO_ID) return null;
|
|
118
|
+
this.addWatchFile(manifest);
|
|
119
|
+
return loadAutoModule(manifest);
|
|
120
|
+
},
|
|
121
|
+
configureServer(server) {
|
|
122
|
+
server.middlewares.use((req, res, next) => {
|
|
123
|
+
const url = requestUrl(req);
|
|
124
|
+
if (url.pathname !== basePath && !url.pathname.startsWith(`${basePath}/`)) {
|
|
125
|
+
next();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
toRequest(req, url).then((request) => handler.handle(request)).then((response) => writeResponse(response, res)).catch(next);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { AUTO_ID, hud, loadAutoModule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hansenexus/hud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Modular dev HUD for React apps: status pill, floating panels, element grabber, plugin API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"workspaces": [
|
|
12
12
|
".",
|
|
13
13
|
"playground",
|
|
14
|
-
"fixtures/next-app"
|
|
14
|
+
"fixtures/next-app",
|
|
15
|
+
"fixtures/vite-app"
|
|
15
16
|
],
|
|
16
17
|
"files": [
|
|
17
18
|
"dist",
|
|
@@ -31,6 +32,22 @@
|
|
|
31
32
|
"types": "./dist/next.d.ts",
|
|
32
33
|
"import": "./dist/next.js"
|
|
33
34
|
},
|
|
35
|
+
"./next/config": {
|
|
36
|
+
"types": "./dist/next/config.d.ts",
|
|
37
|
+
"import": "./dist/next/config.js"
|
|
38
|
+
},
|
|
39
|
+
"./vite": {
|
|
40
|
+
"types": "./dist/vite.d.ts",
|
|
41
|
+
"import": "./dist/vite.js"
|
|
42
|
+
},
|
|
43
|
+
"./auto": {
|
|
44
|
+
"types": "./dist/auto.d.ts",
|
|
45
|
+
"import": "./dist/auto.js"
|
|
46
|
+
},
|
|
47
|
+
"./auto/runtime": {
|
|
48
|
+
"types": "./dist/auto/runtime.d.ts",
|
|
49
|
+
"import": "./dist/auto/runtime.js"
|
|
50
|
+
},
|
|
34
51
|
"./plugins/*": {
|
|
35
52
|
"types": "./dist/plugins/*.d.ts",
|
|
36
53
|
"import": "./dist/plugins/*.js"
|
|
@@ -39,6 +56,22 @@
|
|
|
39
56
|
"types": "./dist/state-boundary.d.ts",
|
|
40
57
|
"import": "./dist/state-boundary.js"
|
|
41
58
|
},
|
|
59
|
+
"./variants": {
|
|
60
|
+
"types": "./dist/variants.d.ts",
|
|
61
|
+
"import": "./dist/variants.js"
|
|
62
|
+
},
|
|
63
|
+
"./flags": {
|
|
64
|
+
"types": "./dist/flags.d.ts",
|
|
65
|
+
"import": "./dist/flags.js"
|
|
66
|
+
},
|
|
67
|
+
"./store": {
|
|
68
|
+
"types": "./dist/store.d.ts",
|
|
69
|
+
"import": "./dist/store.js"
|
|
70
|
+
},
|
|
71
|
+
"./store/convex": {
|
|
72
|
+
"types": "./dist/store/convex.d.ts",
|
|
73
|
+
"import": "./dist/store/convex.js"
|
|
74
|
+
},
|
|
42
75
|
"./review": {
|
|
43
76
|
"types": "./dist/review.d.ts",
|
|
44
77
|
"import": "./dist/review.js"
|
|
@@ -48,6 +81,9 @@
|
|
|
48
81
|
"import": "./dist/markers.js"
|
|
49
82
|
}
|
|
50
83
|
},
|
|
84
|
+
"bin": {
|
|
85
|
+
"hud": "./dist/cli.js"
|
|
86
|
+
},
|
|
51
87
|
"sideEffects": false,
|
|
52
88
|
"scripts": {
|
|
53
89
|
"dev": "bun run --cwd playground dev",
|
|
@@ -57,10 +93,12 @@
|
|
|
57
93
|
"format": "biome check --write .",
|
|
58
94
|
"test": "vitest run",
|
|
59
95
|
"test:watch": "vitest",
|
|
60
|
-
"
|
|
96
|
+
"test:e2e": "playwright test",
|
|
97
|
+
"check": "bun run lint && bun run typecheck && bun run test && bun run build && bun run check:pack && bun run check:size",
|
|
61
98
|
"changeset": "changeset",
|
|
62
99
|
"version-packages": "changeset version",
|
|
63
|
-
"check:pack": "bun scripts/check-pack.ts"
|
|
100
|
+
"check:pack": "bun scripts/check-pack.ts",
|
|
101
|
+
"check:size": "bun scripts/check-size.ts"
|
|
64
102
|
},
|
|
65
103
|
"dependencies": {
|
|
66
104
|
"web-vitals": "^6.2.3"
|
|
@@ -68,25 +106,47 @@
|
|
|
68
106
|
"peerDependencies": {
|
|
69
107
|
"react": "^19.0.0",
|
|
70
108
|
"react-dom": "^19.0.0",
|
|
71
|
-
"convex": "^1.43.0"
|
|
109
|
+
"convex": "^1.43.0",
|
|
110
|
+
"playwright": ">=1.40.0",
|
|
111
|
+
"@playwright/test": ">=1.40.0",
|
|
112
|
+
"vite": ">=6.0.0",
|
|
113
|
+
"msw": ">=3.0.0"
|
|
72
114
|
},
|
|
73
115
|
"peerDependenciesMeta": {
|
|
74
116
|
"convex": {
|
|
75
117
|
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"playwright": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"@playwright/test": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"vite": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"msw": {
|
|
129
|
+
"optional": true
|
|
76
130
|
}
|
|
77
131
|
},
|
|
78
132
|
"devDependencies": {
|
|
79
133
|
"@biomejs/biome": "^2.5.15",
|
|
80
134
|
"@changesets/changelog-github": "^1.0.1",
|
|
81
135
|
"@changesets/cli": "^3.0.3",
|
|
136
|
+
"@playwright/test": "1.63.0",
|
|
137
|
+
"@tanstack/react-query": "^5.104.1",
|
|
82
138
|
"@testing-library/react": "^16.3.3",
|
|
83
139
|
"@types/react": "^19.3.0",
|
|
84
140
|
"@types/react-dom": "^19.3.0",
|
|
85
141
|
"convex": "^1.46.0",
|
|
86
142
|
"jsdom": "^30.1.2",
|
|
143
|
+
"msw": "^3.0.2",
|
|
144
|
+
"playwright": "1.63.0",
|
|
87
145
|
"rolldown": "^1.2.12",
|
|
146
|
+
"swr": "^2.5.1",
|
|
88
147
|
"tsdown": "^0.23.0",
|
|
89
148
|
"typescript": "^7.0.2",
|
|
149
|
+
"vite": "^8.3.3",
|
|
90
150
|
"vitest": "^5.0.3"
|
|
91
151
|
},
|
|
92
152
|
"publishConfig": {
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { o as HudPlugin, r as HudCapability } from "./plugins-CQ_0w1ot.js";
|
|
2
|
-
import { ComponentType } from "react";
|
|
3
|
-
//#region src/core/define-hud.d.ts
|
|
4
|
-
interface DefineHudOptions {
|
|
5
|
-
/** App slug: labels the pill and keys the persisted layout. */
|
|
6
|
-
app: string;
|
|
7
|
-
/** Client halves (`@hansenexus/hud/plugins/<id>`), in pill order. */
|
|
8
|
-
plugins: readonly HudPlugin[];
|
|
9
|
-
/** Base path of the catch-all route serving `createHudHandler`. Default "/api/hud". */
|
|
10
|
-
apiBase?: string;
|
|
11
|
-
/** Capability check. Default: grant all (core assumes development). */
|
|
12
|
-
can?: (capability: HudCapability) => boolean;
|
|
13
|
-
}
|
|
14
|
-
/** Props the loader passes in at mount time. */
|
|
15
|
-
interface HudMountProps {
|
|
16
|
-
/** Badge at the start of the pill. Default "DEV". */
|
|
17
|
-
envLabel?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Tier the loader resolved. Default "development". Any other tier renders
|
|
20
|
-
* nothing unless a plugin brings `access`.
|
|
21
|
-
*/
|
|
22
|
-
env?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The app's one HUD file:
|
|
26
|
-
*
|
|
27
|
-
* ```tsx
|
|
28
|
-
* export default defineHud({ app: "hansenexus", plugins: [vitals()] });
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* Returns a component. The plugin list is frozen here, so the shell sees a
|
|
32
|
-
* stable array across renders.
|
|
33
|
-
*/
|
|
34
|
-
declare function defineHud({ app, plugins, apiBase, can }: DefineHudOptions): ComponentType<HudMountProps>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { HudMountProps as n, defineHud as r, DefineHudOptions as t };
|