Closed MyklClason closed 1 year ago
+1. We also don't use a lib
folder, but instead a bounded_contexts
folder. Adding the path as a configuration option for the generators would be helpful.
Edit: Are y'all open to a PR for this either from @MyklClason or myself?
Are y'all open to a PR for this either from @MyklClason or myself?
That would be great. It should support both Rails and non Rails environments 🙏🏼
Actually looks like the generators aren't really designed to be used with rails to begin with, which might be the real issue.
Yes this is correct. We started working on better Rails integration a few months back. These generators were not created with Rails in mind back then....
PS. We have a full integration test spec/lib/sequent/generator/project_spec.rb
which we never got consistently working. So we disabled it. If I remember correctly it was a bit flaky, perhaps because of github action and exit code's when running bash. But that was a while back, so perhaps it works better nowadays. If you need any help please let us know.
Closing due to inactivity. Feel free to re-open.
Generators should be reasonably flexible in how they are used. However, the three main generators here all hard-code the path as
lib
. This is especially since the documentation suggests usingapp/domain
for rails.https://github.com/zilverline/sequent/blob/master/lib/sequent/generator/aggregate.rb#L59 https://github.com/zilverline/sequent/blob/master/lib/sequent/generator/command.rb#L68 https://github.com/zilverline/sequent/blob/master/lib/sequent/generator/event.rb#L66
It seems like this could be quickly handled via:
domain_path
config with a default value ofFile.expand_path('lib')
.@path ||= Sequent.configuration.domain_path
instead of@path ||= File.expand_path('lib')
in those 3 lines.Edit: Actually looks like the generators aren't really designed to be used with rails to begin with, which might be the real issue.