cloudflare / chanfana

OpenAPI 3 and 3.1 schema generator and validator for Hono, itty-router and more!
https://chanfana.pages.dev
MIT License
342 stars 43 forks source link

Cloudflare Workers Vitest integration Broken by this package #141

Closed andrew-pyle closed 7 months ago

andrew-pyle commented 7 months ago

The Cloudflare Workers recommended testing strategy, the Vitest Integration, is not compatible with this package. It's due to a dependency, @asteasolutions/zod-to-openapi. This package depends on v5 of @asteasolutions/zod-to-openapi, which was not published in ESM format. Vitest only works with ESM code.

The dependency has already been fixed in v7. Can this package be updated to use the v7 of @asteasolutions/zod-to-openapi?

References

andrew-pyle commented 7 months ago

I've overriden @asteasolutions/zod-to-openapi in my app's package.json to use v7 with no ill effects so far.

In package.json:

{
  "dependencies": {
    "@cloudflare/itty-router-openapi": "^1.1.0",
    "zod": "^3.22.4"
  },
  "overrides": {
    "@cloudflare/itty-router-openapi": {
      "@asteasolutions/zod-to-openapi": "^7.0.0"
    }
  }
}
andrew-pyle commented 7 months ago

Duplicate of #144. Resolved in v1.1.1.