chore: 更新版本号至 0.0.88 并修改类型导入以支持 QueryRouterServer
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/package",
|
"$schema": "https://json.schemastore.org/package",
|
||||||
"name": "@kevisual/router",
|
"name": "@kevisual/router",
|
||||||
"version": "0.0.87",
|
"version": "0.0.88",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/router.js",
|
"main": "./dist/router.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { program } from 'commander';
|
import { program } from 'commander';
|
||||||
import { App } from './app.ts';
|
import { App, QueryRouterServer } from './app.ts';
|
||||||
|
|
||||||
export const groupByPath = (routes: App['routes']) => {
|
export const groupByPath = (routes: App['routes']) => {
|
||||||
return routes.reduce((acc, route) => {
|
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: QueryRouterServer, description?: string, parse?: boolean }) => {
|
||||||
|
const { app, description, parse = true } = opts;
|
||||||
export const parse = (opts: { app: App, description?: string, parse?: boolean }) => {
|
|
||||||
const { app, description, parse } = opts;
|
|
||||||
program.description(description || 'Router 命令行工具');
|
program.description(description || 'Router 命令行工具');
|
||||||
createCommand({ app: app as App, program });
|
createCommand({ app: app as App, program });
|
||||||
if (parse) {
|
if (parse) {
|
||||||
|
|||||||
Reference in New Issue
Block a user