Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Igniter.Libs.Phoenix.web_module/1 returns wrong name in Umbrella apps #219

Closed
leandrocp opened this issue Feb 6, 2025 · 2 comments · Fixed by #221
Closed

Igniter.Libs.Phoenix.web_module/1 returns wrong name in Umbrella apps #219

leandrocp opened this issue Feb 6, 2025 · 2 comments · Fixed by #221
Labels
bug Something isn't working

Comments

@leandrocp
Copy link
Contributor

I noticed Igniter can't find routers in umbrella apps due to generating wrong web module names. Take for instance an umbrella project generated as:

mix phx.new.web cms_admin_web

Igniter.Libs.Phoenix.web_module/1 returns CmsAdminWebWeb (duplicate Web).

I'm aware there's no reliable way to find the web module name but an idea to fix it is to traverse the existing module looking for use MOD, :router, ie: a web-ish module using :router which seems to be reliable enough to determine the web module prefix, otherwise if not found fallbacks to project prefix <> "Web".

Wdyt?

@leandrocp leandrocp added the bug Something isn't working label Feb 6, 2025
@zachdaniel
Copy link
Contributor

🤔 That could make sense, although we could potentially just not add Web if it already ends in Web as a short term solution?

@leandrocp
Copy link
Contributor Author

That could work as well. I'm gonna send a PR for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants