@kevisual/router 0.0.3 → 0.0.4-alpha-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/dist/app.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/route.d.ts +2 -0
- package/package.json +10 -10
package/dist/app.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5900,6 +5900,16 @@ class QueryRouter {
|
|
|
5900
5900
|
return { code, data: body, message };
|
|
5901
5901
|
};
|
|
5902
5902
|
}
|
|
5903
|
+
exportRoutes() {
|
|
5904
|
+
return this.routes.map((r) => {
|
|
5905
|
+
return r;
|
|
5906
|
+
});
|
|
5907
|
+
}
|
|
5908
|
+
importRoutes(routes) {
|
|
5909
|
+
for (let route of routes) {
|
|
5910
|
+
this.add(route);
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5903
5913
|
}
|
|
5904
5914
|
/**
|
|
5905
5915
|
* QueryRouterServer
|
|
@@ -6412,6 +6422,15 @@ class App {
|
|
|
6412
6422
|
const router = this.router;
|
|
6413
6423
|
return await router.parse(message, ctx);
|
|
6414
6424
|
}
|
|
6425
|
+
exportRoutes() {
|
|
6426
|
+
return this.router.exportRoutes();
|
|
6427
|
+
}
|
|
6428
|
+
importRoutes(routes) {
|
|
6429
|
+
this.router.importRoutes(routes);
|
|
6430
|
+
}
|
|
6431
|
+
importApp(app) {
|
|
6432
|
+
this.importRoutes(app.exportRoutes());
|
|
6433
|
+
}
|
|
6415
6434
|
}
|
|
6416
6435
|
|
|
6417
6436
|
export { App, Connect, CustomError, QueryConnect, QueryRouter, QueryRouterServer, Result, Route, ZodType as Schema, Server, createSchema, handleServer };
|
package/dist/route.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@kevisual/router",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4-alpha-1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -16,22 +16,22 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"keywords": [],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "
|
|
19
|
+
"author": "abearxiong",
|
|
20
|
+
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@rollup/plugin-commonjs": "^
|
|
23
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
24
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
22
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
23
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
24
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
25
25
|
"@types/lodash-es": "^4.17.12",
|
|
26
|
-
"@types/node": "^22.
|
|
26
|
+
"@types/node": "^22.7.9",
|
|
27
27
|
"@types/ws": "^8.5.12",
|
|
28
28
|
"lodash-es": "^4.17.21",
|
|
29
29
|
"nanoid": "^5.0.7",
|
|
30
|
-
"rollup": "^4.
|
|
30
|
+
"rollup": "^4.24.0",
|
|
31
31
|
"ts-loader": "^9.5.1",
|
|
32
32
|
"ts-node": "^10.9.2",
|
|
33
|
-
"tslib": "^2.
|
|
34
|
-
"typescript": "^5.6.
|
|
33
|
+
"tslib": "^2.8.0",
|
|
34
|
+
"typescript": "^5.6.3",
|
|
35
35
|
"zod": "^3.23.8"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|