chore: 更新版本号至 0.0.88 并修改类型导入以支持 QueryRouterServer
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user