Dala.Spark.DslVerifier (dala v0.8.0)

Copy Markdown View Source

Comprehensive DSL verification for Dala screen modules.

Validates user-defined screens against the component registry and reports warnings/errors for:

  • Unknown component types
  • Invalid prop names
  • Missing required props
  • Event handler props that are not atoms
  • Invalid attribute types
  • Missing handle_event/3 for declared event handlers
  • Children placed inside leaf components
  • Invalid variant values
  • Deprecated prop usage

Summary

Functions

Format a list of warnings into a human-readable report.

Print warnings to the Mix shell with appropriate coloring.

Verify DSL from raw entity/attribute/handler data (used by compile-time hook).

Verify a single screen module's DSL definition.

Types

warning()

@type warning() :: %{
  type: :error | :warning | :info,
  module: atom(),
  line: non_neg_integer(),
  message: String.t()
}

Functions

format_report(warnings)

@spec format_report([warning()]) :: String.t()

Format a list of warnings into a human-readable report.

verify_from_raw(module, entities, attributes, handlers)

@spec verify_from_raw(module(), [map()], [map()], [map()]) :: [warning()]

Verify DSL from raw entity/attribute/handler data (used by compile-time hook).

verify_module(module)

@spec verify_module(module()) :: [warning()]

Verify a single screen module's DSL definition.

Returns a list of warnings/errors found.