contentlayerdev / contentlayerdev/contentlayer

Runtime config / schema validation

Aperta
#214 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub
meta: never-stale topic: error-handling
Lingua principale
TypeScript
Stelle
3.5k
Fork
192
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Some users (typically users who don't yet use TypeScript) are running into problems due to misconfigurations of their Contentlayer config (especially in regards to the content schema). Additionally to the safety provided by TypeScript, we should also implement a runtime validation step to avoid undefined runtime errors.

## Technical notes

Ideally we should figure out a way how to derive [Zod](https://github.com/colinhacks/zod)-like validation logic based on the existing TypeScript definitions. We could also investigate to use [TS+](https://github.com/ts-plus) for this.

## Related issues

- https://github.com/contentlayerdev/contentlayer/issues/193

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.