vite-plugin-generoutes 1.1.0-beta.7 → 1.1.1
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 +4 -0
- package/README.zh_CN.md +4 -0
- package/dist/index.js +3 -3
- package/package.json +14 -12
package/README.md
CHANGED
package/README.zh_CN.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import path from "path";
|
|
3
|
+
import { styleText } from "util";
|
|
3
4
|
import { debounce, slash } from "@antfu/utils";
|
|
4
5
|
import { parse } from "@vue/compiler-sfc";
|
|
5
|
-
import chalk from "chalk";
|
|
6
6
|
import fs from "fs-extra";
|
|
7
7
|
import { globSync } from "glob";
|
|
8
8
|
import prettier from "prettier";
|
|
@@ -120,7 +120,7 @@ export interface RouteMeta {
|
|
|
120
120
|
/** Page code */
|
|
121
121
|
code?: string
|
|
122
122
|
/** Page layout */
|
|
123
|
-
layout?: string |
|
|
123
|
+
layout?: string | false
|
|
124
124
|
/** Whether authentication is required */
|
|
125
125
|
requireAuth?: boolean
|
|
126
126
|
/** Whether to keep alive */
|
|
@@ -153,7 +153,7 @@ export type GeneratedRoute = RouteRecordRaw & {
|
|
|
153
153
|
const filePath = path.resolve(rootDir, routesPath);
|
|
154
154
|
await fs.ensureDir(path.dirname(filePath));
|
|
155
155
|
fs.writeFileSync(filePath, routesStr);
|
|
156
|
-
console.log(` \u2705 ${isInit ? "routes generated:" : "routes updated:"} ${
|
|
156
|
+
console.log(` \u2705 ${isInit ? "routes generated:" : "routes updated:"} ${styleText("cyanBright", routesPath)}`);
|
|
157
157
|
}
|
|
158
158
|
const debounceWriter = debounce(500, writerRoutesFile);
|
|
159
159
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-generoutes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
|
+
"packageManager": "pnpm@10.27.0",
|
|
5
6
|
"description": "A Vite plugin that generate routes based on the file structure, supports dynamic routes, and supports custom meta data for each route.",
|
|
6
7
|
"author": "Ronnie Zhang <zclzone@outlook.com>",
|
|
7
8
|
"license": "MIT",
|
|
@@ -33,6 +34,17 @@
|
|
|
33
34
|
"files": [
|
|
34
35
|
"dist"
|
|
35
36
|
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"start": "tsup --watch",
|
|
39
|
+
"build": "tsup",
|
|
40
|
+
"lint": "eslint .",
|
|
41
|
+
"prepublishOnly": "nr build",
|
|
42
|
+
"release": "bumpp && npm publish",
|
|
43
|
+
"test": "vitest",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"prepare": "simple-git-hooks",
|
|
46
|
+
"up:deps": "taze major -I"
|
|
47
|
+
},
|
|
36
48
|
"peerDependencies": {
|
|
37
49
|
"vite": ">=6.1.0",
|
|
38
50
|
"vue-router": ">=4.0.0"
|
|
@@ -40,7 +52,6 @@
|
|
|
40
52
|
"dependencies": {
|
|
41
53
|
"@antfu/utils": "^9.3.0",
|
|
42
54
|
"@vue/compiler-sfc": "^3.5.26",
|
|
43
|
-
"chalk": "^5.6.2",
|
|
44
55
|
"fs-extra": "^11.3.3",
|
|
45
56
|
"glob": "^13.0.0",
|
|
46
57
|
"prettier": "^3.7.4"
|
|
@@ -68,14 +79,5 @@
|
|
|
68
79
|
},
|
|
69
80
|
"lint-staged": {
|
|
70
81
|
"*": "eslint --fix"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"start": "tsup --watch",
|
|
74
|
-
"build": "tsup",
|
|
75
|
-
"lint": "eslint .",
|
|
76
|
-
"release": "bumpp && npm publish",
|
|
77
|
-
"test": "vitest",
|
|
78
|
-
"typecheck": "tsc --noEmit",
|
|
79
|
-
"up:deps": "taze major -I"
|
|
80
82
|
}
|
|
81
|
-
}
|
|
83
|
+
}
|