mix xenia.install (Xenia v0.1.1)

Copy Markdown View Source

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 page
  • assets/js/app.js: createHooks from "xenia" in the LiveSocket's hooks, and the app's theme published for components that follow it
  • lib/my_app_web.ex: import Xenia.Component in html_helpers
  • lib/my_app_web/components/core_components.ex and layouts.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; see flash/1
  • lib/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: :xenia in import_deps
  • lib/my_app_web/router.ex: the home route replaced by xenia_routes "lib/my_app_web/app", inside a live_session
  • lib/my_app_web/app/: a layout.ex (header, theme toggle, footer) and a home page.ex
  • priv/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-module and --web-path - MyAppWeb and lib/my_app_web by default, from the app's name