AshTypescript.TypedChannel.Verifiers.VerifyTypedChannel (ash_typescript v0.18.1)

Copy Markdown View Source

Verifies that typed channel configurations are valid.

Checks:

  1. All declared events exist as publications on their respective resources.
  2. Event names are unique across all resources in the channel.
  3. Publications are marked public?: true (warning if not).
  4. Publications have returns set — either auto-derived via transform :calc or explicitly declared (warning if not — TypeScript type falls back to unknown).

Checks 1 and 2 are hard errors. Checks 3 and 4 write to stderr and are each gated by an application-level toggle (mirroring VerifyRpcWarnings):

  • config :ash_typescript, warn_on_non_public_publications: true (default)
  • config :ash_typescript, warn_on_missing_channel_returns: true (default)

Checks 3 and 4 deliberately use IO.puts(:stderr, ...) rather than IO.warn/1. This verifier runs during compilation of the channel module, where IO.warn/1 would register a compiler diagnostic and so fail mix compile --warnings-as-errors. A non-public? publication or a missing returns may well be intentional, so it must not break the build.