refactor: migrate from Zod to TypeBox via lib validateSchema#271
Merged
John-David Dalton (jdalton) merged 1 commit intomainfrom Apr 20, 2026
Merged
refactor: migrate from Zod to TypeBox via lib validateSchema#271John-David Dalton (jdalton) merged 1 commit intomainfrom
John-David Dalton (jdalton) merged 1 commit intomainfrom
Conversation
…eSchema
Fleet-wide direction: no more Zod. Validation goes through
@socketsecurity/lib/validation/validateSchema (shipped in lib 5.20.0)
which accepts TypeBox schemas.
Two call sites in this repo use Zod:
1. scripts/xport-{schema,emit-schema}.mts + scripts/xport.mts —
cross-repo-synced xport harness. Canonical lives in
socket-repo-template; sibling migrations landed in socket-btm
(60f3dcd), sdxgen (7304945), ultrathink (0bd49c332). This
commit syncs the same byte-identical migration here.
2. .claude/hooks/setup-security-tools/index.mts — local tool-config
validator. Switch z.object(...) → Type.Object(...) and
configSchema.parse(rawConfig) → parseSchema(configSchema, rawConfig).
Hook package.json swaps its zod dep for @sinclair/typebox.
- xport.schema.json regenerated and oxfmt-formatted.
- root package.json + pnpm-workspace.yaml swap zod for
@sinclair/typebox.
Collaborator
Author
|
Landed directly on main (614efae). |
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.
Summary
Fleet-wide direction: no more Zod. Validation flows through
@socketsecurity/lib/validation/validateSchema(shipped in lib 5.20.0), which accepts TypeBox schemas.Two call sites in this repo used Zod:
scripts/xport-{schema,emit-schema}.mts+scripts/xport.mts— cross-repo-synced xport harness. Canonical lives insocket-repo-template; sibling migrations already landed in socket-btm (60f3dcd), sdxgen (7304945), and ultrathink (0bd49c332). This PR syncs the same byte-identical migration here..claude/hooks/setup-security-tools/index.mts— local tool-config validator for AgentShield/zizmor/sfw. Switchz.object(...)→Type.Object(...)andconfigSchema.parse(rawConfig)→parseSchema(configSchema, rawConfig). Hookpackage.jsonswaps its zod dep for@sinclair/typebox.xport.schema.jsonregenerated and oxfmt-formatted.package.json+pnpm-workspace.yamlswap zod for@sinclair/typebox.Test plan
pnpm run lintgreenpnpm installclean