mix phx_demo.install (phx_demo v0.1.1)

Copy Markdown View Source

Sets up phx_demo in a Phoenix app

Automates the README's setup steps:

  • adds phoenix_test_playwright (test only)
  • preferred_envs for demo.record and phx_demo.piper.setup
  • config/test.exs: endpoint server: true, :sql_sandbox, :phoenix_test otp_app
  • Ecto sandbox for LiveView (if the app has a Repo): the Phoenix.Ecto.SQL.Sandbox plug, :user_agent in the LiveView socket's connect_info, and an on_mount hook registered for every LiveView
  • test/test_helper.exs: starts Playwright, sets the base URL, and excludes demos from plain mix test
  • guards Phoenix 1.8's runtime.exs port config so it doesn't override the test port
  • an example demo in test/demos/

Edits it can't make safely become notices with the manual step.

Example

MIX_ENV=test mix igniter.install phx_demo --only test