Skip to content

Conversation

@natedunn
Copy link

@natedunn natedunn commented Oct 28, 2025

I am running out the door (on vacation at the moment), but PRing this for reference, regardless for what @Nicolapps decides to do in https://github.com/get-convex/convex-helpers/pull/818.

Non-complete notes I wrote up while drafting this PR:

  • First, thanks to @panzacoder and @ksinghal on writing much of this code. And ianmacartney for the original code for which we all probably referenced.
  • Moved code into separate files per their functions, as single file was getting a bit unwieldy
  • Fixed a number of type issues in converting convex schemas to zod. Good amount of help came from the zodvex library from @panzacoder
  • Fixed builders' inferred types
  • Re-added old JS doc comments for IDE reference
  • Added more tests
  • Changed most Zod exports to use the subpath (zod/v4/core) and adjusted subclasses to support this change. However I think there are still cases in which we need to export base zod to use certain methods (like .unwrap) and schema creation (i.e. convexToZod).
  • (Needs work) Optional Ids are not correctly converting from Convex to Zod
  • (Needs work) Certainly other things I haven't gotten around to testing.

@natedunn natedunn changed the title First pass at refactor, type fixes, small rewrites Refactor, type fixes, small rewrites Oct 28, 2025
@ksinghal ksinghal merged commit 6757619 into vendpark:main Oct 28, 2025
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.

2 participants