devframe 0.1.20 → 0.1.22
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 +41 -18
- package/dist/{_shared-S-Ujqz_L.mjs → _shared-DcJX9-Az.mjs} +4 -4
- package/dist/adapters/build.d.mts +7 -7
- package/dist/adapters/build.mjs +15 -14
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +5 -5
- package/dist/adapters/dev.d.mts +18 -9
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +6 -6
- package/dist/adapters/embedded.mjs +3 -3
- package/dist/adapters/mcp.d.mts +3 -3
- package/dist/adapters/mcp.mjs +6 -5
- package/dist/adapters/vite.d.mts +46 -12
- package/dist/adapters/vite.mjs +81 -17
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/client/index.d.mts +19 -144
- package/dist/client/index.mjs +20 -20
- package/dist/colors-Bl4W18Mh.mjs +123 -0
- package/dist/constants.d.mts +12 -15
- package/dist/constants.mjs +12 -29
- package/dist/context-DBd794Rn.d.mts +51 -0
- package/dist/context-DUibxhrR.mjs +1034 -0
- package/dist/{dev-B8i_CBlQ.mjs → dev-BGpTpYiR.mjs} +20 -21
- package/dist/{devtool-Bm6zZAw5.d.mts → devframe-DulcIxwu.d.mts} +59 -569
- package/dist/diagnostics-BFhNNmST.mjs +56 -0
- package/dist/hash-BHZbo80D.mjs +126 -0
- package/dist/{human-id-CHS0s28X.mjs → human-id-adtUWQLr.mjs} +12 -4
- package/dist/{index-BCo03GEF.d.mts → index-DB2Ie0Or.d.mts} +2 -3
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +2 -8
- package/dist/launch-editor-KA_21J1T.mjs +581 -0
- package/dist/node/auth.d.mts +44 -0
- package/dist/node/auth.mjs +55 -0
- package/dist/node/index.d.mts +14 -187
- package/dist/node/index.mjs +6 -61
- package/dist/node/internal.d.mts +16 -0
- package/dist/node/internal.mjs +50 -0
- package/dist/{open-BtOOEldu.mjs → open-DmFp0qZA.mjs} +15 -6
- package/dist/recipes/open-helpers.d.mts +4 -9
- package/dist/recipes/open-helpers.mjs +7 -12
- package/dist/revoke-DIMz1r7-.mjs +35 -0
- package/dist/rpc/index.d.mts +3 -3
- package/dist/rpc/index.mjs +4 -4
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +2 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -1
- package/dist/{rpc-INbWfHoX.mjs → rpc-CkZuoz-m.mjs} +3 -2
- package/dist/{serialization-DwKi05Pn.mjs → serialization-CwO31axa.mjs} +1 -2
- package/dist/{server-qRRM8t3v.mjs → server-ma8-ZVyX.mjs} +1 -1
- package/dist/{server-DksyT-um.d.mts → server-zKEDxgqD.d.mts} +4 -3
- package/dist/shared-state-DCDs0e7y.mjs +928 -0
- package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D7AvjrgL.mjs} +1 -1
- package/dist/storage-CNC38eU-.mjs +117 -0
- package/dist/structured-clone-DcDc2Dds.mjs +221 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +11 -2
- package/dist/utils/colors.d.mts +28 -0
- package/dist/utils/colors.mjs +2 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.d.mts +7 -0
- package/dist/utils/hash.mjs +2 -0
- package/dist/utils/human-id.d.mts +6 -8
- package/dist/utils/human-id.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +13 -0
- package/dist/utils/launch-editor.mjs +2 -0
- package/dist/utils/open.d.mts +16 -0
- package/dist/utils/open.mjs +2 -0
- package/dist/utils/serve-static.d.mts +30 -0
- package/dist/utils/serve-static.mjs +152 -0
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -35
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.d.mts +21 -0
- package/dist/utils/structured-clone.mjs +2 -0
- package/dist/utils/when.d.mts +384 -2
- package/dist/utils/when.mjs +20 -2
- package/dist/{ws-client-DQySVfF_.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
- package/dist/{ws-server-VQqESKAs.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
- package/package.json +23 -13
- package/skills/devframe/SKILL.md +93 -117
- package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +5 -10
- package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +5 -10
- package/skills/devframe/templates/vite-client.ts +2 -2
- package/dist/adapters/kit.d.mts +0 -23
- package/dist/adapters/kit.mjs +0 -16
- package/dist/context-BfvbAyGk.mjs +0 -7215
- package/dist/main-DpINGndA.mjs +0 -601
- package/dist/utils/state.d.mts +0 -50
- package/dist/utils/state.mjs +0 -26
- package/dist/when-aBBXAEh5.d.mts +0 -401
- package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-Dz8YnFgu.mjs} +2 -2
- /package/dist/{transports-BPUzHhI2.mjs → transports-BnCs4rj9.mjs} +0 -0
- /package/dist/{types-ag029cAe.d.mts → types-4rdUEi2R.d.mts} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { t as createHostContext } from "./context-
|
|
1
|
+
import { t as createHostContext } from "./context-DUibxhrR.mjs";
|
|
2
|
+
import { t as createH3DevToolsHost } from "./host-h3-Dz8YnFgu.mjs";
|
|
3
|
+
import { t as startHttpAndWs } from "./server-ma8-ZVyX.mjs";
|
|
2
4
|
import { DEVTOOLS_CONNECTION_META_FILENAME } from "./constants.mjs";
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { resolve } from "pathe";
|
|
7
|
-
import process$1 from "node:process";
|
|
5
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-DcJX9-Az.mjs";
|
|
6
|
+
import { t as open } from "./open-DmFp0qZA.mjs";
|
|
7
|
+
import { serveStaticHandler } from "./utils/serve-static.mjs";
|
|
8
8
|
import { networkInterfaces } from "node:os";
|
|
9
|
-
import
|
|
9
|
+
import process$1 from "node:process";
|
|
10
|
+
import { resolve } from "pathe";
|
|
11
|
+
import { createApp, eventHandler } from "h3";
|
|
10
12
|
import { createServer } from "node:net";
|
|
11
|
-
import sirv from "sirv";
|
|
12
13
|
//#region ../../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
|
|
13
14
|
const unsafePorts = /* @__PURE__ */ new Set([
|
|
14
15
|
1,
|
|
@@ -245,9 +246,15 @@ async function resolveDevServerPort(def, options = {}) {
|
|
|
245
246
|
return getPort(portOptions);
|
|
246
247
|
}
|
|
247
248
|
/**
|
|
248
|
-
* Start a devframe dev server for a {@link
|
|
249
|
-
* h3 + WebSocket RPC + the author's SPA mounted at the
|
|
250
|
-
* path.
|
|
249
|
+
* Start a devframe dev server for a {@link DevframeDefinition} —
|
|
250
|
+
* h3 + WebSocket RPC + (optionally) the author's SPA mounted at the
|
|
251
|
+
* resolved base path.
|
|
252
|
+
*
|
|
253
|
+
* When `distDir` is omitted (and `def.cli?.distDir` is unset) the
|
|
254
|
+
* server runs in **bridge mode**: only `__connection.json` and the WS
|
|
255
|
+
* endpoint are mounted, with no SPA mount. The SPA is expected to be
|
|
256
|
+
* hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
|
|
257
|
+
* `createVitePlugin({ devMiddleware })`.
|
|
251
258
|
*
|
|
252
259
|
* Returns the underlying {@link StartedServer} handle so callers can
|
|
253
260
|
* close it gracefully (SIGINT, hot-reload, test teardown).
|
|
@@ -258,7 +265,6 @@ async function resolveDevServerPort(def, options = {}) {
|
|
|
258
265
|
*/
|
|
259
266
|
async function createDevServer(def, options = {}) {
|
|
260
267
|
const distDir = options.distDir ?? def.cli?.distDir;
|
|
261
|
-
if (!distDir) throw new Error(`[devframe] createDevServer: no distDir for "${def.id}". Set \`cli.distDir\` on the definition or pass it as an option.`);
|
|
262
268
|
const host = options.host ?? def.cli?.host ?? "localhost";
|
|
263
269
|
const port = options.port ?? await resolveDevServerPort(def, { host });
|
|
264
270
|
const flags = options.flags ?? {};
|
|
@@ -268,10 +274,7 @@ async function createDevServer(def, options = {}) {
|
|
|
268
274
|
origin: `http://${host}:${port}`,
|
|
269
275
|
appName: def.id,
|
|
270
276
|
mount: (base, dir) => {
|
|
271
|
-
app.use(base,
|
|
272
|
-
dev: true,
|
|
273
|
-
single: true
|
|
274
|
-
})));
|
|
277
|
+
app.use(base, serveStaticHandler(dir));
|
|
275
278
|
}
|
|
276
279
|
});
|
|
277
280
|
const ctx = await createHostContext({
|
|
@@ -289,10 +292,7 @@ async function createDevServer(def, options = {}) {
|
|
|
289
292
|
websocket: port
|
|
290
293
|
}));
|
|
291
294
|
}));
|
|
292
|
-
app.use(basePath,
|
|
293
|
-
dev: true,
|
|
294
|
-
single: true
|
|
295
|
-
})));
|
|
295
|
+
if (distDir) app.use(basePath, serveStaticHandler(resolve(distDir)));
|
|
296
296
|
return startHttpAndWs({
|
|
297
297
|
context: ctx,
|
|
298
298
|
host,
|
|
@@ -312,7 +312,6 @@ async function maybeOpenBrowser(def, flags, origin, override) {
|
|
|
312
312
|
if (resolved === void 0 || resolved === false) return;
|
|
313
313
|
const target = typeof resolved === "string" ? resolveOpenTarget(origin, resolved) : origin;
|
|
314
314
|
try {
|
|
315
|
-
const { default: open } = await import("./open-BtOOEldu.mjs");
|
|
316
315
|
await open(target);
|
|
317
316
|
} catch {}
|
|
318
317
|
}
|