mix shadix.gen.registry (shadix v0.0.1)

Copy Markdown View Source

Reads lib/shadix/cn.ex, lib/shadix/form.ex, and all lib/shadix/components/*.ex, then writes priv/registry/<name>.json (one per component, plus one each for cn and form).

Hooks and npm_deps are auto-detected by convention:

  • Any phx-hook="ShadixFoo" in a component's source implies a hook whose TypeScript source lives at assets/ts/<snake>.ts (where <snake> is the underscored form of Foo, e.g. ShadixDropdownMenudropdown_menu.ts).
  • npm_deps are inferred by scanning each detected hook's .ts content for bare package imports (from "<pkg>" where <pkg> doesn't start with . or /).

Adding a new component with a hook requires no changes here — just place the .ex file and the matching assets/ts/<snake>.ts.

Usage

mix shadix.gen.registry

Options

  • --out — override the output directory (default: priv/registry)