Repository navigation
fix(import): restore --json for cache status and GC - #580
Merged
Merged
Conversation
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
修复 PR #71 迁移缓存命令后遗漏的
--json选项注册,使teamai import --cache-status --json和--cache-gc --json可以正常使用已有的 JSON 输出能力。
本次修改不改变缓存状态查询或垃圾回收的实现。
Type of Change
Test Plan
npx tsc --noEmitpassesnpm run buildpassesnpx vitest run src/__tests__/index-import-help.test.ts src/__tests__/cache-cmd.test.tspasses(7 个测试)node dist/index.js import --help显示--jsonnode dist/index.js import --cache-status --json输出可解析的 JSONnode dist/index.js --dry-run import --cache-gc --json输出可解析的 JSONRelated Issues
N/A
Notes for Reviewers
PR #71 将原来的顶层缓存命令:
迁移为:
原命令支持
--json。迁移后,代码仍将cmdOpts.json传递给cacheCmd,但import命令没有重新注册该选项,导致 CLI 报错:本 PR 仅补回缺失的 Commander 选项注册,并增加 CLI 帮助信息回归测试。