Scaffolds a new wrapper component end-to-end:
- Inserts a function-component skeleton in the target module
(
<App>Web.CoreComponentsor<App>Web.CompositeComponents). The skeleton already satisfies the wrapper contract:data-component,attr :rest, :global, declared slot. - Inserts a
component/3registration in<App>Web.DesignManifest(immediately beforedef daisy_overrides, falling back to the module's closingend). - Inserts a
<name>_preview/1function in<App>Web.DesignPreviews, adding analiasline for the host module if necessary.
After the task runs, mix joby_kit.lint should report clean for the
new component.
Usage
mix joby_kit.gen.wrapper modal --daisy modal
mix joby_kit.gen.wrapper chat_panel --category compositeOptions
--category—core(default) orcomposite.--daisy— daisyUI primitive id (seeJobyKit.DaisyCatalogue). Only meaningful for--category core. Pre-populates the root element's class with the primitive's daisy class string.--manifest— manifest module name. Defaults to<App>Web.DesignManifest.--web— web module name. Defaults to<App>Webderived frommix.exs.
Conventions
Component names must be snake_case. The function name and the
preview name (<name>_preview) must not already exist in the
respective files; the task fails loudly rather than overwriting.
Domain composites
Domain composites (category: :domain) live in host-specific modules
and aren't supported by the generator yet — register those by hand or
use this task with --category composite and re-categorize the
manifest entry afterward.