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

Offen Anfängerfreundlich
#219 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
74/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
testing

Rechercherichtung

Beginne mit packages/vitest-plugin-claude-code-mod/src/index.ts und den zugehörigen Tests, um zu sehen, wie userConfig aus package.json gelesen wird und wie die Optionsvalidierung Fehler meldet. Ergänze Tests für Deklarationen, die nur über die vorgeschlagene Option bereitgestellt werden, und verwende dabei den bestehenden Fehlertext; aktualisiere die README und füge einen Changeset für eine Minor-Version hinzu. Die Aufgabe ist abgeschlossen, wenn der Test, die Dokumentation und der Changeset die Akzeptanzkriterien erfüllen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
TypeScript
Sterne
0
Forks
0
Ø Merge
29 Min.
Gemergte PRs (30 T.)
138

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus kwitsch/claude-code-plugin-tooling

Alle Issues in kwitsch/claude-code-plugin-tooling

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.