mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
1f56feab24
Commands no longer call process.exit() directly. Every failure now throws UsageError (bad input → exit 2) or BailianError (runtime failure, with AUTH/TIMEOUT codes), so the runtime's handleError stays the single exit point and telemetry always flushes. - convert 27 process.exit() sites across 15 commands to throws - move cross-flag/value checks into validate(); use flag `choices` for --events / --sort; drop dead --model required check - keep pipeline's process.exitCode for lint-style soft failures - enforce with unicorn/no-process-exit, allowed only in runtime/tools/tests - fix incidental lint: void floating run(), narrow console errorCode, align generate-reference type imports to source
28 lines
791 B
TypeScript
28 lines
791 B
TypeScript
import { defineConfig } from "vite-plus";
|
||
|
||
export default defineConfig({
|
||
test: {
|
||
globalSetup: "./packages/cli/tests/e2e/global-setup.ts",
|
||
testTimeout: 60_000,
|
||
hookTimeout: 60_000,
|
||
},
|
||
staged: {
|
||
"*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,json,yaml,yml,md}": "vp check --fix",
|
||
},
|
||
lint: {
|
||
options: { typeAware: true, typeCheck: true },
|
||
// 命令只许抛错;进程退出统一收口到 runtime 的 handleError。
|
||
rules: { "unicorn/no-process-exit": "error" },
|
||
overrides: [
|
||
{
|
||
// runtime 是统一出口层;tools/ 与测试是独立脚本入口,可直接退出。
|
||
files: ["packages/runtime/src/**", "tools/**", "**/tests/**"],
|
||
rules: { "unicorn/no-process-exit": "off" },
|
||
},
|
||
],
|
||
},
|
||
run: {
|
||
cache: true,
|
||
},
|
||
});
|