Open jwoertink opened 1 day ago
Thank you for the response! Here are a few additional thoughts from me:
I'm still having trouble seeing this conceptually. So would this just keep the same structure, but drop it all in to a sub-module namespace?
lucky init
# enter wizard
Use Module structure? Y
App name: blog
generated files
src/blog/actions
src/blog/models
src/blog/queries
src/blog/serializers
src/blog/pages
lucky gen.model User --module=blog
src/blog/models/user.cr
----------------------------
lucky init
# enter wizard
Use Module structure? N
App name: blog
generated files
src/actions
src/models
src/queries
src/serializers
src/pages
lucky gen.model User
src/models/user.cr
So is this what the flow would look like? In this case we're just saying that everything is either within a namespace or not. That might make it easier to manage from implementation.
So is this what the flow would look like? In this case we're just saying that everything is either within a namespace or not. That might make it easier to manage from implementation.
Yep. That is exactly how it could look like (at least to my taste).
Currently if you use
lucky gen.model
this will put the file insrc/models/
however, some people prefer to structure their apps in a different manner.I haven't confirmed this, but I'm told that Marten offers a CLI flag of
--app
or--module
that will place the files in to alternate structures. I'm not sure what that looks like exactly, but when this came up in Discord, here's an example structure for a Lucky appOn the one hand, having an option like
--module
that would automatically structure the generated files like this would be nice, but on the other hand, if you're looking to structure your app differently and it's not like this or the default, then you're still left with not being able to use the CLI generators and hand moving all of your files around...Lucky should always try to provide an escape hatch for when some design choice was made and someone wants a way around it. I think maybe just adding a
--dir=./src/path/to/where you want
might be good. Though, I'm not sure how usinglucky gen.resource.browser
would work since this creates files in like 6 different spots. Now we're talking about 6 new flags??We had some discussion about this before https://github.com/luckyframework/lucky/discussions/642
So I guess this comes down to 3 options:
e.g. --mirations-dir
.