smpallen99 / ex_admin

ExAdmin is an auto administration package for Elixir and the Phoenix Framework
MIT License
1.2k stars 272 forks source link

Proposal: *partial* Rewrite of admin.install.task #421

Open blisscs opened 6 years ago

blisscs commented 6 years ago

I would like to propose the partial rewrite of admin.install task.

Background: mix task admin.install is the first command that users use when for adding ex_admin files to their phoenix projects. Due to different users has different phoenix setups (including: Phoenix1.2, Phoenix 1.3 with brunch, Phoenix 1.3 without any assets management library, or Phoenix 1.3 with (webpack or anyother assets management). Mix admin.install task some time fail to setup appropriate files in some of the cases. For example, when the phoenix project uses webpack as the assets management library, the library fails to generate css(s) and javascript(s) even when use with option --no-brunch, or --no-assets or (together --no-assets and --no-brunch altogether) (Given the current commit a0ed1f1c from phx-1.3 branch ).

Proposal: Rewriting a assets install task. To flavor two standard cases -

  1. --no-assets . This will install the assets under /priv/static and optionally have documentation lists all the assetic files that users need to add to the templates and also tell them where to add them.
  2. generic option (%{assets: true}). This option will add all static files under assets folder. We will also add additional docs also telling user how they can configure brunch, webpack, or any other assets library that people use.
  3. optionally --brunch. This optional will configure the brunch as a default assets library.

I have try read and understand the code in the admin.intall.ex I think I could do some rewrite with most of the old concept.

How do you think of this proposal?