mix phx.new
generates a project by scaffolding templates specified at installer/templates and I think it could be a good idea to allow passing an argument to mix phx.new
which will override path where to look for templates first. Let’s say I run mix phx.new myapp --templates-path=~/phx_tpl/blog
and I have the following structure in ~/phx_tpl/blog:
blog
├── phx_single
│ ├── config
│ │ └── dev.exs
│ ├── lib
│ │ └── app_name
│ │ └── web
│ │ └── web.ex
│ └── mix.exs
├── phx_test
│ └── controllers
│ └── page_controller_test.exs
└── phx_web
└── controllers
└── page_controller.ex
In this case project generated would have following files being generated from custom templates:
myapp
├── config
│ ├── dev.exs
├── lib
│ └── app
│ └── web
│ └── controllers
│ └── page_controller.ex
├── mix.exs
└── test
└── web
└── controllers
└── page_controller_test.exs
while the rest of the app will be generated from Phoenix default templates.
I’m very interested in what community and, particularly, Phoenix maintainers, would think about it.