protoc-gen-pvschema-ts
  • Docs

Valibot and Zod schemas from protovalidate rules

protoc-gen-pvschema-ts is a protoc plugin. It reads the buf.validate rules in your .proto files and generates schemas for form validation in a frontend.

Getting startedIntroduction

Small in the browser

A generated Valibot schema added 2.6 KB after gzip in our measurement. The protovalidate runtime added 81 KB.

Messages from your schema library

The schemas use the standard actions of Valibot and Zod, so their locales and message overrides apply.

Checked against protovalidate

The tests run the same values through the generated schemas and through protovalidate, and record each difference.

Documentation

Getting started

Add the plugin to buf.gen.yaml and generate a schema.

Live example

Try a form that validates with the generated schemas.

Rule mapping

Which protovalidate rule becomes which Valibot or Zod check.

Form libraries

Guides for react-hook-form, TanStack Form, and Formisch.