Problem
TypeScript cannot see the .db property on Zod schemas:
import { z, table } from "@b9g/zen";
const Users = table("users", {
id: z.string().db.primary(), // TS2339: Property 'db' does not exist on type 'ZodString'
});
Runtime works fine because extendZod(z) adds the property dynamically.
Root Cause
The build tool (libuild) is not correctly handling:
.d.ts file paths - references ./impl/table.js which doesn't exist in published package
- Module augmentations -
declare module "zod" is missing from output
Upstream issue: bikeshaving/libuild#1
Workaround
None currently. Users must use // @ts-ignore or as any casts.
Priority
P1 - Core TypeScript functionality is broken.