SelectoMix.DomainExport (selecto_mix v0.4.6)

Builds JSON-ready artifacts for normalized Selecto domains.

The exporter intentionally calls into Selecto.Domain.normalize/1 at runtime so selecto_mix can stay a tooling package while host projects provide the Selecto version they are using.

Summary

Types

artifact_error()

@type artifact_error() ::
  export_error()
  | {:read_failed, Path.t(), term()}
  | {:decode_failed, Path.t(), term()}
  | :invalid_artifact
  | {:invalid_artifact_format, term()}
  | {:unsupported_artifact_version, term()}
  | :missing_artifact_domain
  | {:invalid_artifact_domain, term()}

export_error()

@type export_error() ::
  :selecto_domain_unavailable
  | {:module_not_loaded, module()}
  | {:missing_domain_function, module()}
  | {:normalization_failed, term()}
  | {:invalid_normalizer_result, term()}

Functions

check_artifact(artifact, opts \\ [])

@spec check_artifact(
  map(),
  keyword()
) :: {:ok, map()} | {:error, artifact_error()}

check_file(path, opts \\ [])

@spec check_file(
  Path.t(),
  keyword()
) :: {:ok, map()} | {:error, artifact_error()}

diff(left, right)

@spec diff(map(), map()) :: map()

diff_files(left_path, right_path, opts \\ [])

@spec diff_files(Path.t(), Path.t(), keyword()) ::
  {:ok, map()} | {:error, artifact_error()}

encode!(artifact, opts \\ [])

@spec encode!(
  map(),
  keyword()
) :: String.t()

export(domain_module, opts \\ [])

@spec export(
  String.t() | module(),
  keyword()
) :: {:ok, map()} | {:error, artifact_error()}

format_error(arg1)

@spec format_error(artifact_error()) :: String.t()

json_safe(value)

@spec json_safe(term()) :: term()

summary(check)

@spec summary(map()) :: map()

summary_file(path, opts \\ [])

@spec summary_file(
  Path.t(),
  keyword()
) :: {:ok, map()} | {:error, artifact_error()}