Vendor the Mishka Chelekom Kit engine into your app (no runtime dependency)
The Kit (customize/from Spark DSL) is not a copied component — it's a live macro whose
wrappers call MishkaChelekom.Kit.Runtime at render time and whose use runs Spark transformers
at compile time. So, unlike generated components, it can't ride along on a only: :dev, runtime: false install of mishka_chelekom: the engine has to exist in every build that compiles
or runs your app, prod included.
This task vendors the engine into your app under your own namespace (default <App>.Kit), so
it becomes your code with no mishka_chelekom dependency at compile or run time:
- the 10 engine modules are copied and namespace-rewritten
MishkaChelekom.Kit→<App>.Kit; - the catalog (used only for compile-time "did you mean?" validation) is regenerated as a
self-contained snapshot of the current component names — it no longer reads
mishka_chelekom'spriv/, so a prod build with no chelekom dep still compiles; {:spark, "~> 2.7"}— the only real dependency the engine needs — is added tomix.exsfor you via Igniter (Igniter.Project.Deps.add_dep/3); you never editmix.exsby hand;- a starter
<App>.Kit.Customizationsmodule is scaffolded inside the kit folder (skipped if it already exists), where you write yourcustomizeblocks.
Everything lands under one folder — lib/<app>/kit/ — the vendored engine and your
customizations together.
After this the task has already added spark; the only manual edit is flipping mishka_chelekom
to a dev-only generator, leaving mix.exs like:
{:mishka_chelekom, "~> 0.0.9", only: :dev, runtime: false}, # you flip this to dev-only
{:spark, "~> 2.7"} # added for you by this taskand write your customizations against the vendored engine:
defmodule MyApp.Kit.Customizations do
use MyApp.Kit # the vendored engine, not MishkaChelekom.Kit
components MyAppWeb.Components # where your components live
customize :button do
color :brand, "bg-brand-500! text-white!"
default color: :brand
end
endRe-run the task any time to refresh the vendored engine and the catalog snapshot after adding components.
Example
mix mishka.ui.gen.kit
Options
--moduleor-m- Base module for the vendored engine (default<App>.Kit)--no-deps- Do not add{:spark, "~> 2.7"}tomix.exs--no-starter- Do not scaffold the<App>.Kit.Customizationsstarter module--yes- Apply without prompts
Summary
Functions
Callback implementation for Igniter.Mix.Task.igniter/1.
Functions
Callback implementation for Igniter.Mix.Task.igniter/1.