From b375e5ac232bc9a58a0bc30581229f55c1ace373 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 7 Mar 2026 01:46:01 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E8=87=B3=200.0.88=20=E5=B9=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AF=BC=E5=85=A5=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20QueryRouterServer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/commander.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5f2f01a..853bf20 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/commander.ts b/src/commander.ts index 3fb672d..0146436 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -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) {