AshTypescript.Manifest.Verifiers.VerifyRpcWarnings (ash_typescript v0.18.2)

Copy Markdown View Source

Emits compile-time warnings for likely-misconfigured RPC setups.

Reports:

  • Resources that carry the AshTypescript.Resource extension but aren't listed in any domain's typescript_rpc block — they won't get TypeScript types generated.
  • Resources reachable from RPC resources (via attribute types or relationships) that aren't themselves declared as RPC resources — they won't have TS types either, and any references will fall back to inline shapes.

Each warning is gated by an application-level toggle:

  • config :ash_typescript, warn_on_missing_rpc_config: true (default)
  • config :ash_typescript, warn_on_non_rpc_references: true (default)

Runs once per compile of the manifest module, so there's no need for the per-domain deduplication hack the previous Rpc-DSL-level verifier used. Always returns :ok — warnings are informational, not errors.

Emission deliberately uses IO.puts(:stderr, ...) rather than IO.warn/1. This verifier runs both during compilation of the manifest module and from Orchestrator.generate/2 at codegen time. In the compile context IO.warn/1 registers a compiler diagnostic, which fails mix compile --warnings-as-errors — and leaving a resource out of typescript_rpc is often deliberate, so it must not break the build.