m1212e / prismabox

typebox schema generator for prisma
MIT License
38 stars 7 forks source link

Prefix option #24

Closed ismailkarsli closed 1 week ago

ismailkarsli commented 2 weeks ago

There is confusion between the types of this plugin and Prisma's own types. So I think it makes sense to add a prefix to the generated types.

For example, I would prefer to add the T prefix to the types of this plugin and use a TUser type instead. Of course I can achieve this with aliases, but it would be nicer to create a standard in the long run.

m1212e commented 2 weeks ago

Although I never really had this issue I do see your point. I'd argue that flexibility in prefixing is probably better since there isn't really a need for a standard so I'd make this user configureable and default it to no prefix at all. This would also prevent breaking changes with past versions. I'll may be able to implement this myself throughout the next weeks although I don't have very much time currently. Feel free to open a PR and/or ask for help if you would like to tackle this yourself!

m1212e commented 1 week ago

Hey, I just released https://github.com/m1212e/prismabox/releases/tag/1.1.15 which implements the prefix you asked for! Please check it out and close the issue if this is what you need!

ismailkarsli commented 1 week ago

Thank you 🙏 As I checked, it looks like an easy fix. It would probably take hours for me to understand the logic :)

m1212e commented 1 week ago

Sure thing, you're welcome. If you like the repo make sure to star it ⭐