Repository navigation
feat(cli): 增加 flag schema 与异步 runCli,发布 0.3.0 - #6
Merged
Merged
Conversation
无功能性更新:仅升级开发工具链依赖与 lockfile(vite-plus 1.5.1 → 1.6.0)。
命令级 FlagSpec 让布尔 flag 不再吞 positional;runCli 支持异步命令、 help 函数与领域错误映射;未知参数、布尔显式值与带值参数缺值统一报 USAGE。 runCli 改为 Promise<number>,入口需 await;补原型链命令名回归测试。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlagSpec:声明为布尔的 flag 不再吞后面的 positional;支持--终止符与空字符串值。runCli改为Promise<number>,支持异步命令、help函数与mapError;未知参数、布尔显式值、带值参数缺值统一报USAGE退出 2。flagValue/flagBool/reportError/exitCodeOf与退出码常量。constructor/__proto__/toString被当成已注册命令的问题。Breaking:
runCli返回 Promise,入口需await。依赖
本分支基于
chore/vp-1.6,包含 #5 的 Vite+ 1.6 升级提交;#5 合并后会 rebase 到 main,只保留本 PR 的发布提交。Test plan
pnpm test:40 项通过pnpm checkpnpm buildnpm pack --dry-run核对包内容