@devframes/next 0.9.11 → 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.mjs +2 -6
- package/package.json +7 -7
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 =
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/next",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
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.
|
|
51
|
-
"@devframes/hub-ui": "0.9.
|
|
52
|
-
"devframe": "0.9.
|
|
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.
|
|
75
|
-
"@devframes/hub-ui": "0.9.
|
|
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.
|
|
78
|
+
"devframe": "0.9.12",
|
|
79
79
|
"react": "^19.2.8",
|
|
80
80
|
"tsdown": "^0.22.14"
|
|
81
81
|
},
|