SelectoMix (selecto_mix v0.4.2)
Mix tasks and tooling for automatic Selecto configuration generation.
SelectoMix provides utilities to automatically generate Selecto domain configurations from Ecto schemas, preserve user customizations across regenerations, 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
- Customization Preservation: Maintains user modifications when regenerating files
- Igniter Integration: Uses modern Elixir project modification tools
- Persistence Scaffolds: Generates saved views, saved view configs, exported views, and filter set persistence modules
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 persistence
Getting Started
- Add SelectoMix to your project dependencies
- Run
mix selecto.installto setup basic structure - Generate domains with
mix selecto.gen.domain --all - Customize the generated domains as needed
- Re-run
mix selecto.gen.domainafter schema changes - customizations will be preserved
Configuration
You can configure SelectoMix in your config/config.exs:
config :selecto_mix,
output_dir: "lib/my_app/selecto_domains",
default_associations: true,
preserve_customizations: 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 (overwrites customizations)
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.