rubyatscale / packs-rails

packs-rails establishes and implements a set of conventions for splitting up large monoliths.
MIT License
268 stars 26 forks source link

Added possibility to set custom engine name #65

Closed timfsw closed 12 months ago

timfsw commented 1 year ago

I've needed a possibility to set a custom engine namespace to create different engines with same package folder name.

Currently the following package structure creates the same engine Authentication::Engine

# packs/backend/authentication/package.ym
metadata:
  engine: true
# packs/frontend/authentication/package.yml
metadata:
  engine: true

Now it's possible to set a custom engine name to prevent this issue.

# packs/backend/authentication/package.ym
metadata:
  engine: true
  engine_name: backend/authentication
# packs/frontend/authentication/package.yml
metadata:
  engine: true
  engine_name: frontend/authentication

This will generate the following engines: Backend::Authentication::Engine and Frontend::Authentication::Engine

I think it is better to specify the name explicitly instead of generating the package name based on the folder structure.

professor commented 1 year ago

@ngan any thoughts on this PR?

If I understand the problem we are trying to solve, then another solution to this PR would be to change the behavior to make frontend/authentication be the auto-magic engine name instead of authentication