-
Notifications
You must be signed in to change notification settings - Fork 45
feat(server): Add comprehensive Zod v4 integration #665
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
Open
gunta
wants to merge
9
commits into
get-convex:main
Choose a base branch
from
gunta:feature/server-zod-v4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,493
−2
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e7b5cfa
feat(server): add comprehensive Zod v4 integration
gunta fe73716
refactor: Update Zod v4 implementation based on feedback
gunta 0367c50
refactor: Remove all V4 identifiers from zodV4 exports
gunta 80ca01d
fix: Update zodV4 examples to use correct API
gunta 635a601
chore: Remove CLAUDE.md per PR review
gunta bb34cbc
fix: Address PR feedback for zodV4 implementation
gunta d80ae13
feat: Embrace Zod v4 fully with all new features
gunta 9f35157
fix: Use stable Zod imports instead of beta
gunta 17316df
fix: Correctly use zod/v4 subpath imports
gunta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# CLAUDE.md | ||
|
||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
||
## Commands | ||
|
||
### Development | ||
- `npm install` - Install all dependencies | ||
- `npm run dev` - Start full development environment (backend + frontend + helpers watch) | ||
- `npm run build` - Build the convex-helpers package | ||
- `npm test` - Run all tests | ||
- `npm run test:watch` - Run tests in watch mode | ||
- `npm run lint` - Run TypeScript type checking and Prettier format check | ||
- `npm run format` - Auto-format code with Prettier | ||
|
||
### Testing | ||
- `npm test -- path/to/test.ts` - Run a specific test file | ||
- `npm run test:coverage` - Run tests with coverage report | ||
- `npm run testFunctions` - Run Convex function tests against local backend | ||
|
||
### Publishing | ||
- `npm run alpha` - Publish alpha release | ||
- `npm run release` - Publish stable release | ||
|
||
## Architecture | ||
|
||
This is a TypeScript monorepo providing helper utilities for Convex applications: | ||
|
||
- **Main Package**: `/packages/convex-helpers/` - Published npm package | ||
- `/server/` - Server-side utilities (custom functions, relationships, migrations, etc.) | ||
- `/react/` - React hooks and providers | ||
- `/cli/` - CLI tools for TypeScript/OpenAPI generation | ||
|
||
- **Example App**: Root directory contains example Convex backend and React frontend | ||
- `/convex/` - Example Convex functions | ||
- `/src/` - Example React application | ||
|
||
## Key Patterns | ||
|
||
### Custom Functions | ||
Wrap Convex primitives with authentication and context injection: | ||
```typescript | ||
import { customQuery } from "convex-helpers/server/customFunctions"; | ||
``` | ||
|
||
### Zod Validation | ||
Use `zod` for runtime validation with type inference: | ||
```typescript | ||
import { zodToConvex } from "convex-helpers/server/zod"; | ||
``` | ||
|
||
### Testing | ||
Use `ConvexTestingHelper` for testing Convex functions: | ||
```typescript | ||
import { ConvexTestingHelper } from "convex-helpers/testing"; | ||
``` | ||
|
||
### Development Workflow | ||
1. The package is symlinked for live development | ||
gunta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. Changes to helpers trigger automatic rebuilds via chokidar | ||
3. TypeScript strict mode is enforced | ||
4. All code must pass Prettier formatting | ||
|
||
## Important Notes | ||
|
||
- This library extends Convex functionality - always check if Convex has native support first | ||
- Many utilities have optional peer dependencies (React, Zod, Hono) | ||
- Server utilities are framework-agnostic and work with any client | ||
- Tests run in different environments: `edge-runtime` for server, `jsdom` for React | ||
- The example app demonstrates usage patterns for most utilities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.