We should extract the generator and to a lesser extent the console out of the cli package to their own packages or at the very least folders
@blitzjs/generator
@blitzjs/console
I forgot this issue existed. @blitzjs/generator exists now, we still need someone to pull out the console code
I'm happy to try pulling out the console got. Looking at the codebase its just one file, but it depends on runPrismaGeneration which is owned right now by the /commands/db.ts (and also used by the start.ts command). Not sure if it should be shared by those files, should we:
console package get the function from commands package?console packagemy personal thought is duplicate the logic for now. I assume at some point we'll want a shared @blitz/prisma package that we can use to centralize all of our prisma code, but I don't think we have enough information to know what that shared API needs to look like so better to duplicate rather than choosing the wrong abstraction.
@ryardley @flybayer thoughts?
The prisma code will be in a plugin like blitz-plugin-prisma or something.
Ok to duplicate for now, but add a comment both places clearly stating this.
I've the same feeling about it.
I like the plugin idea, right now the db is tightly coupled with prisma which would be hard to switch/replace implementation if needed. I guess the ultimate goal would be to have an decoupled db module where you could plug in and out any database provider. Perhaps that could be another work front since it is a long way until having that abstraction.