@kevisual/router 0.0.87 → 0.0.88

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.js CHANGED
@@ -19579,7 +19579,7 @@ app
19579
19579
  10. **中间件找不到会返回 404**,错误信息中会包含找不到的中间件列表。
19580
19580
  `;
19581
19581
  // package.json
19582
- var version2 = "0.0.87";
19582
+ var version2 = "0.0.88";
19583
19583
 
19584
19584
  // agent/routes/route-create.ts
19585
19585
  app.route({
@@ -807,7 +807,7 @@ declare const createCommand: (opts: {
807
807
  program: typeof program;
808
808
  }) => void;
809
809
  declare const parse: (opts: {
810
- app: App;
810
+ app: QueryRouterServer;
811
811
  description?: string;
812
812
  parse?: boolean;
813
813
  }) => void;
package/dist/commander.js CHANGED
@@ -2225,9 +2225,8 @@ var createCommand2 = (opts) => {
2225
2225
  });
2226
2226
  }
2227
2227
  };
2228
- program.parse(process.argv);
2229
2228
  var parse = (opts) => {
2230
- const { app, description, parse: parse2 } = opts;
2229
+ const { app, description, parse: parse2 = true } = opts;
2231
2230
  program.description(description || "Router 命令行工具");
2232
2231
  createCommand2({ app, program });
2233
2232
  if (parse2) {
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.87",
4
+ "version": "0.0.88",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "main": "./dist/router.js",
package/src/commander.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { program } from 'commander';
2
- import { App } from './app.ts';
2
+ import { App, QueryRouterServer } from './app.ts';
3
3
 
4
4
  export const groupByPath = (routes: App['routes']) => {
5
5
  return routes.reduce((acc, route) => {
@@ -103,10 +103,8 @@ export const createCommand = (opts: { app: App, program: typeof program }) => {
103
103
  }
104
104
  }
105
105
 
106
- program.parse(process.argv);
107
-
108
- export const parse = (opts: { app: App, description?: string, parse?: boolean }) => {
109
- const { app, description, parse } = opts;
106
+ export const parse = (opts: { app: QueryRouterServer, description?: string, parse?: boolean }) => {
107
+ const { app, description, parse = true } = opts;
110
108
  program.description(description || 'Router 命令行工具');
111
109
  createCommand({ app: app as App, program });
112
110
  if (parse) {