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

Abierto Apto para principiantes
#219 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
74/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
testing

Línea de trabajo

Empieza por packages/vitest-plugin-claude-code-mod/src/index.ts y sus pruebas para ver cómo se lee userConfig de package.json y cómo la validación de opciones informa de los errores. Añade cobertura para las declaraciones proporcionadas únicamente mediante la opción propuesta, usando el texto de error existente; actualiza el README y añade un changeset de tipo minor. El trabajo estará terminado cuando la prueba, la documentación y el changeset cumplan los criterios de aceptación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
TypeScript
Estrellas
0
Forks
0
Merge medio
29 min
PR fusionados (30 d)
138

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de kwitsch/claude-code-plugin-tooling

Todos los issues de kwitsch/claude-code-plugin-tooling

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.