Migrate zod v3 to v4#269
Merged
Merged
Conversation
lilnasy
commented
Oct 27, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the codebase from Zod v3 to v4 to maintain compatibility with Directus 11.10.2+, which upgraded to Zod v4. The migration addresses breaking API changes in Zod v4's validation schema structure and error handling.
Key Changes:
- Updated Zod API calls to match v4 syntax (
invalid_enum_value→invalid_value,errorMap→error, etc.) - Moved Zod from dependencies to peerDependencies to ensure version compatibility with Directus
- Updated TypeScript configuration to support Zod v4's module resolution requirements
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/command-palette-module/tsconfig.json | Updated lib and moduleResolution for Zod v4 compatibility |
| packages/command-palette-module/src/utils/errors.ts | Migrated error handling from v3 (invalid_enum_value, options) to v4 (invalid_value, values) |
| packages/command-palette-module/src/types.ts | Updated Zod schema syntax: errorMap → error, type casting for nullable/optional, added recentSearchLimit |
| packages/command-palette-module/package.json | Moved zod to peerDependencies, added vue-tsc for type checking |
| packages/collaborative-editing/src/module/utils/errors.ts | Migrated error handling to Zod v4 API |
| packages/collaborative-editing/src/module/settings-fields.ts | Fixed quote escaping in string |
| packages/collaborative-editing/package.json | Moved zod to devDependencies, reordered dependencies alphabetically |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could we take a look at merging this PR? |
bryantgillespie
left a comment
Contributor
There was a problem hiding this comment.
Works fine for me locally. Only a few questions on this...
bryantgillespie
approved these changes
Feb 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
pnpm packinside a docker container.zodto peer dependencies to make package managers perform a compatibilty check with Directus.Before
docker runAfter (see "Loaded extensions")
docker run