Skip to content

Conversation

@xcfox
Copy link
Contributor

@xcfox xcfox commented Apr 16, 2025

No description provided.

@xcfox xcfox linked an issue Apr 16, 2025 that may be closed by this pull request
@xcfox xcfox added enhancement New feature or request documentation Improvements or additions to documentation labels Apr 16, 2025
@xcfox xcfox self-assigned this Apr 16, 2025
@xcfox
Copy link
Contributor Author

xcfox commented Apr 18, 2025

Support for Zod v4 is included in @gqloom/zod version 0.9.0-beta.0.

Install using the next tag:

# Using npm
npm install zod@next @gqloom/zod@next

# Using yarn
yarn add zod@next @gqloom/zod@next

# Using pnpm
pnpm add zod@next @gqloom/zod@next

@xcfox
Copy link
Contributor Author

xcfox commented Apr 18, 2025

This PR is planned to be merged after Zod v4 is released as the main version.

@xcfox xcfox linked an issue Apr 18, 2025 that may be closed by this pull request
@colinhacks
Copy link

This looks great!

@xcfox xcfox added the Zod label Apr 29, 2025
@colinhacks
Copy link

Update: the @zod/core package has been abandoned in favor of a subpath: zod/v4/core. This makes it much easier for libraries with build on top of Zod with a single peer dependency on "zod". The reasons for this change are explained in more detail in the beta announcement: https://v4.zod.dev/v4

Here's a dedicated guide for library authors that answers some common questions: https://v4.zod.dev/library-authors

  1. Best practices around peer dependencies
  2. How to support Zod v3 and Zod v4 simultaneously
  3. How to support Zod & Zod Mini without extra work

xcfox and others added 7 commits May 21, 2025 16:37
- Bumped version of @gqloom/core from 0.9.0 to 0.9.1 and @gqloom/drizzle from 0.9.1 to 0.9.3 in pnpm-lock.yaml.
- Updated zod dependency to version 3.25.17 in package.json and adjusted peer dependencies accordingly.
- Changed module resolution strategy in tsconfig.json from "node" to "bundler".
- Refactored imports in zod package files to use the new zod version structure.
- Introduced ZodWeaver class to facilitate the conversion of Zod schemas into GraphQL types.
- Added utility functions for handling object, field, enum, and union types in GraphQL.
- Implemented metadata registration functions for GraphQL object types and fields.
- Enhanced type safety and integration with GraphQL by defining various configuration interfaces.
- Added comprehensive tests to validate the functionality of the ZodWeaver and its utilities.
- Updated getGraphQLType method to handle both v4 and v3 Zod schemas.
- Added a test case to validate the integration of v3 schema handling.
- Refactored printZodSilk function to improve type safety with updated parameter types.
- Introduced separate entry points for v3 schemas in package.json to support v3 module imports.
- Updated tsup configuration to include v3 source file for building, enhancing modularity and compatibility.
- Changed zod dependency version from 4.0.0-beta to 3.25.17 in package.json and pnpm-lock.yaml.
- Updated installation instructions in both English and Chinese documentation to reflect the new zod version.
- Removed references to the beta version and adjusted related code snippets for consistency with the stable version.
@xcfox xcfox marked this pull request as ready for review May 21, 2025 18:54
@xcfox xcfox merged commit 6bceb41 into modevol-com:main May 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request Zod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Zod 4 (now in beta) Zod v4

2 participants