typegraphql-prisma
typegraphql-prisma copied to clipboard
publish to `node_modules/.cache/typegraphql` instead of `@generated/typegraphql`
Is your feature request related to a problem? Please describe.
Unrelated npm script calls seem to affect @generated/typegraphql resources. I might be mistaken, but vscode frequently seems to lose its contents.
Anyway, I think it is more in line with node package publish best practices to use node_modules/.cache/* instead of @generated/*. I believe the .cache folder is guaranteed to not be erased.
@Morriz The problem is that it doesn't work:


Cache is for storing artifacts, not JS code to require by Node runtime.
Or do you think about a facade like .prisma/client?



Tnx for looking into it. If a facade already helps to persist the generated files better (I have no clue if it's just vscode that keeps losing them, but like I said it keeps losing ref), then great.
You're the first that reports issues with losing that in VSCode.
The current approach of emitting to node_modules is just like installing a npm module.
So that you can just use absolute import of @generated/xyz.
Prisma did this at the begining but then switched to fascade some time ago because of issues.
I think I should follow the Prisma approach in that case. Will try to do this next week or so 😉
It's not that you lose them randomly from vscode, anytime you install via npm or yarn it will remove the @generated directory and you'll need to run prisma generate again.
Yeah having to run the postinstall script every time you add a package is soooo annoying, anyone found a way to avoid this?