Use Zod 4 JSON schema generation - #267
Merged
Ian Clanton-Thuon (iclanton) merged 1 commit intoAug 12, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Ian Clanton-Thuon (iclanton)
August 12, 2026 15:09
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Copilot component templates/examples to Zod 4 and switches JSON schema generation to Zod’s native toJSONSchema() API, removing the direct zod-to-json-schema dependency and aligning the repo on a single Zod version.
Changes:
- Replaced
zod-to-json-schemausage withpropertiesSchema.toJSONSchema()in Copilot component templates and examples. - Updated template/example dependencies to
zod@^4.4.3and removed directzod-to-json-schemadependencies. - Updated Rush common versions / lockfiles to reflect the single Zod version across the repo.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| templates/copilot-component-react/src/{componentName.pascal}Properties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| templates/copilot-component-react/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| templates/copilot-component-noframework/src/{componentName.pascal}Properties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| templates/copilot-component-noframework/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| templates/copilot-component-minimal/src/{componentName.pascal}Properties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| templates/copilot-component-minimal/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| examples/copilot-component-react/src/SampleProperties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| examples/copilot-component-react/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| examples/copilot-component-noframework/src/NoFrameworkProperties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| examples/copilot-component-noframework/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| examples/copilot-component-minimal/src/MinimalProperties.ts | Switch JSON schema export to Zod 4 toJSONSchema() and remove zod-to-json-schema import. |
| examples/copilot-component-minimal/package.json | Remove zod-to-json-schema; bump Zod to ^4.4.3. |
| common/config/rush/repo-state.json | Update Rush repo state hash for the lockfile change. |
| common/config/rush/pnpm-lock.yaml | Update lockfile to Zod 4.4.3 and remove the Zod 3.x entries used by templates previously. |
| common/config/rush/common-versions.json | Remove the preferred-version pinning/comments for Zod 3.x now that templates are on Zod 4. |
| common/changes/@microsoft/spfx-cli/main_2026-08-12-14-49-33.json | Add Rush change file (type none, empty comment). |
| apps/spfx-cli/package.json | Align CLI dependency on Zod to ^4.4.3. |
| api/spfx-template-api/package.json | Align template API dependency on Zod to ^4.4.3. |
Files not reviewed (1)
- common/config/rush/pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Ian Clanton-Thuon (iclanton)
enabled auto-merge (squash)
August 12, 2026 15:42
svalenciasan
approved these changes
Aug 12, 2026
Ian Clanton-Thuon (iclanton)
merged commit Aug 12, 2026
6ee265f
into
SharePoint:main
4 checks passed
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.
Description
Migrates the Copilot component templates and examples to Zod 4 and uses Zod's native
toJSONSchema()API. This removes thezod-to-json-schemadependency and allows the repository to use a single Zod version.How was this tested?
rush build --to @microsoft/spfx-cli --to @microsoft/spfx-template-api --to @spfx-template/copilot-component-minimal --to @spfx-template/copilot-component-noframework --to @spfx-template/copilot-component-reactrush build --to @microsoft/spfx-template-testType of change