Skip to content

feat: upgrade to Zod 4, Express 5, and add @zhttp/extract-oas CLI#69

Merged
evertdespiegeleer merged 57 commits intomainfrom
refactor/zod-4
Apr 24, 2026
Merged

feat: upgrade to Zod 4, Express 5, and add @zhttp/extract-oas CLI#69
evertdespiegeleer merged 57 commits intomainfrom
refactor/zod-4

Conversation

@evertdespiegeleer
Copy link
Copy Markdown
Owner

@evertdespiegeleer evertdespiegeleer commented Apr 15, 2026

Summary

New: @zhttp/extract-oas CLI package

  • New CLI tool to extract OpenAPI specs from zhttp Server instances
  • Usage: npx @zhttp/extract-oas --serverfile="./server.ts" --serverexport="httpserver" --output="./openapi-spec.json" --type="json"
  • Supports JSON and YAML output formats
  • Handles TypeScript input files transparently via tsx
  • Added to CI release and prerelease publish steps

Zod 4 migration

  • Upgrade zod from ^3.22.4 to ^4.0.0
  • Upgrade @asteasolutions/zod-to-openapi from ^6.3.1 to ^8.0.0
  • Upgrade typescript from ^4.4.4 to ^5.5.0 (required by Zod 4)
  • Upgrade @typescript-eslint/* from v6 to v7
  • Replace deprecated ZodSchema type alias with ZodType
  • Fix ExtractRouteParams optional modifier for Zod 4 shape type compatibility

Express 5 upgrade

  • Upgrade express from ^4.18.2 to ^5.2.1
  • Upgrade @types/express from ^4.17.21 to ^5.0.0
  • Move @types/express to dependencies so consumers get proper Request/Response types
  • Remove body-parser dependency (bundled in Express 5), use express.json() instead

CI

  • Consolidate npm publishing into release.yml for npm trusted publishers (OIDC)
  • Add tgz artifact uploads to release workflow
  • Add @zhttp/extract-oas to release and prerelease publish steps

Other

  • Add agent skill (SKILL.md) for zhttp library usage

Test plan

  • npx tsc --noEmit β€” no type errors
  • npm run build β€” ESM and CJS bundles build for all packages
  • npm test β€” all 11 tests pass
  • OpenAPI integration test still generates valid spec
  • extract-oas --help outputs correct CLI usage

- Upgrade zod ^3.22.4 -> ^4.0.0
- Upgrade @asteasolutions/zod-to-openapi ^6.3.1 -> ^8.0.0
- Upgrade typescript ^4.4.4 -> ^5.5.0
- Upgrade @typescript-eslint/* v6 -> v7, replace abandoned
  eslint-config-standard-with-typescript with direct config
- Replace deprecated ZodSchema with ZodType
- Fix ExtractRouteParams optional modifier for Zod 4 shape compat
@evertdespiegeleer evertdespiegeleer changed the title refactor: ♻️ migrate from Zod 3 to Zod 4 refactor: migrate from Zod 3 to Zod 4 Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2026

Test Results

 1 files  Β±0   4 suites  Β±0   0s ⏱️ Β±0s
10 tests Β±0  10 βœ… Β±0  0 πŸ’€ Β±0  0 ❌ Β±0 
11 runsβ€Š Β±0  11 βœ… Β±0  0 πŸ’€ Β±0  0 ❌ Β±0 

Results for commit 78fb51b. ± Comparison against base commit 8f7ac93.

♻️ This comment has been updated with latest results.

Adds a SKILL.md at the repo root so agents can install zhttp knowledge
via `npx skills add evertdespiegeleer/zhttp`. Covers endpoints,
controllers, middleware, server setup, error handling, and OpenAPI.
…sted publishers

Move prerelease publishing from push.yml to release.yml so all npm
publishes go through a single workflow, as required by npm trusted
publishers (OIDC). Remove NPM_PUBLISH_TOKEN in favor of --provenance.
npm trusted publishers require npm 10.9.1+ for automatic OIDC token
exchange. Node 20.11 ships npm 10.2.4 which is too old.
@evertdespiegeleer evertdespiegeleer changed the title refactor: migrate from Zod 3 to Zod 4 feat: upgrade to Zod 4 and Express 5 Apr 18, 2026
CLI tool to extract OpenAPI specs from zhttp Server instances.
Supports JSON and YAML output, handles TS input files via tsx.
@evertdespiegeleer evertdespiegeleer changed the title feat: upgrade to Zod 4 and Express 5 feat: upgrade to Zod 4, Express 5, and add @zhttp/extract-oas CLI Apr 18, 2026
github-actions Bot and others added 2 commits April 18, 2026 15:05
Middleware handler params (req, res, next) were untyped due to the
MiddlewareHandler union. Now MiddlewareProps discriminates on the type
field so TypeScript infers the correct handler signature automatically.
@evertdespiegeleer evertdespiegeleer linked an issue Apr 24, 2026 that may be closed by this pull request
@evertdespiegeleer evertdespiegeleer merged commit 4904fe8 into main Apr 24, 2026
6 of 7 checks passed
@evertdespiegeleer evertdespiegeleer deleted the refactor/zod-4 branch April 24, 2026 13:38
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.

Support Zod 4 (now in beta)

1 participant