PhoenixAssets.Types (PhoenixAssets v0.1.0)

View Source

Integration plugin that generates TypeScript row types from Ash resources.

Reads the type declarations from the module passed as types: (see PhoenixAssets.Types.Schema), runs them through PhoenixAssets.Types.Walker, and emits types.ts. Generation is skipped (with a doctor warning) when Ash is not loaded, so the stack package stays usable without it.

The field-policy safety net

Ash field policies are dynamic and cannot be evaluated at generation time, so the walker uses a deterministic exposure model (public attributes, sensitive excluded, :omit/:expose applied). To catch the data-leak class of mistake, this plugin adds a doctor check per type that warns when an exposed field also appears in one of the resource's field policies -- prompting a deliberate :omit decision.

Summary

Functions

dev_processes(_, _)

Callback implementation for PhoenixAssets.Plugin.dev_processes/2.

graph_entries(_, _)

Callback implementation for PhoenixAssets.Plugin.graph_entries/2.

name()

Callback implementation for PhoenixAssets.Plugin.name/0.

vite_config(_, _)

Callback implementation for PhoenixAssets.Plugin.vite_config/2.