Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

feat: add Valibot validation schemas - #90

Merged
BYK merged 3 commits into
mainfrom
valibot-validators
Aug 6, 2026
Merged

BYK merged 3 commits into
mainfrom
valibot-validators

Conversation

@BYK

@BYK BYK commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds Valibot runtime schemas while keeping Zod and dependency-free consumers supported through separate package entry points.

  • @sentry/api remains a zero-runtime-dependency client with pure TypeScript types.
  • @sentry/api/valibot exposes generated Valibot 1 schemas.
  • @sentry/api/zod keeps its existing Zod 3 schema contract.
  • valibot and zod are optional peer dependencies, so consumers install neither, either, or both.
  • Validator bundles externalize their own peer and never pull the other validator into an application.

Usage

import * as v from "valibot";
import { vGetProjectResponse } from "@sentry/api/valibot";

const project = v.parse(vGetProjectResponse, input);
import { zGetProjectResponse } from "@sentry/api/zod";

const project = zGetProjectResponse.parse(input);

Testing

  • bun run build
  • bun run typecheck
  • bun test: 103 passing
  • Packed-package compatibility checks:
    • root package with neither validator installed
    • root package with Zod 3 and Valibot 0 already installed
    • Valibot entry runtime and declarations with Valibot 1.4.2
    • Zod entry runtime and declarations with Zod 3.24.0

The Valibot optional peer uses a wildcard because npm applies peer constraints to the whole package, including consumers that never import @sentry/api/valibot. The Valibot entry itself requires Valibot 1.

@BYK
BYK merged commit 0886104 into main Aug 6, 2026
9 checks passed
@BYK
BYK deleted the valibot-validators branch August 6, 2026 17:47
@betegon betegon mentioned this pull request Nov 5, 2026
8 of 39 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant