AshTypescript.Manifest.Decorator (ash_typescript v0.18.2)

Copy Markdown View Source

Walks a freshly generated %Ash.Info.Manifest{} once and populates custom.ash_typescript on every struct that carries ash_typescript-owned data:

  • manifest.resources[i].custom.ash_typescript — for resources that use the AshTypescript.Resource extension. Captures the field_names and argument_names DSL mappings (forward + reverse) plus pre-computed formatted client names for the built-in formatters.

  • manifest.types[i].resource.custom.ash_typescript — same shape as above, applied to the embedded %Manifest.Resource{} carried inside each kind: :embedded_resource type entry.

  • manifest.types[i].custom.ash_typescript — for Ash.Type.NewType / TypedStruct / custom type modules that export typescript_field_names/0.

  • manifest.entrypoints[i].custom.ash_typescript — mirrors the config.ash_typescript payload that RpcConfigCollector passed into Ash.Info.Manifest.Generator.generate/1, plus pre-computed metadata field-name mappings derived from rpc_action.metadata_field_names.

Runtime callers should read decorated data via AshTypescript.Manifest.Custom rather than poking at :custom directly.

This module is pure: given a manifest in, returns a manifest out. All module-level information it needs (Spark DSL state on resource modules, typescript_field_names/0 callbacks) is queried via the module atoms that the manifest already references — the caller (BuildManifest) is responsible for ensuring every referenced module is compiled before decoration runs.

Summary

Functions

Returns a decorated copy of manifest.

Functions

decorate(manifest)

@spec decorate(Ash.Info.Manifest.t()) :: Ash.Info.Manifest.t()

Returns a decorated copy of manifest.