Skip to content

mob.adopt: relocate the Igniter installer from mob_new#8 into mob_dev#19

Merged
GenericJam merged 3 commits into
masterfrom
mob-adopt
Jun 19, 2026
Merged

mob.adopt: relocate the Igniter installer from mob_new#8 into mob_dev#19
GenericJam merged 3 commits into
masterfrom
mob-adopt

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Relocates mix mob.adopt — contributed as GenericJam/mob_new#8 by @ken-kost — from mob_new into mob_dev, where the Igniter-based Mix tasks live (mob.add_nif, mob.enable).

Why move it

mob.adopt is an Igniter task that mutates an existing project. mob_new ships as a self-contained Mix archive (ArchiveSelfContainedTest pins that no hex-dep modules are archive-reachable), so it can't carry Igniter — mix mob.adopt from the archive would crash every user with UndefinedFunctionError. mob_dev is a normal Hex dep of the user's project, so Igniter is already on the path. See decisions/2026-06-19-mob-adopt-lives-in-mob_dev.md.

What's here

  • The full adopt task tree (mob.adopt + deps/bridge/screen/mob_app/mob_exs/native[/android,/ios]/finalize), task names unchanged.
  • MobNew.AdoptGuardMobDev.AdoptGuard; shared patcher/generator helpers duplicated into MobDev.Adopt.{Patcher,Generator} (only the closure adopt exercises; mob_new keeps its copies for mob.new).
  • All review fixes from mob_new#8 carried over: ~r//Regex.compile! (rule BLE: Keep hybrid direct-MX + MB test scaffolding as a low-cost re-validation path for future iOS releases #9), standalone AdoptGuard guards on LV sub-installers, orchestrator/Finalize/--python tests, acceptance-test exclusion, dead-accessor cleanup.

Runtime contract

Native trees (--android/--ios) render from mob_new's templates, resolved via :code.priv_dir(:mob_new) — so they require the mob_new archive installed (mix archive.install hex mob_new) alongside mob_dev as a dep. mob_new stays the single source of native templates (no duplication/drift). Elixir-side adoption needs no archive.

Closes the architectural side of mob_new#8 (that PR is closed unmerged; the work lands here).

🤖 Generated with Claude Code

GenericJam and others added 2 commits June 19, 2026 12:43
`mix mob.adopt` installs Mob into an existing Phoenix project — the
Igniter-based install-into-existing counterpart to `mix mob.new`. It was
contributed against mob_new as mob_new#8 by @ken-kost, but it's an Igniter
task that mutates an existing project (exactly like mob_dev's `mob.add_nif`
/ `mob.enable`). mob_new ships as a self-contained Mix archive that can't
carry Igniter (ArchiveSelfContainedTest), so adopt belongs in mob_dev, a
regular Hex dep where Igniter is already on the path.

Relocates the whole task tree (`Mix.Tasks.Mob.Adopt[.{Deps,Bridge,Screen,
MobApp,MobExs,Native[.Android,.Ios],Finalize}]` — task names unchanged) and
`MobNew.AdoptGuard` → `MobDev.AdoptGuard`. The shared patcher/generator
helpers adopt calls are duplicated from mob_new's LiveViewPatcher /
ProjectGenerator into `MobDev.Adopt.Patcher` / `MobDev.Adopt.Generator`
(only the transitive closure adopt exercises); mob_new keeps its own copies
for `mix mob.new`. Phase 5 of build_system_migration.md reunifies them via
Igniter. Native Android/iOS trees still render from mob_new's
priv/templates/mob.new/, resolved via a :mob_new dep / $MOB_NEW_DIR /
~/code/mob_new. Preserves the runtime `Regex.compile!/1` form (rule #9).

Ports the full test suite (adopt sub-task tests, AdoptGuard test, and the
@tag :acceptance E2E adapted to wire mob_dev in as a path: dep + igniter).
Docs: CHANGELOG Unreleased entry, README task table, AGENTS/CLAUDE key
files, and decisions/2026-06-19-mob-adopt-lives-in-mob_dev.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ed contract

mix mob.adopt --android/--ios resolves mob_new's bundled priv via
:code.priv_dir(:mob_new) (same as mix mob.new) from the installed archive,
not a :mob_new dep. Document the dual requirement (mob_new archive + mob_dev
dep) in the task moduledoc, generator moduledoc, error message, CHANGELOG,
and ADR; mob_new stays the single source of native templates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mob.adopt --android/--ios renders from mob_new's templates (single source,
not duplicated). CI now checks out GenericJam/mob_new and sets MOB_NEW_DIR so
the native sub-task tests run against real templates instead of raising.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GenericJam GenericJam merged commit 69f8461 into master Jun 19, 2026
3 checks passed
@GenericJam GenericJam deleted the mob-adopt branch July 5, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant