@devframes/nuxt 0.9.0-beta.4 → 0.9.0-beta.7
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/hub-client.mjs +1 -2
- package/dist/hub.d.mts +1 -1
- package/dist/hub.mjs +3 -9
- package/dist/index.mjs +1 -1
- package/dist/module.json +2 -2
- package/dist/{dev-spa.d.mts → single.d.mts} +1 -1
- package/dist/{dev-spa.mjs → single.mjs} +4 -4
- package/package.json +9 -9
package/dist/hub-client.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createDevframeClientHost } from "@devframes/hub/client";
|
|
2
|
+
import { DEVFRAMES_HUB_BASE } from "@devframes/hub/constants";
|
|
2
3
|
import { onScopeDispose, shallowRef } from "vue";
|
|
3
4
|
//#region src/hub-client.ts
|
|
4
|
-
/** Default hub mount base — mirrors `@devframes/hub`'s `DEVFRAMES_HUB_BASE`. */
|
|
5
|
-
const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
6
5
|
/**
|
|
7
6
|
* Boot the devframes-hub **client runtime** inside a Nuxt (Vue) client
|
|
8
7
|
* component — the browser half of `@devframes/nuxt/hub`. Connects RPC to the
|
package/dist/hub.d.mts
CHANGED
|
@@ -27,7 +27,7 @@ type ModuleOptions = DevframeNuxtHubOptions;
|
|
|
27
27
|
* integrates the same hub protocol natively and is the recommended path for a
|
|
28
28
|
* Nuxt app, so this module emits a one-time notice to that effect (silence it
|
|
29
29
|
* with `{ quiet: true }`). To wire a Nuxt app up as a single devframe client,
|
|
30
|
-
* reach for `@devframes/nuxt/
|
|
30
|
+
* reach for `@devframes/nuxt/single` instead.
|
|
31
31
|
*
|
|
32
32
|
* ```ts [nuxt.config.ts]
|
|
33
33
|
* export default defineNuxtConfig({
|
package/dist/hub.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
2
|
+
import { DEVFRAMES_HUB_BASE, normalizeHubBase } from "@devframes/hub/constants";
|
|
2
3
|
import { viteDevframeHub } from "@devframes/vite/hub";
|
|
3
4
|
//#region src/hub.ts
|
|
4
|
-
/** Default hub mount base — mirrors `@devframes/hub`'s `DEVFRAMES_HUB_BASE`. */
|
|
5
|
-
const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
6
5
|
let recommendedNuxtDevtools = false;
|
|
7
6
|
function recommendNuxtDevtools() {
|
|
8
7
|
if (recommendedNuxtDevtools) return;
|
|
@@ -21,7 +20,7 @@ function recommendNuxtDevtools() {
|
|
|
21
20
|
* integrates the same hub protocol natively and is the recommended path for a
|
|
22
21
|
* Nuxt app, so this module emits a one-time notice to that effect (silence it
|
|
23
22
|
* with `{ quiet: true }`). To wire a Nuxt app up as a single devframe client,
|
|
24
|
-
* reach for `@devframes/nuxt/
|
|
23
|
+
* reach for `@devframes/nuxt/single` instead.
|
|
25
24
|
*
|
|
26
25
|
* ```ts [nuxt.config.ts]
|
|
27
26
|
* export default defineNuxtConfig({
|
|
@@ -39,7 +38,7 @@ var hub_default = defineNuxtModule({
|
|
|
39
38
|
if (!options.quiet) recommendNuxtDevtools();
|
|
40
39
|
if (!nuxt.options.dev) return;
|
|
41
40
|
createResolver(import.meta.url);
|
|
42
|
-
const base =
|
|
41
|
+
const base = normalizeHubBase(options.base ?? DEVFRAMES_HUB_BASE);
|
|
43
42
|
const { injectEmbedded, quiet: _quiet, ...hubOptions } = options;
|
|
44
43
|
addVitePlugin(viteDevframeHub({
|
|
45
44
|
...hubOptions,
|
|
@@ -57,10 +56,5 @@ var hub_default = defineNuxtModule({
|
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
|
-
function normalizeBase(base) {
|
|
61
|
-
let out = base.startsWith("/") ? base : `/${base}`;
|
|
62
|
-
if (!out.endsWith("/")) out = `${out}/`;
|
|
63
|
-
return out;
|
|
64
|
-
}
|
|
65
59
|
//#endregion
|
|
66
60
|
export { hub_default as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/index.ts
|
|
2
|
-
throw new Error("[@devframes/nuxt] has no root export. Use a scoped subpath instead:\n • modules: [\"@devframes/nuxt/
|
|
2
|
+
throw new Error("[@devframes/nuxt] has no root export. Use a scoped subpath instead:\n • modules: [\"@devframes/nuxt/single\"] — Nuxt app as one devframe client\n • modules: [\"@devframes/nuxt/hub\"] — mount a devframes-hub with nuxt dev\n");
|
|
3
3
|
//#endregion
|
|
4
4
|
export {};
|
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { devframeViteBridge } from "@devframes/vite/
|
|
1
|
+
import { devframeViteBridge } from "@devframes/vite/single";
|
|
2
2
|
import { addPlugin, addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/single.ts
|
|
4
4
|
/**
|
|
5
5
|
* Nuxt module that wires a Nuxt-built SPA up as a devframe client, and
|
|
6
6
|
* (optionally) serves the dev-time RPC bridge alongside `nuxt dev`.
|
|
@@ -32,7 +32,7 @@ import { addPlugin, addVitePlugin, createResolver, defineNuxtModule } from "@nux
|
|
|
32
32
|
* }
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
var
|
|
35
|
+
var single_default = defineNuxtModule({
|
|
36
36
|
meta: {
|
|
37
37
|
name: "@devframes/nuxt",
|
|
38
38
|
configKey: "devframe"
|
|
@@ -76,4 +76,4 @@ var dev_spa_default = defineNuxtModule({
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
//#endregion
|
|
79
|
-
export {
|
|
79
|
+
export { single_default as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.0-beta.
|
|
4
|
+
"version": "0.9.0-beta.7",
|
|
5
5
|
"description": "Nuxt module that exposes a Nuxt app as a devframe client.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"types": "./dist/index.d.mts",
|
|
24
24
|
"default": "./dist/index.mjs"
|
|
25
25
|
},
|
|
26
|
-
"./
|
|
27
|
-
"types": "./dist/
|
|
28
|
-
"default": "./dist/
|
|
26
|
+
"./single": {
|
|
27
|
+
"types": "./dist/single.d.mts",
|
|
28
|
+
"default": "./dist/single.mjs"
|
|
29
29
|
},
|
|
30
30
|
"./hub": {
|
|
31
31
|
"types": "./dist/hub.d.mts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nuxt/kit": "^3.0.0 || ^4.0.0 || ^5.0.0-0",
|
|
46
46
|
"vue": "^3.0.0",
|
|
47
|
-
"@devframes/hub": "0.9.0-beta.
|
|
48
|
-
"devframe": "0.9.0-beta.
|
|
47
|
+
"@devframes/hub": "0.9.0-beta.7",
|
|
48
|
+
"devframe": "0.9.0-beta.7"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@devframes/hub": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@devframes/vite": "0.9.0-beta.
|
|
59
|
+
"@devframes/vite": "0.9.0-beta.7"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@nuxt/kit": "^4.5.2",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"nuxt": "^4.5.2",
|
|
65
65
|
"tsdown": "^0.22.14",
|
|
66
66
|
"vue": "^3.5.41",
|
|
67
|
-
"devframe": "0.9.0-beta.
|
|
68
|
-
"@devframes/hub": "0.9.0-beta.
|
|
67
|
+
"devframe": "0.9.0-beta.7",
|
|
68
|
+
"@devframes/hub": "0.9.0-beta.7"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsdown",
|