@devframes/next 0.9.10 → 0.9.12

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/single.d.mts CHANGED
@@ -52,6 +52,15 @@ interface CreateDevframeNextHandlerOptions {
52
52
  * or a handler for a custom scheme.
53
53
  */
54
54
  auth?: InitDevframeOptions['auth'];
55
+ /**
56
+ * Widen the side-car WebSocket origin check beyond devframe's
57
+ * loopback-only default. Reaching a remotely-accessed Next dev server
58
+ * (containers, Codespaces, tunnels) needs the app's own origin allowed.
59
+ * Pass extra origins, a `WsOriginRegistry`, or `false` to disable the
60
+ * check (safe when the auth gate owns the trust boundary). Forwarded
61
+ * verbatim to `initDevframe`.
62
+ */
63
+ allowedOrigins?: InitDevframeOptions['allowedOrigins'];
55
64
  /** Origin the Next app is reachable at, for docks needing an absolute URL. */
56
65
  resolveOrigin?: () => string;
57
66
  /** Override where persisted devframe state lives (defaults under the cwd / home). */
package/dist/single.mjs CHANGED
@@ -2,7 +2,7 @@ import { homedir } from "node:os";
2
2
  import { join } from "node:path";
3
3
  import process from "node:process";
4
4
  import { initDevframe } from "devframe/initiate";
5
- import { resolveClientAssets } from "devframe/internal";
5
+ import { normalizeBasePath, resolveBasePath, resolveClientAssets } from "devframe/internal";
6
6
  //#region src/config.ts
7
7
  /**
8
8
  * Apply the Next config settings a devframe **host** requires, preserving
@@ -30,10 +30,6 @@ function withDevframe(nextConfig = {}) {
30
30
  }
31
31
  //#endregion
32
32
  //#region src/handler.ts
33
- /** Ensure a mount base has a single leading and trailing slash. */
34
- function normalizeBase(base) {
35
- return `/${base}/`.replace(/\/{2,}/g, "/");
36
- }
37
33
  const REGISTRY_KEY = Symbol.for("@devframes/next:handler-registry");
38
34
  /**
39
35
  * Handlers memoized per key on `globalThis`. Next re-evaluates route modules
@@ -75,7 +71,7 @@ function defaultGetStorageDir(scope) {
75
71
  function createDevframeNextHandler(def, options = {}) {
76
72
  const distDir = resolveClientAssets(def);
77
73
  if (!distDir) throw new Error(`[@devframes/next] createDevframeNextHandler("${def.id}") needs a built SPA to serve, but "clientAssets" is not set on the devframe definition.`);
78
- const base = normalizeBase(options.base ?? def.basePath ?? `/__${def.id}/`);
74
+ const base = options.base ? normalizeBasePath(options.base) : resolveBasePath(def, "hosted");
79
75
  const key = options.key ?? `@devframes/next:${def.id}:${base}`;
80
76
  const registry = handlerRegistry();
81
77
  const memoized = registry.get(key);
@@ -91,6 +87,7 @@ function createDevframeNextHandler(def, options = {}) {
91
87
  */
92
88
  auth: options.auth,
93
89
  mcp: options.mcp,
90
+ allowedOrigins: options.allowedOrigins,
94
91
  /**
95
92
  * Next's route handlers never see WebSocket upgrades, so the RPC socket
96
93
  * lives on a side-car server (on `options.port` when pinned, otherwise
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/next",
3
3
  "type": "module",
4
- "version": "0.9.10",
4
+ "version": "0.9.12",
5
5
  "description": "Next.js host integration that serves mounted devframes from an App Router route.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -47,9 +47,9 @@
47
47
  "dist"
48
48
  ],
49
49
  "peerDependencies": {
50
- "@devframes/hub": "0.9.10",
51
- "@devframes/hub-ui": "0.9.10",
52
- "devframe": "0.9.10",
50
+ "@devframes/hub": "0.9.12",
51
+ "@devframes/hub-ui": "0.9.12",
52
+ "devframe": "0.9.12",
53
53
  "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
54
54
  "react": "^18.0.0 || ^19.0.0"
55
55
  },
@@ -71,11 +71,11 @@
71
71
  "h3": "^2.0.1-rc.29"
72
72
  },
73
73
  "devDependencies": {
74
- "@devframes/hub": "0.9.10",
75
- "@devframes/hub-ui": "0.9.10",
74
+ "@devframes/hub": "0.9.12",
75
+ "@devframes/hub-ui": "0.9.12",
76
76
  "@types/node": "^26.4.0",
77
77
  "@types/react": "^19.2.18",
78
- "devframe": "0.9.10",
78
+ "devframe": "0.9.12",
79
79
  "react": "^19.2.8",
80
80
  "tsdown": "^0.22.14"
81
81
  },