Skip to content

feat: add valibot addon#1157

Open
sacrosanctic wants to merge 8 commits into
sveltejs:mainfrom
sacrosanctic:empirical-fox
Open

feat: add valibot addon#1157
sacrosanctic wants to merge 8 commits into
sveltejs:mainfrom
sacrosanctic:empirical-fox

Conversation

@sacrosanctic

Copy link
Copy Markdown
Contributor

Closes #1152

Description

I don't know what test to write.

Removed write guards for demo paths. We already warn on dirty and they're demos, not real code.

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 18a64f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Minor

Not sure what this means? Click here to learn what changesets are.

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

homepage: 'https://valibot.dev',
options: {},
run: ({ sv }) => {
sv.devDependency('valibot', '^1.4.1');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you saw my note in the ticket early enough. In the maintainers meeting it was brought up that the addon would basically be a one liner as displayed here and therefore making it an addon would be an overstatement.

The idea was to make that a question during create, since you will always be capable of adding on line to your package.json by hand. Honestly, IMHO I wouldn't even bother asking a question and just always add it. But maybe @jycouet has an opinion here as well.

Most of your PR is still valid though and can probably stay unchanged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did see your msg, but it seems I have misinterpreted it.

IMHO I wouldn't even bother asking a question and just always add it

I am also in favour of not asking. But that seems a bit too opinionated considering standard-schema allows for different validation libraries. Users shouldn't have to reverse what the CLI has done. So I made it optional.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we keep it this way we would need to ensure that better-auth runs after valibot by running runsAfter('valibot') in better-auth's setup.

I'm still not convinced what is the right forward here:

  1. optional addon (as of now)
  2. question during create
  3. no question during create

I do get your point about the different libs. However we have used valibot everywhere (docs, demos, etc). But yes, users might have other choices.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the rolling back code problem, my original idea was to provide a list of validators. But that added maintenance burden to the CLI team and opted for this instead.

Side note: It would be nice if validation libraries create their own community addon and users can select it from a list within the CLI.

You can discuss this again in the next maintainers meeting.

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.

add an option for validation library

2 participants