SelectoMix (selecto_mix v0.4.6)
Mix tasks and tooling for automatic Selecto configuration generation.
SelectoMix provides utilities to automatically generate Selecto domain configurations from Ecto schemas, create overlay modules for app-specific customizations, and scaffold related SelectoComponents persistence helpers.
Key Features
- Automatic Schema Discovery: Finds and introspects all Ecto schemas in your project
- Intelligent Configuration Generation: Creates comprehensive Selecto domains with suggested defaults
- Overlay Customization: Keeps app-specific modifications outside generated base files
- Igniter Integration: Uses modern Elixir project modification tools
- Persistence Scaffolds: Generates saved views, saved view configs, exported views, and filter set persistence modules
- Domain Artifacts: Exports normalized domain JSON artifacts for tools and round-trip checks
- Domain Import Plans: Checks import/readback plans and can write validated, placeholder-free domain previews from normalized artifacts
- Domain Inspection: Generates Studio/tooling inspection JSON from normalized domain artifacts
- Domain Diagrams: Generates Mermaid diagrams from domain inspection artifacts
- Domain Docs: Generates Markdown references from normalized domain artifacts
- Studio Host Artifacts: Can generate trusted host-app inspection
providers for
SelectoStudio.DomainArtifacts
Main Mix Tasks
mix selecto.gen.domain- Generate Selecto domain configurations from Ecto schemasmix selecto.install- Install Selecto dependencies and setup project structuremix selecto.gen.saved_views- Generate persistent saved views supportmix selecto.gen.saved_view_configs- Generate per-view-type saved config persistencemix selecto.gen.exported_views- Generate exported iframe view persistencemix selecto.gen.filter_sets- Generate filter set persistencemix selecto.domain.export- Export normalized domain JSON artifactsmix selecto.domain.check- Check normalized domain JSON artifactsmix selecto.domain.import- Check import plans or write validated previews for normalized artifactsmix selecto.domain.inspect- Inspect normalized domain JSON artifactsmix selecto.domain.describe- Generate Studio/tooling inspection JSON from normalized artifactsmix selecto.domain.diagram- Generate Mermaid diagrams from domain inspection artifactsmix selecto.domain.diff- Diff normalized domain JSON artifactsmix selecto.domain.docs- Generate Markdown docs from normalized domain JSON artifacts
Getting Started
- Add SelectoMix to your project dependencies
- Run
mix selecto.installto setup basic structure - Generate domains with
mix selecto.gen.domain --all - Put app-specific changes in the generated overlay modules
- Re-run
mix selecto.gen.domain --forceafter schema changes to refresh generated base files
Configuration
You can configure SelectoMix in your config/config.exs:
config :selecto_mix,
output_dir: "lib/my_app/selecto_domains",
default_associations: trueExample Usage
# Generate domain for a single schema
mix selecto.gen.domain Blog.Post
# Generate for all schemas in a context
mix selecto.gen.domain Blog.*
# Generate for all schemas with associations
mix selecto.gen.domain --all --include-associations
# Force regeneration of the generated base file
mix selecto.gen.domain Blog.Post --force
Summary
Functions
Get configuration for SelectoMix.
Get the default output directory for generated domains.
Check if Selecto dependencies are available.
List all available Ecto schemas in the current project.
Validate a schema module exists and is an Ecto schema.
Get the version of SelectoMix.
Functions
Get configuration for SelectoMix.
Get the default output directory for generated domains.
Check if Selecto dependencies are available.
List all available Ecto schemas in the current project.
Validate a schema module exists and is an Ecto schema.
Get the version of SelectoMix.