[Validators] Export BuildSchema
type and simplify JSON schema
#3944
+10
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #3732 & #3869.
Branched off of #3852.
Fixed the
The inferred type of X cannot be named without a reference to ../../../../../node_modules/drizzle-zod/schema.types.internal.mjs
error for all validator packages. Using @slimshreydy's reproduction repo, I managed to fix it by going intonode_modules
and exportingBuildSchema
type. This PR exports this so you don't have to manually do what was described prior.Breaking for some users
Depending on the tsconfig.json, it seems that recursive types causes some issues. The only recursive type in these packages is the default JSON schema. I've simplified the definition to make it more accessible. Most developers override this field anyways, but it is important to note this change.