Closed inxilpro closed 10 months ago
it means that when we create a file in the "root module" it's created in [root]/src/... rather than [root]/app/...
That is strange. Currently, the app
folder is hard-coded as the main folder for all root module code files. I just checked the 3.6.1 version, and it creates everything correctly: app
folder for the Root module and src
folders for modules.
My module settings for InterNACHI/modular project:
Hm. This is what happens for me with plugin version 3.6.1.203 on PhpStorm 2020.3:
https://user-images.githubusercontent.com/21592/103708514-b0771580-4f7e-11eb-9f19-ffb411686911.mp4
Found the reason. Thank you. Will be fixed.
I think it's because I overrode the code generation settings before the module option existed! I'm going to try to revert those back and see if that fixes it.
No… that didn't fix it.
Oh, I take that back. It won't revert back. Clicking "Apply" does nothing, and if I hit "OK" and return to the plugin settings, the settings revert:
https://user-images.githubusercontent.com/21592/103711388-53329280-4f85-11eb-815f-fd93d104d04a.mp4
It was implemented in one of the previous versions. I hope we can close this now.
Right now the "Directory modules as composer.json packages" option let's you choose the name of your "sources path" but this overrides the root module as well. The default setup for InterNACHI/modular puts your module source files in
src/
while keeping your app's source files inapp/
.For example:
App\Http\HomeController
is in[root]/app/Http/
Modules\Demo\Http\DemoModuleController
is in[root]/app-modules/demo/src/Http/
We're currently using
src
as "Sources path" andapp-modules
as "Root directory path" which works for all our modules, but it means that when we create a file in the "root module" it's created in[root]/src/...
rather than[root]/app/...
I think the fix would just to add a "Module sources path" and a "Application sources path" or similar. An even more flexible option would be to read the
autoload.psr-4
configuration inside each module's composer.json file, but this would come with the added complexity of handling additional PSR-4 mappings (i.e. Tests).Thank you again for all your hard work on this!