colinhacks / zod

TypeScript-first schema validation with static type inference
https://zod.dev
MIT License
33.09k stars 1.15k forks source link

fix: add types exports declaration for ./locales/* #3700

Open disintegrator opened 1 month ago

disintegrator commented 1 month ago

Fixes #2698 #1461

This change fixes an issue that prevented Zod from being build and served through the Skypack CDN. Namely, Skypack was unable to resolve the declaration file lib/locales/en.d.ts because it was not exposed by the package.json#exports declaration.

I was able to verify this fix by publishing this branch to NPM (link) and comparing the result of the following in a Chrome console:

const z = await import ('https://cdn.skypack.dev/zod')
const zfixed = await import ('https://cdn.skypack.dev/@disintegrator/zod')

There was also a hint from other issues that Zod v3.18.x worked through Skypack but 3.19.0 did not. The latter is where the malformed exports declaration for ./locales/* was introduced.

netlify[bot] commented 1 month ago

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
Latest commit 0542198a1670433096555de2bdd5f0548c72fd4e
Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/66b79e2495449b00083a66de
Deploy Preview https://deploy-preview-3700--guileless-rolypoly-866f8a.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.