-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The published package has broken TypeScript types:
-
.d.tsfiles reference non-existent paths - The generatedzen.d.tsimports from./impl/table.js,./impl/database.js, etc., but theimpl/directory doesn't exist in the published package (JS is bundled, but type paths aren't updated). -
Module augmentations are missing - The
declare module "zod"augmentation in source files is not included in the published types.
Evidence
Published zen.d.ts:
export { table, ... } from "./impl/table.js"; // This path doesn't existPublished directory structure:
dist/src/
├── zen.d.ts # references ./impl/*.js
├── zen.js # bundled, works fine
└── (no impl/ directory)
Source has module augmentation that's missing from output:
// src/impl/table.ts
declare module "zod" {
interface ZodType<out Output, out Input, out Internals> {
readonly db: ZodDBMethods<this>;
}
}Impact
- TypeScript users get errors like
Property 'db' does not exist on type 'ZodNumber' - Runtime works fine (extendZod() adds properties dynamically)
- Types are completely broken for consumers
Expected Behavior
Either:
- Roll up all
.d.tsinto a single bundled declaration file with correct paths - Or preserve the
impl/directory structure for type files - And ensure
declare moduleaugmentations are included in output
Workaround
Currently none - consumers must use // @ts-ignore or skip type checking for zen imports.
Priority
P1 - Package is unusable for TypeScript users despite being a TypeScript-first library.
Metadata
Metadata
Assignees
Labels
No labels