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

Open Beginner friendly
#219 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
testing

Research direction

Start with packages/vitest-plugin-claude-code-mod/src/index.ts and its tests to see how userConfig is read from package.json and how option validation reports failures. Add coverage for declarations supplied only through the proposed option, matching the existing failure text; update the README and add a minor changeset. Done when the test, documentation, and changeset meet the acceptance criteria.

Written by the indexing model from the issue text.

Description

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
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
29m
Merged PRs (30d)
138

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kwitsch/claude-code-plugin-tooling

All issues in kwitsch/claude-code-plugin-tooling

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.