Turns a freshly generated Phoenix 1.8 app into a Xenia app.
$ mix phx.new my_app
$ cd my_app
# add {:xenia, "~> 0.1.0"} to mix.exs, then:
$ mix deps.get
$ mix xenia.install
It makes these changes, and says what it did with each:
assets/css/app.css: Xenia's light and dark themes in place of Phoenix's (plain, with Xenia's purple and gold), and a faint grid for the top of the pageassets/js/app.js:createHooksfrom"xenia"in the LiveSocket's hooks, and the app's theme published for components that follow itlib/my_app_web.ex:import Xenia.Componentinhtml_helperslib/my_app_web/components/core_components.exandlayouts.ex: Phoenix's flash messages with a success kind, stacked newest first, closing by themselves after 5 seconds with a countdown line around their border (errors stay).<.flash_group shape="sharp" duration={8000}>changes them; seeflash/1lib/my_app_web/components/layouts/root.html.heex: the pages' titles, descriptions and social tags (Xenia.Metadata), in place of Phoenix's " · Phoenix Framework" title suffix.formatter.exs::xeniainimport_depslib/my_app_web/router.ex: the home route replaced byxenia_routes "lib/my_app_web/app", inside alive_sessionlib/my_app_web/app/: alayout.ex(header, theme toggle, footer) and a homepage.expriv/static/images/xenia-mark.png: the logo the layout shows
Running it twice changes nothing the second time. A file that doesn't
look like Phoenix generated it is left alone, and the step to do by hand
is printed instead. Phoenix's PageController files stay; delete them
when you no longer need them.
Options
--web-moduleand--web-path-MyAppWebandlib/my_app_webby default, from the app's name