From c4c904423c9b1f6c4d862cb77c12add1eb7e7156 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 11 Jul 2024 20:11:51 +0200 Subject: [PATCH] fix(core): #131 type error if declaration is set to true in tsconfig Do now show type errors on defineConfig, if declaration is set to true in the tsconfig. We export all zod types to fix the type error. See https://github.com/microsoft/TypeScript/issues/42873 --- .changeset/few-stingrays-bow.md | 5 +++++ packages/core/src/config.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/few-stingrays-bow.md diff --git a/.changeset/few-stingrays-bow.md b/.changeset/few-stingrays-bow.md new file mode 100644 index 00000000..57dfbd52 --- /dev/null +++ b/.changeset/few-stingrays-bow.md @@ -0,0 +1,5 @@ +--- +"@content-collections/core": patch +--- + +Do now show type errors on defineConfig, if declaration is set to true in the tsconfig. diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index ffe2a6aa..367205d5 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -4,6 +4,11 @@ import { Parser, Parsers } from "./parser"; import { CacheFn } from "./cache"; import { NotSerializableError, Serializable } from "./serializer"; +// Export all zod types to fix type errors, +// if declaration is set to true in tsconfig.json. +// @see https://github.com/microsoft/TypeScript/issues/42873 +export type * from "zod"; + export type Meta = { filePath: string; fileName: string;