Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[drizzle-valibot]: Update for valibot 0.31.0+ #2860

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

camflan
Copy link

@camflan camflan commented Aug 27, 2024

This PR picks up from #2481, brings it up to the latest main changes to resolve issues with Valibot 0.31.0+

Fixes #2521

Also addresses,

  • failing lint on drizzle-orm. This was caused by an invalid comment symbol in the command, used to disable another command. (Was // # lint instead of # lint)
  • failing build step on typebox, valibot, and zod validation adapters. The build commands were using an older version of tsx specified by local deps, not the version of tsx which is specified at the top-level package.json

@camflan camflan changed the title Update drizzle-valibot for valibot 0.31.0+ [drizzle-valibot]: Update for valibot 0.31.0+ Aug 27, 2024
@fabian-hiller
Copy link

Happy to help if there are any questions about Valibot!

@camflan
Copy link
Author

camflan commented Aug 28, 2024

Would love some eyes on this @drizzle-team @dankochetov @AndriiSherman @AlexBlokh

@CestDiego
Copy link

Is this something we can just use to patch drizzle? :)

@saturnonearth
Copy link

saturnonearth commented Sep 12, 2024

I tried patching but was getting some errors when using forwarding such as...

const itemSchema = v.pipe(
  v.omit(
    v.object({
      ...createInsertSchema(items, {
        groups: v.optional(v.array(group), [])
      }).entries,
      tags: v.optional(v.array(tagSchema), [])
    }),
    ['createdAt', 'updatedAt']
  ),
  v.forward(
    v.partialCheck(
      [
        ['groups']
      ],
      (input) => new Set(input.groups.map((p) => p.label)).size === input.groups.length,
      'Group labels must be unique'
    )
  )
);

@Hugos68
Copy link

Hugos68 commented Sep 26, 2024

Any progress on this? It's been idle for a while

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.

[BUG]: drizzle-valibot does not provide types for returned schemas
5 participants