Generates the frontend layer for a Caravela domain: a trio of LiveView modules (index/show/form) per entity, plus typed Svelte components and a TypeScript interfaces file.
mix caravela.gen.live MyApp.Domains.LibraryGenerated files (single-version, non-tenant example):
lib/my_app_web/live/library/book_live/{index,show,form}.ex
assets/svelte/library/{BookIndex,BookShow,BookForm}.svelte
assets/svelte/types/library.tsEvery LiveView mounts its Svelte component via <LiveSvelte.render>,
and delegates to the generated context module for CRUD calls —
authorization, hooks, and multi-tenant scoping flow through for free.
Requires LiveSvelte in the consumer app:
{:live_svelte, "~> 0.19"}After mix deps.get, follow the LiveSvelte docs to wire it into
assets/js/app.js.
Flags:
--dry-run— print the generated files without writing--output DIR— write underDIRinstead of the project root--force— overwrite existing files without prompting--with-domain— also emit aCaravela.Live.Domaincompanion module per entity and generateform.exfrom the Template-backed variant. Useful as an onramp to theCaravela.Live.*runtime.
Regeneration preserves content below the # --- CUSTOM --- /
<!-- --- CUSTOM --- --> marker in every file.