vite-plugin-generoutes 2.0.0-beta.2 → 2.0.0-beta.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.
- package/dist/index.d.ts +1 -9
- package/dist/index.js +7 -1
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { RouteRecordRaw } from 'vue-router';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Route meta information
|
|
@@ -35,13 +34,6 @@ interface RouteMeta {
|
|
|
35
34
|
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
|
|
36
35
|
**********************************/
|
|
37
36
|
|
|
38
|
-
/**
|
|
39
|
-
* Generated route record with proper typing for vue-router
|
|
40
|
-
*/
|
|
41
|
-
type GeneratedRoute = RouteRecordRaw & {
|
|
42
|
-
meta?: RouteMeta;
|
|
43
|
-
children?: GeneratedRoute[];
|
|
44
|
-
};
|
|
45
37
|
interface Options {
|
|
46
38
|
/**
|
|
47
39
|
* pages folder
|
|
@@ -71,4 +63,4 @@ interface Options {
|
|
|
71
63
|
}
|
|
72
64
|
declare function VitePluginGeneroutes(options?: Partial<Options>): Plugin;
|
|
73
65
|
|
|
74
|
-
export { type
|
|
66
|
+
export { type Options, type RouteMeta, VitePluginGeneroutes, VitePluginGeneroutes as default };
|
package/dist/index.js
CHANGED
|
@@ -131,7 +131,13 @@ function VitePluginGeneroutes(options = {}) {
|
|
|
131
131
|
async function writerRoutesFile(isInit = false) {
|
|
132
132
|
const routes = generateRoutes();
|
|
133
133
|
const typeDefinitions = isTypeScript ? `
|
|
134
|
-
import type {
|
|
134
|
+
import type { RouteMeta } from 'vite-plugin-generoutes'
|
|
135
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
136
|
+
|
|
137
|
+
export type GeneratedRoute = RouteRecordRaw & {
|
|
138
|
+
meta?: RouteMeta
|
|
139
|
+
children?: GeneratedRoute[]
|
|
140
|
+
}
|
|
135
141
|
` : "";
|
|
136
142
|
const routesType = isTypeScript ? ": GeneratedRoute[]" : "";
|
|
137
143
|
let routesStr = `
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-generoutes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.3",
|
|
5
5
|
"packageManager": "pnpm@10.27.0",
|
|
6
6
|
"description": "A Vite plugin that generate routes based on the file structure, supports dynamic routes, and supports custom meta data for each route.",
|
|
7
7
|
"author": "Ronnie Zhang <zclzone@outlook.com>",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"prepublishOnly": "nr build",
|
|
42
42
|
"release": "bumpp && npm publish",
|
|
43
43
|
"test": "vitest",
|
|
44
|
-
"typecheck": "tsc --noEmit",
|
|
45
44
|
"prepare": "simple-git-hooks",
|
|
46
45
|
"up:deps": "taze major -I"
|
|
47
46
|
},
|