AshCommanded.Commanded.Transformers.GenerateCommandedApplication (AshCommanded v0.1.0)

View Source

Generates a Commanded.Application module based on the configuration in the application section.

This transformer:

  1. Extracts application configuration from the DSL
  2. Generates a module that uses Commanded.Application
  3. Configures it with the options from the application section
  4. Includes supervision tree integration if specified

Summary

Functions

Callback implementation for Spark.Dsl.Transformer.before?/1.

Transforms the DSL state by adding the generated Commanded application module.

Functions

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.

before?(_)

Callback implementation for Spark.Dsl.Transformer.before?/1.

transform(dsl)

@spec transform(Spark.Dsl.Transformer.t()) ::
  {:ok, Spark.Dsl.Transformer.t()} | {:error, term()}

Transforms the DSL state by adding the generated Commanded application module.

Parameters

  • dsl - The DSL state to transform.

Returns

The transformed DSL state with the generated Commanded application module added.

Examples

iex> transform(dsl)
%{dsl | modules: dsl.modules ++ [generated_module_ast]}