Tools for generating models and migrations in modular monolith using packwerk/stimpack

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Are there any tools that make rails generators (eg models, migrations) do the right thing when working in a packwerk/stimpack based modular monolith?

rails g model product name medium:enum produced model, migrations, etc at the root level (not within the current products pack).

I love this question… I don’t know of any, but my hope is that as a community we can propose changes and submit PRs to Rails that help support modular development across the whole toolchain.

At Gusto we tend to use https://github.com/rubyatscale/use_packwerk ’s move command to move files to packs, but there is a long way to go, especially when you consider systems that actually require things to live in the root pack.

Ok. That’s a really helpful utility

feels like a lost opportunity to use packwerker for the tool name

Message originally sent by slack user U717FXJ8HWK

On that note, being able to run this tool from editors / IDEs would be really convenient

I think that was actually the original name @dmytro, or something like it :sweat_smile:

<@U717FXJ8HWK> Interesting idea. Long-term, my hope is that through community-driven tooling and conventions we can help bring better large scale refactoring tools to Ruby. I think Sorbet is really paving the road for this with their in-editor refactor tools, but I agree that eventually having those tools integrate with some more knowledge about our runtime and what else needs to change when a file is moved would really take it to the next level.