Modifying Zeitwerk for Package Namespaces without Subdirectories in Ruby

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

Anyone figured out a way to modify zeitwerk so that we get package namespaces without namespace subdirectories throughout the package?

packs/products/models/sku.rb

instead of

packs/products/models/products/sku.rb

…and still have SKU in the Products namespace?

Message originally sent by slack user U70TIGAX94P

Custom root namespaces maybe? https://github.com/fxn/zeitwerk#custom-root-namespaces

Thats where we’re headed… creating an initializer to setup custom root namespaces for each pack. Just wondering if we’re re-creating the wheel.

Didn’t see this earlier, but plus one to Philip! I’d love to be able to add this as a feature to Stimpack and allow packs to opt into this feature if they’ve already namespaced all code within their pack!!

If you wanted to try to add it to stimpack and the modularization tool chain I’d be happy to work/pair with you on that!