AshTypescript. TypedChannel. Verifiers. VerifyTypedChannel
(ash_typescript v0.18.2)
Copy Markdown
View Source
Verifies that typed channel configurations are valid.
Checks:
- All declared events exist as publications on their respective resources.
- Event names are unique across all resources in the channel.
- Publications are marked
public?: true(warning if not). - Publications have
returnsset — either auto-derived viatransform :calcor explicitly declared (warning if not — TypeScript type falls back tounknown).
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.