@devframes/nuxt 0.2.2 → 0.2.3
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _$_nuxt_schema0 from "@nuxt/schema";
|
|
2
2
|
import { DevframeDefinition } from "devframe/types";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/module.d.ts
|
|
5
5
|
interface DevframeNuxtModuleOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Base URL, relative to the deployed page, where the devframe
|
|
@@ -46,6 +46,7 @@ interface DevframeNuxtModuleOptions {
|
|
|
46
46
|
flags?: Record<string, unknown>;
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
+
type ModuleOptions = DevframeNuxtModuleOptions;
|
|
49
50
|
/**
|
|
50
51
|
* Nuxt module that wires a Nuxt-built SPA up as a devframe client, and
|
|
51
52
|
* (optionally) serves the dev-time RPC bridge alongside `nuxt dev`.
|
|
@@ -79,4 +80,4 @@ interface DevframeNuxtModuleOptions {
|
|
|
79
80
|
*/
|
|
80
81
|
declare const _default: _$_nuxt_schema0.NuxtModule<DevframeNuxtModuleOptions, DevframeNuxtModuleOptions, false>;
|
|
81
82
|
//#endregion
|
|
82
|
-
export { DevframeNuxtModuleOptions, _default as default };
|
|
83
|
+
export { DevframeNuxtModuleOptions, ModuleOptions, _default as default };
|
package/dist/module.json
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addPlugin, addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
2
2
|
import { viteDevBridge } from "devframe/helpers/vite";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/module.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,9 +32,9 @@ import { viteDevBridge } from "devframe/helpers/vite";
|
|
|
32
32
|
* }
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
var
|
|
35
|
+
var module_default = defineNuxtModule({
|
|
36
36
|
meta: {
|
|
37
|
-
name: "
|
|
37
|
+
name: "@devframes/nuxt",
|
|
38
38
|
configKey: "devframe"
|
|
39
39
|
},
|
|
40
40
|
defaults: {
|
|
@@ -53,10 +53,8 @@ var src_default = defineNuxtModule({
|
|
|
53
53
|
nuxt.options.runtimeConfig ??= {};
|
|
54
54
|
nuxt.options.runtimeConfig.public ??= {};
|
|
55
55
|
const publicConfig = nuxt.options.runtimeConfig.public;
|
|
56
|
-
publicConfig.devframe
|
|
57
|
-
|
|
58
|
-
baseURL: options.baseURL
|
|
59
|
-
};
|
|
56
|
+
publicConfig.devframe ??= {};
|
|
57
|
+
Object.assign(publicConfig.devframe, publicConfig.devframe ?? {}, { baseURL: options.baseURL });
|
|
60
58
|
const runtimeDir = resolve("./runtime");
|
|
61
59
|
nuxt.hook("prepare:types", ({ references }) => {
|
|
62
60
|
references.push({ path: resolve(runtimeDir, "types") });
|
|
@@ -80,4 +78,4 @@ var src_default = defineNuxtModule({
|
|
|
80
78
|
}
|
|
81
79
|
});
|
|
82
80
|
//#endregion
|
|
83
|
-
export {
|
|
81
|
+
export { module_default as default };
|
|
@@ -6,7 +6,7 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
|
|
|
6
6
|
* and provides the RPC client as `$rpc` / `useNuxtApp().$rpc`.
|
|
7
7
|
*/
|
|
8
8
|
var plugin_client_default = defineNuxtPlugin({ async setup() {
|
|
9
|
-
return { provide: { rpc: await connectDevframe({ baseURL: useRuntimeConfig().public
|
|
9
|
+
return { provide: { rpc: await connectDevframe({ baseURL: useRuntimeConfig().public.devframe.baseURL ?? "./" }) } };
|
|
10
10
|
} });
|
|
11
11
|
//#endregion
|
|
12
12
|
export { plugin_client_default as default };
|
package/dist/types.d.mts
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "Nuxt module for Devframe — wires a Nuxt-built SPA up as a devframe client",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,23 +19,26 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"exports": {
|
|
22
|
-
".":
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/types.d.mts",
|
|
24
|
+
"default": "./dist/module.mjs"
|
|
25
|
+
},
|
|
23
26
|
"./package.json": "./package.json"
|
|
24
27
|
},
|
|
25
|
-
"types": "./dist/
|
|
28
|
+
"types": "./dist/types.d.mts",
|
|
26
29
|
"files": [
|
|
27
30
|
"dist"
|
|
28
31
|
],
|
|
29
32
|
"peerDependencies": {
|
|
30
33
|
"@nuxt/kit": "^3.0.0 || ^4.0.0 || ^5.0.0-0",
|
|
31
|
-
"devframe": "0.2.
|
|
34
|
+
"devframe": "0.2.3"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@nuxt/kit": "^4.4.5",
|
|
35
38
|
"@types/node": "^25.7.0",
|
|
36
39
|
"nuxt": "^4.4.4",
|
|
37
40
|
"tsdown": "^0.22.0",
|
|
38
|
-
"devframe": "0.2.
|
|
41
|
+
"devframe": "0.2.3"
|
|
39
42
|
},
|
|
40
43
|
"scripts": {
|
|
41
44
|
"build": "tsdown",
|