Skip to content

Valibot support - #62

Merged
mmkal merged 9 commits into
mainfrom
valibot
Mar 19, 2025
Merged

mmkal merged 9 commits into
mainfrom
valibot

Conversation

@mmkal

@mmkal mmkal commented Mar 19, 2025 •

Copy link
Copy Markdown
Owner

Follow on to #59 - this adds valibot support. Satisfyingly easy now that the only requirement is json schema conversion. Others have done the hard work!

Notes:

  • requires @valibot/to-json-schema installed. if not detected valibot schemas will require raw json input (and output helptext explaining how to get richer inputs)
  • @valibot/to-json-schema throws when v.pipe(...) usage is detected, so there's a custom preprocessor that takes advantage of how slim and simple valibot schemas are - it just walks the "schema" object and swaps .pipe arrays with only the first element and metadata elements. I think this is safe but raised an issue against valibot: to-json-schema: support piped types open-circle/valibot#1090

@pkg-pr-new

pkg-pr-new Bot commented Mar 19, 2025 •

Copy link
Copy Markdown

Open in Stackblitz

pnpm add https://pkg.pr.new/mmkal/trpc-cli@62

commit: 3218354

@mmkal
mmkal merged commit 7b8be67 into main Mar 19, 2025
@mmkal
mmkal deleted the valibot branch March 19, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant