contentlayerdev / contentlayerdev/contentlayer

Runtime config / schema validation

未关闭
#214 3 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
meta: never-stale topic: error-handling
主要语言
TypeScript
星标
3.5k
派生
192
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。