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

Feat export all schemas in index #54

Merged
merged 4 commits into from
Dec 24, 2022
Merged

Feat export all schemas in index #54

merged 4 commits into from
Dec 24, 2022

Conversation

feelixe
Copy link
Contributor

@feelixe feelixe commented Dec 2, 2022

Description

This generates an index file in ./generated/schemas that exports all schemas

References

Closes #52
Closes #37

@feelixe
Copy link
Contributor Author

feelixe commented Dec 2, 2022

@omar-dulaimi Could you review and tell me if I need to change something?

@omar-dulaimi
Copy link
Owner

Hey @Feelixe-tin

Yes of course, I will. In the meantime just make sure to test your changes inside a working project like Nextjs or something else, so we could eliminate any possible circular references.

@feelixe
Copy link
Contributor Author

feelixe commented Dec 4, 2022

I have tested in my nuxt3 project it and works well.

Copy link
Owner

@omar-dulaimi omar-dulaimi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feelixe-tin

I left you some points

@@ -0,0 +1,22 @@
import path from 'path';
import normalizePath from 'normalize-path';
Copy link
Owner

@omar-dulaimi omar-dulaimi Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to add a new dependency(normalizePath)? Can we do without it using native Nodejs?

@feelixe
Copy link
Contributor Author

feelixe commented Dec 10, 2022

Thank you, I will look into it.
Also, do you think it makes more sense to have one index file per folder instead?
So one in /schemas, /schemas/enums, schemas/objects instead of just the one in schemas/

@omar-dulaimi
Copy link
Owner

Thank you, I will look into it. Also, do you think it makes more sense to have one index file per folder instead? So one in /schemas, ´/schemas/enums´, schemas/objects instead of just the one in schemas/

Yeah, of course. Just as long as you don't face any circular references issues when you import it in your project

@omar-dulaimi omar-dulaimi merged commit b584b9b into omar-dulaimi:master Dec 24, 2022
@omar-dulaimi
Copy link
Owner

Released in https://github.com/omar-dulaimi/prisma-zod-generator/releases/tag/0.8.6

Thanks @Feelixe-tin

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

Successfully merging this pull request may close these issues.

Re-exports for all schemas Add index.ts with all the exported members
2 participants