vitest plugin: check options against userConfig declared only through the manifest option

未关闭 适合新手
#219 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
testing

调研方向

从 packages/vitest-plugin-claude-code-mod/src/index.ts及其测试入手,了解如何从package.json读取userConfig,以及选项验证如何报告失败。为仅通过拟议选项提供的声明添加测试,沿用现有的失败文本;更新README并添加一个minor changeset。测试、文档和changeset满足验收标准后即完成。

由索引模型根据 Issue 内容生成。

描述

enhancement
Problem

PR #218 checks a test's options against the userConfig entries declared in package.json (type, min, max, required), as claude plugin test does. A project that declares userConfig only through the manifest option of the Rolldown plugin or the tsdown preset passes just the values through claudeCodeMod({ userConfig }), so the declared entries are empty for it and the check is skipped: the kit still accepts options the engine refuses.

Proposal

Give claudeCodeMod a way to take the declared entries. Recommendation: an optional declared option (the same shape as the userConfig entries of package.json) that is merged over the package.json entries, with package.json staying the default source. Alternative: read the built plugin/.claude-plugin/plugin.json when it exists; rejected as the default because the test run must not depend on a build.

Design points

Option name and shape: recommendation declared, same entry shape as package.json. Precedence: the option wins over package.json per key.

Package

@kwitsch/vitest-plugin-claude-code-mod

Scope

packages/vitest-plugin-claude-code-mod/src/index.ts (option, ProvidedOptions.declared), its tests and README; a changeset (minor, since a new option).

Acceptance
  • A project that declares userConfig only via the new option gets the same failure text as a package.json project (options do not fit plugin.json userConfig: <Title> must be ...), shown by a test.
  • The README documents the option.
  • A changeset for @kwitsch/vitest-plugin-claude-code-mod exists.
Relations
  • Originating PR: #218
主要语言
TypeScript
星标
0
派生
0
平均合并
29 分钟
30 天内合并 PR
138

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kwitsch/claude-code-plugin-tooling 的其他 Issue

查看 kwitsch/claude-code-plugin-tooling 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。