@vectorfyco/valbridge-zod-extractor
v1.1.0
Published
Workspace-local Zod extraction utilities for valbridge
Downloads
664
Maintainers
Readme
Extract valbridge-compatible schema data from existing Zod schemas for high-fidelity Pydantic generation.
Installation
npm install @vectorfyco/valbridge-zod-extractor zod
# or
pnpm add @vectorfyco/valbridge-zod-extractor zodCLI usage
valbridge-zod-extractor \
--module-path ./schema/user.js \
--export-name UserSchemaOutput is JSON with:
schema-- the extracted JSON Schema documentdiagnostics-- compatibility diagnostics for unsupported Zod features or versions
Programmatic usage
import { extractSchema } from "@vectorfyco/valbridge-zod-extractor";
import { z } from "zod";
const UserSchema = z.object({
id: z.string(),
email: z.string().email()
});
const result = extractSchema(UserSchema);
console.log(result.schema);Key behaviors
- Validates the supported Zod version before extraction
- Preserves
x-valbridgeannotations needed by downstream adapters (Pydantic, future targets) - Emits diagnostics for Zod features that cannot be represented in JSON Schema
Related packages
| Package | Purpose |
| --- | --- |
| @vectorfyco/valbridge-zod | Zod adapter (JSON Schema to Zod) |
| @vectorfyco/valbridge-core | Core IR and JSON Schema parser |
| valbridge-pydantic-extractor | Python equivalent for Pydantic models |
