[bug]: init uses RC versions and disables TypeScript for design-system v2
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
Línea de trabajo
Start with src/cli/commands/plugin/init/action.ts and src/cli/commands/plugin/init/files/admin.ts, especially the marked TODO sections. Run npx @strapi/sdk-plugin@latest init and inspect the generated package versions and admin/custom.d.ts. Done means the init path no longer causes unintended RC use or suppresses design-system type errors, with the intended behavior verified.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What version of design-system are you using?
v2
What's Wrong?
see this issue in the strapi project
When using the plugin init command, the SDK pulls in the release candidate (RC) version of @strapi/design-system, and at the same time disables TypeScript type checking by generating a custom.d.ts file that declares the entire module. This makes VSCode silently accept incorrect imports and breaks type safety.
Using
npx @strapi/sdk-plugin@latest init
It automatically sets up the plugin to use Design System V2 (RC). Specifically, in @strapi/sdk-plugin src/cli/commands/plugin/init/action.ts, there's this line:
// TODO: remove these when release versions are available
const USE_RC_VERSIONS: string[] = ['@strapi/design-system', '@strapi/icons'] as const;
This causes it to pull the RC (v2) versions of those packages.
Additionally, in the same package at src/cli/commands/plugin/init/files/admin.ts, it generates a custom.d.ts file using the following:
{
/**
* TODO: remove this when we release design-system V2
*/
name: 'admin/custom.d.ts',
contents: outdent`
declare module '@strapi/design-system/*';
declare module '@strapi/design-system';
`,
},
This effectively disables TypeScript support for the design system, which explains why VSCode didn’t catch my incorrect imports :(
To Reproduce
Run:
npx @strapi/sdk-plugin@latest init
Try using a design-system component with a wrong import, VSCode won’t show an error because types are completely bypassed.
Expected Behaviour
- Either avoid using RC versions by default (unless explicitly opted in).
- Or at least don’t disable type checking by generating a custom.d.ts that declares wildcard modules.
- Ideally, wait until design-system v2 is stable before switching defaults in the SDK.
- Lenguaje dominante
- TypeScript
- Estrellas
- 24
- Forks
- 13
- Merge medio
- 5 d 3 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de strapi/sdk-plugin
-
Dificultad 4/5 Medio día Aptitud para principiantes 15/100
strapi/sdk-plugin#244 ·
Los mantenedores suelen responder en 6 días
-
[bug]: build ignores exports file names and package.json#type, breaking "type": "module" pluginsPosiblemente ocupada @unrevised6419 la tomó hace 44 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
strapi/sdk-plugin#242 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
strapi/sdk-plugin#241 ·
Los mantenedores suelen responder en 6 días
-
[feat]: build a subset of bundles with --bundle, for per-bundle task cachingPosiblemente ocupada @unrevised6419 la tomó hace 51 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
strapi/sdk-plugin#238 ·
Los mantenedores suelen responder en 6 días
-
[bug]: When building with latest sdk-plugin version, I loose sub folders typesQuizá libre de nuevo @jhoward1994 la tomó hace 247 días y no hay ningún pull request abierto. Abiertoissue: bug
strapi/sdk-plugin#115 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 6 días
Todos los issues de strapi/sdk-plugin
Issues similares
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/DebateAI#801 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
ci: repo has no GitHub Actions workflow, so pushes and pull requests are never built or testedAbiertoagents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Add: BOM CineAbiertoapproved check:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día