Skip to content

refactor: migrate from Zod to TypeBox via lib validateSchema#271

Merged
John-David Dalton (jdalton) merged 1 commit intomainfrom
refactor/zod-to-typebox
Apr 20, 2026
Merged

refactor: migrate from Zod to TypeBox via lib validateSchema#271
John-David Dalton (jdalton) merged 1 commit intomainfrom
refactor/zod-to-typebox

Conversation

@jdalton
Copy link
Copy Markdown
Collaborator

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:

  1. scripts/xport-{schema,emit-schema}.mts + scripts/xport.mts — cross-repo-synced xport harness. Canonical lives in socket-repo-template; sibling migrations already landed in socket-btm (60f3dcd), sdxgen (7304945), and ultrathink (0bd49c332). This PR syncs the same byte-identical migration here.

  2. .claude/hooks/setup-security-tools/index.mts — local tool-config validator for AgentShield/zizmor/sfw. 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.

Test plan

  • pnpm run lint green
  • pnpm install clean
  • All 2184 tests pass
  • CI green

…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.
@jdalton
Copy link
Copy Markdown
Collaborator Author

Landed directly on main (614efae).

@jdalton John-David Dalton (jdalton) merged commit 614efae into main Apr 20, 2026
12 checks passed
@jdalton John-David Dalton (jdalton) deleted the refactor/zod-to-typebox branch April 20, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant