Wraps mix phx.new and replaces Phoenix's default HTML scaffolding
with the JobyKit HTML layer.
Why we don't pass --no-html: that flag also removes the asset
pipeline (esbuild, tailwind, watchers, Plug.Static), which we still
need. We let Phoenix generate everything and then overwrite the few
files the kit owns (<app>_web.ex, layouts, router, and the
PageController/PageHTML modules that go away in favor of HomeLive).
Usage
mix joby_kit.new <app_name> [phx.new flags] [joby_kit flags]Running from anywhere (Mix archive install)
By default, this task is only available from a project that has
:joby_kit as a dep. To make mix joby_kit.new runnable from any
directory (the same way mix phx.new works), build and install the
archive:
cd /path/to/joby_kit
mix archive.build
mix archive.install ./joby_kit-0.1.0.ezAfter that, from anywhere:
mix joby_kit.new my_app --joby-kit-path /path/to/joby_kitWhen running from an archive (no surrounding Mix project),
--joby-kit-path is required because the wrapper can't auto-
detect a path-dep source.
Phoenix flags forwarded
Pass-through to mix phx.new: --database, --binary-id,
--module, --app, --no-ecto, --no-mailer, --no-dashboard,
--no-gettext, --verbose. The wrapper always forces --no-install
(we add :joby_kit and run mix deps.get ourselves so the kit is in
the dep list before the fetch).
JobyKit-specific flags
--joby-kit-path <path>— absolute path to your local JobyKit checkout. Used to write a path dep into the new app's mix.exs. Defaults to detecting from the calling project'sMix.Project.deps_paths().
What the task does
- Shells out:
mix phx.new <app_name> [forwarded flags] --no-install. - Adds
{:joby_kit, path: "<joby_kit_path>"}to the new app's mix.exs. - Runs
mix deps.getinside the new app. - Replaces the kit-owned HTML files:
lib/<app>_web.ex— JobyKit-flavored, importsJobyKit.CoreComponents.lib/<app>_web/components/layouts.ex— usesJobyKit.NavComponent.simple_navandJobyKit.CoreComponents.flash_group.lib/<app>_web/components/layouts/root.html.heex.
- Deletes the now-redundant Phoenix scaffolding:
<app>_web/components/core_components.ex,<app>_web/controllers/page_controller.ex,<app>_web/controllers/page_html.ex, and<app>_web/controllers/page_html/. - Runs
mix joby_kit.install(manifest, previews, design pages, AGENTS.md patches). - Generates
HomeLiveand replacesrouter.exwith a JobyKit-wired version. - Runs
mix assets.setupandmix assets.buildsopriv/static/assets/is populated before the firstmix phx.server.
After this task completes:
cd <app_name>
mix phx.serverThen visit http://localhost:4000/.