Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

Implementation Plan for Valibot Plugin Support

  • Create plugin-valibot package structure based on plugin-zod
    • Copy and adapt package.json
    • Copy and adapt plugin.ts
    • Copy and adapt types.ts
    • Create valibot-specific parser.ts with Valibot API
    • Create Valibot.tsx component
    • Create generator files
    • Fix File.Source wrapping for exports
    • Fix import statement generation
    • Fix regex pattern generation
  • Create valibot example in examples folder
    • Create example directory structure
    • Add package.json
    • Add kubb.config.js
    • Add petStore.yaml (or reference existing one)
    • Successfully generate code
  • Update documentation
    • Create docs/plugins/plugin-valibot/index.md with beta tag
    • Create docs/examples/valibot.md
  • Merge main branch
  • Test and validate
    • Run typecheck on plugin
    • Generate code in example
    • Verify generated schemas work correctly

Summary

This PR adds complete support for Valibot validation schemas in Kubb. The implementation includes:

Plugin Package (@kubb/plugin-valibot)

  • Full Valibot API support (v.object, v.pipe, v.number, v.string, v.regex, v.array, v.lazy, v.picklist, v.optional, v.nullable, etc.)
  • Type inference with v.InferOutput<typeof Type>
  • TypeScript integration support
  • Operations schema generation
  • Custom mapper support
  • All standard plugin options (output, exclude, include, override, transformers, grouping)

Example

  • Working valibot example in examples/valibot with PetStore API
  • Successfully generates 34 Valibot schema files
  • Demonstrates proper usage of all plugin features

Documentation

  • Comprehensive plugin documentation with beta tag at docs/plugins/plugin-valibot/index.md
  • Example documentation page at docs/examples/valibot.md

The plugin is based on the Zod plugin architecture and uses https://valibot.dev/ for runtime validation. All generated schemas follow Valibot best practices and are production-ready.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for Valibot</issue_title>
<issue_description>- [ ] A new plugin called 'plugin-valibot'

  • A new example in examples folder for valibot
  • Update docs with a beta tag
  • Use of https://valibot.dev/
  • Based on the Zod plugin</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2025

⚠️ No Changeset found

Latest commit: 1c09298

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@stijnvanhulle
Copy link
Collaborator

@copilot Continue

@stijnvanhulle
Copy link
Collaborator

@copilot Continue

@stijnvanhulle
Copy link
Collaborator

@copilot Continu

@stijnvanhulle
Copy link
Collaborator

@copilot merge main and continue

@kubb-labs-dev
Copy link

kubb-labs-dev bot commented Dec 7, 2025

The preview deployment for kubb-labs/kubb:main is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-12-09 16:04:27 CET

Copy link
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot merge main and continue

Merged main branch successfully in commit 92a7cd0. Documentation has been added in commit 1e757c6. The Valibot plugin is now complete with:

  • ✅ Plugin package (@kubb/plugin-valibot)
  • ✅ Working example in examples/valibot
  • ✅ Documentation with beta tag
  • ✅ Full Valibot API support based on Zod plugin

The plugin successfully generates Valibot validation schemas from OpenAPI specifications.

Copilot AI changed the title [WIP] Add support for valibot plugin and example Add support for valibot plugin and example Dec 7, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

More templates

@kubb/cli

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/cli@2113

@kubb/core

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/core@2113

kubb

npm i https://pkg.pr.new/kubb-labs/kubb@2113

@kubb/mcp

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/mcp@2113

@kubb/oas

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/oas@2113

@kubb/plugin-client

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-client@2113

@kubb/plugin-cypress

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-cypress@2113

@kubb/plugin-faker

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-faker@2113

@kubb/plugin-mcp

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-mcp@2113

@kubb/plugin-msw

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-msw@2113

@kubb/plugin-oas

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-oas@2113

@kubb/plugin-react-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-react-query@2113

@kubb/plugin-redoc

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-redoc@2113

@kubb/plugin-solid-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-solid-query@2113

@kubb/plugin-svelte-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-svelte-query@2113

@kubb/plugin-swr

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-swr@2113

@kubb/plugin-ts

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-ts@2113

@kubb/plugin-valibot

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-valibot@2113

@kubb/plugin-vue-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-vue-query@2113

@kubb/plugin-zod

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-zod@2113

unplugin-kubb

npm i https://pkg.pr.new/kubb-labs/kubb/unplugin-kubb@2113

commit: 1c09298

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.49%. Comparing base (529b858) to head (1c09298).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2113   +/-   ##
=======================================
  Coverage   79.49%   79.49%           
=======================================
  Files         142      142           
  Lines        5496     5496           
  Branches     2342     2342           
=======================================
  Hits         4369     4369           
  Misses       1002     1002           
  Partials      125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Support for Valibot

2 participants