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

Aperta Adatta ai principianti
#219 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

Inizia da packages/vitest-plugin-claude-code-mod/src/index.ts e dai relativi test per vedere come viene letto userConfig da package.json e come la convalida delle opzioni segnala gli errori. Aggiungi test per le dichiarazioni fornite solo tramite l’opzione proposta, usando il testo di errore esistente; aggiorna il README e aggiungi un changeset di tipo minor. Il lavoro è completato quando il test, la documentazione e il changeset soddisfano i criteri di accettazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
0
Fork
0
Merge medio
29m
PR unite (30g)
138

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kwitsch/claude-code-plugin-tooling

Tutte le issue di kwitsch/claude-code-plugin-tooling

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.