devframe 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_shared-BPmX9fqK.d.mts → _shared-BAGBgTUO.d.mts} +1 -1
- package/dist/{_shared-CbZ_yhbz.mjs → _shared-BM3PdYli.mjs} +1 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +12 -9
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +4 -3
- package/dist/adapters/dev.d.mts +3 -3
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/embedded.mjs +2 -0
- package/dist/adapters/initiate.d.mts +2 -2
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/cli/main.mjs +2 -2
- package/dist/client/index.d.mts +48 -2
- package/dist/client/index.mjs +133 -23
- package/dist/constants.d.mts +74 -2
- package/dist/constants.mjs +9 -2
- package/dist/{context-xdynGSLP.mjs → context-af2w_F0_.mjs} +2 -2
- package/dist/{context-B3YUu_95.d.mts → context-al99DDJ8.d.mts} +1 -1
- package/dist/{context-CEe4PBz1.mjs → context-riPPHGiu.mjs} +339 -26
- package/dist/{dev--rAPzbvO.mjs → dev-BKm_HisC.mjs} +15 -11
- package/dist/{devframe-DJMg0WLe.d.mts → devframe-mbfgpQQC.d.mts} +774 -587
- package/dist/{diagnostics-DOQPnQmX.mjs → diagnostics-DI1HGj2I.mjs} +20 -0
- package/dist/{dist-eNI9qM_I.mjs → dist-CZXfGEkd.mjs} +1 -1
- package/dist/events-DKfSmoTj.mjs +65 -0
- package/dist/hash-DdPnc4k3.mjs +360 -0
- package/dist/{host-agent-xLCSe65D.mjs → host-agent-DVDLqjvj.mjs} +14 -13
- package/dist/{http-DYpK0cUi.mjs → http-POepPnaQ.mjs} +10 -6
- package/dist/{index-CB-fSUyn.d.mts → index-Dipgo9ji.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/{instance-registry-WvQkt42E.mjs → instance-registry-Dy28drtm.mjs} +4 -4
- package/dist/{instance-shell-CMFyszWJ.mjs → instance-shell-GqTY93gC.mjs} +5 -5
- package/dist/{instance-shell-CljiKq1c.d.mts → instance-shell-mU5j5xWn.d.mts} +2 -2
- package/dist/internal/index.d.mts +40 -4
- package/dist/internal/index.mjs +7 -7
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +10 -1
- package/dist/node/index.mjs +2 -2
- package/dist/recipes/common-rpc-functions.d.mts +11 -1
- package/dist/recipes/common-rpc-functions.mjs +10 -0
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +2 -2
- package/dist/{remote-assets-nTTxY2MU.mjs → remote-assets-CqxiyltC.mjs} +18 -7
- package/dist/{revoke-DZbJ7Cl0.mjs → revoke-3Q6aDKWk.mjs} +2 -1
- package/dist/{rolldown-runtime-JspESFgx.mjs → rolldown-runtime-B4iAMlE-.mjs} +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.mjs +1 -1
- package/dist/rpc/transports/ws-bun.d.mts +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +26 -0
- package/dist/rpc/transports/ws-deno.mjs +30 -0
- package/dist/{rpc-core-DMTe-hLo.mjs → rpc-core-DRYnbxdD.mjs} +2 -2
- package/dist/{rpc-core-Cc4lucI0.d.mts → rpc-core-dV69u4lY.d.mts} +2 -2
- package/dist/{shared-state-fRRbRUtD.mjs → shared-state-DoXutg_U.mjs} +1 -1
- package/dist/{state-Cc1IeSmQ.mjs → state-CK9LjrnT.mjs} +1 -1
- package/dist/{static-BPZ1_OPA.mjs → static-DV_qUSRS.mjs} +1 -1
- package/dist/{storage-CYye7P7L.mjs → storage-BNqSAOxA.mjs} +3 -3
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/get-port.mjs +1 -1
- package/dist/utils/hash.mjs +1 -1
- package/dist/utils/launch-editor.mjs +12 -11
- package/dist/utils/open.mjs +1 -1
- package/dist/utils/remote-assets.d.mts +7 -1
- package/dist/utils/remote-assets.mjs +1 -1
- package/dist/utils/serve-static.mjs +6 -5
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/validation-YrZH6atx.mjs +311 -0
- package/package.json +4 -3
- package/skills/devframe/SKILL.md +1 -1
- package/dist/hash-KtDZYXDN.mjs +0 -266
- package/dist/validation-CpXFB6Dz.mjs +0 -266
- package/dist/{host-h3-Crkzm42q.mjs → host-h3-fRbF9yor.mjs} +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { DEVFRAME_CONNECTION_META_FILENAME } from "./constants.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
3
|
-
import { t as createHostContext } from "./context-
|
|
4
|
-
import { t as resolveStaticAssetsSource } from "./remote-assets-
|
|
5
|
-
import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-
|
|
6
|
-
import { t as createH3DevframeHost } from "./host-h3-
|
|
7
|
-
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-DI1HGj2I.mjs";
|
|
3
|
+
import { t as createHostContext } from "./context-riPPHGiu.mjs";
|
|
4
|
+
import { t as resolveStaticAssetsSource } from "./remote-assets-CqxiyltC.mjs";
|
|
5
|
+
import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-BM3PdYli.mjs";
|
|
6
|
+
import { t as createH3DevframeHost } from "./host-h3-fRbF9yor.mjs";
|
|
7
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-GqTY93gC.mjs";
|
|
8
8
|
import { open } from "./utils/open.mjs";
|
|
9
9
|
import { mountStaticHandler } from "./utils/serve-static.mjs";
|
|
10
10
|
import { createServer } from "node:http";
|
|
11
|
-
import { resolve } from "pathe";
|
|
12
11
|
import process from "node:process";
|
|
12
|
+
import { resolve } from "pathe";
|
|
13
13
|
import { joinURL, withBase } from "ufo";
|
|
14
14
|
import { H3, toNodeHandler } from "h3";
|
|
15
15
|
//#region src/adapters/initiate.ts
|
|
@@ -39,10 +39,11 @@ function initDevframe(def, options) {
|
|
|
39
39
|
const base = normalizeBasePath(options.base);
|
|
40
40
|
const distDir = options.distDir === false ? void 0 : options.distDir ?? def.cli?.distDir;
|
|
41
41
|
const app = options.app ?? new H3();
|
|
42
|
+
const host = options.host ?? def.cli?.host ?? "localhost";
|
|
42
43
|
const shell = createInstanceShell({
|
|
43
44
|
base,
|
|
44
45
|
app,
|
|
45
|
-
host
|
|
46
|
+
host,
|
|
46
47
|
origin: options.origin,
|
|
47
48
|
auth: options.auth !== void 0 ? options.auth : def.cli?.auth,
|
|
48
49
|
server: options.server,
|
|
@@ -75,9 +76,12 @@ function initDevframe(def, options) {
|
|
|
75
76
|
const context = await createHostContext({
|
|
76
77
|
cwd: process.cwd(),
|
|
77
78
|
mode: "dev",
|
|
78
|
-
host: hostImpl
|
|
79
|
+
host: hostImpl,
|
|
80
|
+
importMetaUrl: def.importMetaUrl
|
|
79
81
|
});
|
|
80
82
|
const setupInfo = { flags: options.flags ?? {} };
|
|
83
|
+
for (const input of def.services ?? []) context.services.install(input, { resolveFrom: def.importMetaUrl });
|
|
84
|
+
await context.services.ready();
|
|
81
85
|
await def.setup(context, setupInfo);
|
|
82
86
|
const mcpOption = options.mcp ?? def.cli?.mcp;
|
|
83
87
|
const mcpMeta = resolveMcpConnectionMeta(def, mcpOption);
|
|
@@ -87,7 +91,7 @@ function initDevframe(def, options) {
|
|
|
87
91
|
const mcpPath = joinURL(base, mcpMeta.path);
|
|
88
92
|
let mountMcpHttp;
|
|
89
93
|
try {
|
|
90
|
-
({mountMcpHttp} = await import("./http-
|
|
94
|
+
({mountMcpHttp} = await import("./http-POepPnaQ.mjs").then((n) => n.t));
|
|
91
95
|
} catch (error) {
|
|
92
96
|
const reason = error instanceof Error ? error.message : String(error);
|
|
93
97
|
throw diagnostics.DF0017({
|
|
@@ -112,7 +116,7 @@ function initDevframe(def, options) {
|
|
|
112
116
|
mount(context, meta) {
|
|
113
117
|
app.use(joinURL(base, DEVFRAME_CONNECTION_META_FILENAME), () => meta);
|
|
114
118
|
if (distDir) {
|
|
115
|
-
const source = resolveStaticAssetsSource(distDir, context.host.getStorageDir("project"));
|
|
119
|
+
const source = resolveStaticAssetsSource(distDir, context.host.getStorageDir("project"), def.importMetaUrl);
|
|
116
120
|
mountStaticHandler(app, base, typeof source === "string" ? resolve(source) : source);
|
|
117
121
|
}
|
|
118
122
|
}
|