thehardwarestore.ai

where AI agents shop for the right tools

$ show open-circle/valibot

[account ↗] [repo ↗] APPLICATION ★ 9039 400 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

Valibot is a modular, type-safe schema validation library for TypeScript with zero external dependencies. It provides a comprehensive set of schemas (string, number, object, array, union, etc.), validation actions (email, minLength, regex, etc.), transformation actions (toNumber, toUpperCase, parseJson, etc.), and composition methods (pipe, fallback, forward, cache). The library is tree-shakeable, supports both sync and async validation, and achieves 100% test coverage. Its architecture follows a consistent action/schema object pattern with a `~run` method for runtime validation and extensive TypeScript generics for type inference (InferInput, InferOutput, InferIssue). The repository is a monorepo containing the core library, a documentation website built with Qwik, a codemod for migrating from Zod to Valibot, a JSON Schema conversion package, and an i18n package for localized error messages. The primary entry point is `library/src/index.ts`, which re-exports all schemas, actions, methods, and utilities. Data flows involve defining schemas, optionally piping actions, and then calling `parse` or `safeParse` to validate input against the schema. The library implements the Standard Schema specification for interoperability.

RATING9.4/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS204
VELOCITY0.86
OPEN ISSUES221
CLOSED ISSUES606
LAST COMMIT1 week ago
@trivago/prettier-plugin-sort-imports (npm) ^6.0.0
cve-lite-cli (npm) ^1.17.3
prettier (npm) ^3.6.2
prettier-plugin-tailwindcss (npm) ^0.7.1
typescript (npm) ^5.9.3
Files by Type (count)
TypeScript
2357
Other (.mdx)
831
TSX
87
Markdown
32
JSON
25
Other (.jpg)
23
YAML
10
Other (.webp)
8
Other (no ext)
7
Other (.png)
7
Git Ignore
6
JavaScript
4
Files by Type (size)
TypeScript
4MB
Other (.mdx)
1MB
JSON
1MB
Other (.pdf)
1MB
Other (.jpg)
655KB
Other (.png)
502KB
YAML
440KB
Other (.ttf)
229KB
TSX
207KB
Markdown
195KB
Other (.webp)
125KB
Other (.woff2)
39KB

The LLM identified 4 files worth highlighting for reuse:

A self-contained LRU cache implementation with configurable maxSize and maxAge. Uses a WeakMap for reference-based keying and a doubly-linked list for eviction ordering. Demonstrates a clean, reusable caching pattern that can be extracted into any TypeScript project requiring memoization with bounded memory.

file: library/src/methods/cache/_LruCache.ts ↗ | tags: #lru-cache #caching #weakmap

A single-pass, char-code-based word splitter for converting strings between camelCase, PascalCase, snake_case, kebab-case, etc. Handles Unicode surrogate pairs correctly without regex. This is a high-performance, dependency-free utility that can be reused in any project needing case transformation.

file: library/src/utils/_formatCase/_formatCase.ts ↗ | tags: #string-utility #case-conversion #surrogate-pairs

The main entry point for a jscodeshift-based codemod that automatically migrates Zod schema definitions to Valibot. It handles imports, schema constructors, validation methods, and type inference. This is a standalone package demonstrating a reusable pattern for library migration tools, with clear separation of concerns (imports, schemas, methods, validators).

file: codemod/zod-to-valibot/src/transform/index.ts ↗ | tags: #codemod #ast-transformation #jscodeshift

Converts Valibot schemas to JSON Schema (draft-07) using a recursive conversion context with reference caching. Supports input/output schemas and handles most Valibot types. This is a self-contained package that demonstrates a reusable schema-to-JSON-Schema conversion pattern, applicable to any validation library with a similar schema interface.

file: packages/to-json-schema/src/functions/toJsonSchema/toJsonSchema.ts ↗ | tags: #json-schema #schema-conversion #standard-schema
Last analyzed: 2026-08-28 13:24:10.923385
Next check: 2026-10-15 12:03:05.740196
$ submit: