@virou/nuxt 1.1.0 → 1.1.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/README.md +3 -3
- package/dist/index.d.ts +13 -0
- package/dist/index.js +41 -0
- package/dist/plugin.mjs +8 -0
- package/package.json +10 -10
- package/dist/module.d.mts +0 -14
- package/dist/module.json +0 -9
- package/dist/module.mjs +0 -28
- package/dist/runtime/plugin.d.ts +0 -2
- package/dist/runtime/plugin.js +0 -6
- package/dist/types.d.mts +0 -1
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ const { router, route } = useVRouter('my-wizard', routes)
|
|
|
186
186
|
hash: string
|
|
187
187
|
meta?: Record<PropertyKey, unknown>
|
|
188
188
|
params?: Record<string, string>
|
|
189
|
-
|
|
189
|
+
'~renderList': Component[] | null
|
|
190
190
|
}
|
|
191
191
|
```
|
|
192
192
|
- `router`:
|
|
@@ -312,10 +312,10 @@ const { router, route } = useVRouter('embedded-widget-app')
|
|
|
312
312
|
|
|
313
313
|
#### Runtime-Registered Globals
|
|
314
314
|
|
|
315
|
-
You may also mark a router as global at runtime by passing the `
|
|
315
|
+
You may also mark a router as global at runtime by passing the `isGlobal` option:
|
|
316
316
|
|
|
317
317
|
```ts
|
|
318
|
-
useVRouter(routes, {
|
|
318
|
+
useVRouter(routes, { isGlobal: true })
|
|
319
319
|
```
|
|
320
320
|
|
|
321
321
|
That router will stay registered even after components that use it unmount.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema0 from "@nuxt/schema";
|
|
2
|
+
import { VirouPluginOptions } from "@virou/core";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
interface ModuleOptions extends VirouPluginOptions {}
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
declare module '@nuxt/schema' {
|
|
8
|
+
interface PublicRuntimeConfig {
|
|
9
|
+
virou?: ModuleOptions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ModuleOptions, _default as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { addComponent, addImports, defineNuxtModule } from "@nuxt/kit";
|
|
4
|
+
import { defu } from "defu";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const functions = ["useVRouter"];
|
|
9
|
+
const components = ["VRouterView"];
|
|
10
|
+
var src_default = defineNuxtModule({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "@virou/nuxt",
|
|
13
|
+
configKey: "virou"
|
|
14
|
+
},
|
|
15
|
+
setup(options, nuxt) {
|
|
16
|
+
nuxt.options.runtimeConfig.public.virou = defu(nuxt.options.runtimeConfig.public.virou, options);
|
|
17
|
+
const pluginPath = resolve(_dirname, "./plugin.mjs");
|
|
18
|
+
nuxt.options.plugins = nuxt.options.plugins ?? [];
|
|
19
|
+
nuxt.options.plugins.push(pluginPath);
|
|
20
|
+
nuxt.options.build.transpile.push(pluginPath);
|
|
21
|
+
functions.forEach((name) => {
|
|
22
|
+
addImports({
|
|
23
|
+
name,
|
|
24
|
+
as: name,
|
|
25
|
+
from: "@virou/core",
|
|
26
|
+
priority: -1
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
components.forEach((name) => {
|
|
30
|
+
addComponent({
|
|
31
|
+
name,
|
|
32
|
+
export: name,
|
|
33
|
+
filePath: "@virou/core",
|
|
34
|
+
priority: -1
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { src_default as default };
|
package/dist/plugin.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virou/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "Virou Nuxt Module",
|
|
6
6
|
"author": "Tankosin<https://github.com/tankosinn>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"exports": {
|
|
28
|
-
"types": "./dist/
|
|
29
|
-
"default": "./dist/
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
30
|
},
|
|
31
|
-
"main": "./dist/
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
32
33
|
"files": [
|
|
33
34
|
"dist"
|
|
34
35
|
],
|
|
@@ -36,16 +37,15 @@
|
|
|
36
37
|
"node": ">=18.12.0"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@nuxt/kit": "^
|
|
40
|
+
"@nuxt/kit": "^4.2.2",
|
|
40
41
|
"defu": "^6.1.4",
|
|
41
|
-
"@virou/core": "1.1.
|
|
42
|
+
"@virou/core": "1.1.2"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@nuxt/
|
|
45
|
-
"
|
|
46
|
-
"nuxt": "3.17.3"
|
|
45
|
+
"@nuxt/schema": "4.2.2",
|
|
46
|
+
"nuxt": "4.2.2"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "
|
|
49
|
+
"build": "pnpm -w tsdown -F @virou/nuxt"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/dist/module.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { VirouPluginOptions } from '@virou/core';
|
|
3
|
-
|
|
4
|
-
interface ModuleOptions extends VirouPluginOptions {
|
|
5
|
-
}
|
|
6
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
-
|
|
8
|
-
declare module '@nuxt/schema' {
|
|
9
|
-
interface PublicRuntimeConfig {
|
|
10
|
-
virou?: ModuleOptions;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { type ModuleOptions, _default as default };
|
package/dist/module.json
DELETED
package/dist/module.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, addImports, addComponent } from '@nuxt/kit';
|
|
2
|
-
import { defu } from 'defu';
|
|
3
|
-
|
|
4
|
-
const functions = [
|
|
5
|
-
"useVRouter"
|
|
6
|
-
];
|
|
7
|
-
const components = [
|
|
8
|
-
"VRouterView"
|
|
9
|
-
];
|
|
10
|
-
const module = defineNuxtModule({
|
|
11
|
-
meta: {
|
|
12
|
-
name: "@virou/nuxt",
|
|
13
|
-
configKey: "virou"
|
|
14
|
-
},
|
|
15
|
-
setup(options, nuxt) {
|
|
16
|
-
const resolver = createResolver(import.meta.url);
|
|
17
|
-
nuxt.options.runtimeConfig.public.virou = defu(nuxt.options.runtimeConfig.public.virou, options);
|
|
18
|
-
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
19
|
-
functions.forEach((name) => {
|
|
20
|
-
addImports({ name, as: name, from: "@virou/core", priority: -1 });
|
|
21
|
-
});
|
|
22
|
-
components.forEach((name) => {
|
|
23
|
-
addComponent({ name, export: name, filePath: "@virou/core", priority: -1 });
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export { module as default };
|
package/dist/runtime/plugin.d.ts
DELETED
package/dist/runtime/plugin.js
DELETED
package/dist/types.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module.mjs'
|