anatine / zod-plugins

Plugins and utilities for Zod
640 stars 89 forks source link

Add `zod` as a `peerDependency` for `zod-mock` #165

Closed louisscruz closed 11 months ago

louisscruz commented 1 year ago

In using zod-mock with Yarn PnP in a monorepo, I've found that all return types for generateMock are any because zod itself can't be resolved. The same problem likely exists with other package managers that use module resolution strategies other than node module resolution.

This adds zod as a peerDependency so types work as expected. I took the zod version from the top level package.json was used. Perhaps a looser specification would be appropriate.

I've confirmed this fixes the problem for Yarn PnP in my monorepo.

nx-cloud[bot] commented 1 year ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 142851de07f62f7d48ceb666bb76d38b0135f207. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 2 targets - [`nx affected:test --base=origin/main --codeCoverage`](https://cloud.nx.app/runs/ejbPesALWG) - [`nx affected:lint --base=origin/main`](https://cloud.nx.app/runs/m5bejOugeW)

Sent with 💌 from NxCloud.