SelectoMix.DomainImport (selecto_mix v0.4.6)

Builds import plans for normalized Selecto domain artifacts.

Import starts with a checkable source preview. Writing is opt-in and guarded: the rendered module must parse, define the expected target module, expose domain/0, and contain no runtime placeholders.

Summary

Types

import_error()

@type import_error() ::
  SelectoMix.DomainExport.artifact_error()
  | {:source_preview_invalid, map()}
  | {:source_preview_not_write_ready, map()}
  | {:target_file_exists, Path.t()}
  | {:mkdir_failed, Path.t(), term()}
  | {:write_failed, Path.t(), term()}

Functions

encode!(plan, opts \\ [])

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

format_error(reason)

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

plan(check, opts \\ [])

@spec plan(
  map(),
  keyword()
) :: map()

plan_file(path, opts \\ [])

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

write_file(path, opts \\ [])

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

write_plan(plan, opts \\ [])

@spec write_plan(
  map(),
  keyword()
) :: {:ok, map()} | {:error, import_error()}