Support for customizable directory for generated files (to support Modules)
kmizzi opened this issue · 5 comments
Synopsis:
Most use cases of needing blueprint for us would be to integrate with 3rd party APIs with a lot of new models needed. For this, we use https://github.com/nWidart/laravel-modules. It would be great if there was a flag on the blueprint:build command to allow the use of alternative destinations for the generated files aside from the app folder.
Proposed Syntax:
php artisan blueprint:build --rootFolder=Modules/Amazon
Expected Behavior:
Would generate all files in Modules/Amazon instead of app/
It would also be great to have a flag for alternative directory name for modules such as --modelDir=Entities
Blueprint is based off Laravel conventions. "modules" are a separate practice with their own conventions. As such, it's not something Blueprint will support directly.
With that said, a few configuration options exist that would allow you to generate code with different namespaces. From there you could move the files to whatever custom structure you want.
Of course, you are always welcome to make a "modules" extension.
Hey @jasonmccreary
Met you at the Tin Roof event at Laracon.
I thought the issue was a memory issue but from looking again, it wasn't a memory issue after all, but rather this issue with modules support that prevented me from using Blueprint. Just wanted to follow up as promised.
Gotcha. Yeah, modules, eek. I stand by my original comment - Blueprint is about conventions. Unfortunately, modules does not follow that. However, I think you could probably make it work. It would just take extra configuration.
Agreed, can make it work. It is a project down the road!