Replies: 1 comment 3 replies
-
Hello, I think a better approach would be to make your package side-effect composable and pass the "verify" and "store" in database as callbacks. In the
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im looking for a way to have a package named @core/auth where I store several auth related codes like components, remix-auth and other code like encryption stuff. Goal is to re-use this package true all my applications.
It would hold for example also all the components for login reset password etc.
The problem is I have no good Idea how to approach this and have tried several things already.
Consider this image of the directory structure.
The main problem is I need to import prisma ( for example ) client models into my code like User, UserProfile, Admin.
BUT
Those prisma client definitions are inside the turbo repro applications ( where the prisma client is generated based on the database model for each application ) this makes it impossible to easily or cleanly import them.
For example consider this code inside the domains folder of the package:
This code is from a regular application WIP that has not been modified to work with mono repro ( my goal )
I would:
But this import assumes its from the application and not the package.
Is there a workaround / best practice on how to approach this? im really baffled by how I could make this work.
Basically my question boils down to:
How would one 'pass' the prisma/typeorm/whatever typescript client for the database to the package
OR
Perhaps I approach this wrong?
Beta Was this translation helpful? Give feedback.
All reactions