Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsDocTagFilter not recognized when installed via bun #248

Open
Blamax opened this issue Jun 29, 2024 · 0 comments
Open

jsDocTagFilter not recognized when installed via bun #248

Blamax opened this issue Jun 29, 2024 · 0 comments

Comments

@Blamax
Copy link

Blamax commented Jun 29, 2024

The output of ts-to-zod is empty when you use jsDocTagFilter and installed the ts-to-zod via bun. I have tried around quite a bit since

module.exports = [ { name: "Entity", input: "../shared/types/entity.ts", // output: "src/schemas/zod/entity.zod.ts", getSchemaName: (id) => z${id}, jsDocTagFilter: (tags) => { console.log("JSDoc Tags:", JSON.stringify(tags, null, 2)); return tags.map((tag) => tag.name).includes("zod"), }, }, ];

shows only empty console logs then. Here the console log:

bun ts-to-zod --all
Generating "Entity"
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
✔ Validating generated types
🎉 Zod schemas generated!

The created entity.zod.ts is empty as it did not find any marked interfaces. However, as soon as you install it via yarn, it works just fine. Maybe this can save someone else a few hours who runs into the same problem. Running yarn add --dev ts-to-zod and then afterwards bun ts-to-zod --all outputs then:

Generating "Entity"
[ { name: 'zod', value: undefined } ]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
✔ Validating generated types
🎉 Zod schemas generated!

Versions

  • Typescript: v5.4.4
  • Zod: v3.23.8
  • ts-to-zod: v3.8.7

If anyone knows what might cause this issue, please let me know! Thank you very much!

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

No branches or pull requests

1 participant