How open-circle/valibot works
Valibot is a modular, type-safe schema library: users define schemas, then validate unknown data to obtain typed output or structured validation results. Its runtime includes schema definitions, validation and transformation actions, and parse interfaces; the README also highlights static type inference and synchronous safe-parse/type-guard APIs. The repository additionally contains Zod-to-Valibot and version-migration codemods, plus a documentation worker that serves Markdown and MCP requests. Source excerpts were limited, so links between unsampled components are omitted.
Main entry points: worker/index.ts Docs worker · parserAsync.ts Async parser · safeParserAsync.ts Async safe parser · src/index.ts Typed results
Components 14
Validation library
- Schema definitions
library/src/index.ts - Validation actions
library/src/index.ts - Async parser
library/src/methods/parser/parserAsync.ts - Async safe parser
library/src/methods/safeParser/safeParserAsync.ts - Typed results
library/src/index.ts
Migration tools
- Zod converter CLI
codemod/zod-to-valibot/cli.mjs - Zod transforms
codemod/zod-to-valibot/src/transform/index.ts - Version migration
codemod/migrate-to-v0.31.0/src/index.ts
Documentation delivery
- Docs worker
website/worker/index.ts - Static assets
- Markdown delivery
- MCP endpoint
Other components
- Application code
- Documentation visitor
Connections 9
- Application code → Schema definitions: defines
- Application code → Async parser: parses data
- Application code → Async safe parser: safe parses
- Async parser → Typed results: returns output
- Async safe parser → Typed results: returns result
- Documentation visitor → Docs worker: requests content
- Docs worker → MCP endpoint: dispatches MCP
- Docs worker → Markdown delivery: serves Markdown
- Docs worker → Static assets: fetches assets