chore: 更新版本号至 0.1.3,并升级 @opencode-ai/plugin 和 nanoid 依赖,增强命令行参数解析功能

This commit is contained in:
xiongxiao
2026-03-17 20:46:13 +08:00
committed by cnb
parent 151586f98c
commit 648fe7ad33
2 changed files with 11 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/package", "$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router", "name": "@kevisual/router",
"version": "0.1.2", "version": "0.1.3",
"description": "", "description": "",
"type": "module", "type": "module",
"main": "./dist/router.js", "main": "./dist/router.js",
@@ -30,7 +30,7 @@
"@kevisual/query": "^0.0.53", "@kevisual/query": "^0.0.53",
"@kevisual/remote-app": "^0.0.7", "@kevisual/remote-app": "^0.0.7",
"@kevisual/use-config": "^1.0.30", "@kevisual/use-config": "^1.0.30",
"@opencode-ai/plugin": "^1.2.26", "@opencode-ai/plugin": "^1.2.27",
"@types/bun": "^1.3.10", "@types/bun": "^1.3.10",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/node": "^25.5.0", "@types/node": "^25.5.0",
@@ -43,7 +43,7 @@
"eventemitter3": "^5.0.4", "eventemitter3": "^5.0.4",
"fast-glob": "^3.3.3", "fast-glob": "^3.3.3",
"hono": "^4.12.8", "hono": "^4.12.8",
"nanoid": "^5.1.6", "nanoid": "^5.1.7",
"path-to-regexp": "^8.3.0", "path-to-regexp": "^8.3.0",
"send": "^1.2.1", "send": "^1.2.1",
"typescript": "^5.9.3", "typescript": "^5.9.3",

View File

@@ -124,9 +124,10 @@ export const parse = async (opts: {
token?: string, token?: string,
username?: string, username?: string,
id?: string, id?: string,
} },
exitOnEnd?: boolean,
}) => { }) => {
const { description, parse = true, version } = opts; const { description, parse = true, version, exitOnEnd = true } = opts;
const app = opts.app as App; const app = opts.app as App;
const _program = opts.program || program; const _program = opts.program || program;
_program.description(description || 'Router 命令行工具'); _program.description(description || 'Router 命令行工具');
@@ -167,9 +168,12 @@ export const parse = async (opts: {
remoteApp.listenProxy(); remoteApp.listenProxy();
console.log('已连接到远程应用,正在监听命令...'); console.log('已连接到远程应用,正在监听命令...');
} }
return return;
} }
if (parse) { if (parse) {
_program.parse(process.argv); await _program.parseAsync(process.argv);
if (exitOnEnd) {
process.exit(0);
}
} }
} }