chore: 更新版本号至 0.0.88 并修改类型导入以支持 QueryRouterServer

This commit is contained in:
2026-03-07 01:46:01 +08:00
parent 7345940f18
commit b375e5ac23
2 changed files with 4 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router",
"version": "0.0.87",
"version": "0.0.88",
"description": "",
"type": "module",
"main": "./dist/router.js",

View File

@@ -1,5 +1,5 @@
import { program } from 'commander';
import { App } from './app.ts';
import { App, QueryRouterServer } from './app.ts';
export const groupByPath = (routes: App['routes']) => {
return routes.reduce((acc, route) => {
@@ -103,10 +103,8 @@ export const createCommand = (opts: { app: App, program: typeof program }) => {
}
}
program.parse(process.argv);
export const parse = (opts: { app: App, description?: string, parse?: boolean }) => {
const { app, description, parse } = opts;
export const parse = (opts: { app: QueryRouterServer, description?: string, parse?: boolean }) => {
const { app, description, parse = true } = opts;
program.description(description || 'Router 命令行工具');
createCommand({ app: app as App, program });
if (parse) {