Generates a LiveView-wrapped Dala project.
This module owns everything specific to the --liveview path:
- Runs
mix phx.newas a subprocess - Patches
mix.exsto add the dala / dala_dev dependencies - Copies the native Android/iOS boilerplate, skipping Phoenix-owned files
(see
DalaNew.ProjectGenerator.liveview_phoenix_owned?/3) - Applies the Dala bridge patches (DalaHook, dala-bridge element, DalaScreen, dala.exs, Erlang bootstrap, port alignment, notes starter app)
On failure the partially-created project directory is removed so a retry doesn't hit "Directory already exists".
Summary
Functions
Generates a LiveView project at dest_dir/<app_name>.
When generating a LiveView project, mix phx.new already produced its own
mix.exs, config/, lib/<app>/, lib/<app>_web/, .gitignore, and assets/ — and
those are the correct versions for a Phoenix app (with gettext,
telemetry_metrics, etc.). The native template's same-named files are
written for the bare-Dala path and would clobber Phoenix's, leaving the
project unable to compile.
Functions
Generates a LiveView project at dest_dir/<app_name>.
Returns {:ok, project_dir} or {:error, reason}.
When generating a LiveView project, mix phx.new already produced its own
mix.exs, config/, lib/<app>/, lib/<app>_web/, .gitignore, and assets/ — and
those are the correct versions for a Phoenix app (with gettext,
telemetry_metrics, etc.). The native template's same-named files are
written for the bare-Dala path and would clobber Phoenix's, leaving the
project unable to compile.
When :liveview is true in opts, this predicate returns true for any
template path that Phoenix already owns, so the copy step skips it. Files
that are unique to Dala (dala.exs, src/<app>.erl, android/, ios/) still get
emitted normally.
Public for testing — guards against the regression where a new template path lands in the native tree without being added to the LiveView blocklist.