velite
velite copied to clipboard
Differentiate errors and warnings in `strict` mode.
const { build } = await import('velite');
await build({ strict: ... });
With strict: true, both warnings and errors in the schema terminate the build and make build throw.
With strict: false, both warnings and errors are logged, but build process is not terminated, and build finishes gracefully, without any suggestion in the return value that something went wrong.
There should be a way to tell velite to throw on errors but continue on warnings.
Use case: Make velite throw if a blog post is missing a title, but just give a warning if the same post has a value enabled even though the prerequisites are not met (i.e. tocEnabled is true but s.toc() created empty table of content).