-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
#61 add support for additional paths to store schema objects #64
Conversation
* adds support for using a new flag `additionalPaths` in `createSchema` * adds new example for splitting the schema code across directories * adds new test / snapshot
I hit a couple snags but it is working the way I envisioned and I made sure all the tests passed as well. To use:
Manual QA: Notes on snags:
Let me know if I missed anything or if you have any suggestions on how to make the code cleaner / clearer. |
lib/modules/PrismaSchema.ts
Outdated
const updatedPath = `${this.basePath}/${path}`; | ||
await importAllFiles(updatedPath, "enums"); | ||
await importAllFiles(updatedPath, "models"); | ||
await importAllFiles(updatedPath, "mixins"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I would change would be to have the additionalPaths
not be based off the basePath
, just by passing in another absolute/resolved path from the config.
const updatedPath = `${this.basePath}/${path}`; | |
await importAllFiles(updatedPath, "enums"); | |
await importAllFiles(updatedPath, "models"); | |
await importAllFiles(updatedPath, "mixins"); | |
await importAllFiles(path, "enums"); | |
await importAllFiles(path, "models"); | |
await importAllFiles(path, "mixins"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, will get this change pushed up today.
* updated schema to use additionalPath as it's own path, not as a path relative to basePath * updated the example readme / index * noticed the second additionalPath in the example is missing somehow so I removed that * updated the test
Will include this in the next release. c: |
Addresses issue #61.
additionalPaths
increateSchema