AshTypescript.Codegen.Orchestrator (ash_typescript v0.17.3)

Copy Markdown View Source

Coordinates multi-file TypeScript code generation with full cross-file deduplication.

Each piece of generated code lives in exactly one file:

  • ash_types.ts — type aliases, resource schemas, filter types, utility types, custom imports,
                  channel payload type aliases and events maps
  • ash_zod.ts — ALL Zod schemas: resource-level + per-action RPC + per-route controller
  • ash_rpc.ts — imports types from ash_types.ts (no Zod), hook types, helper functions,
                per-action input types, per-action result types, per-action RPC functions
  • routes.ts — imports types from ash_types.ts (no Zod), static code, per-route path
               helpers, per-route input types, per-route action functions
  • ash_typed_channels.ts — imports types from ash_types.ts, channel subscription helper functions
  • namespace/*.ts — re-exports: functions + types from ash_rpc.ts, Zod schemas from ash_zod.ts

Returns a map of %{file_path => content} for all generated files.

Summary

Functions

Generates all TypeScript files for the application.

Functions

generate(otp_app, opts \\ [])

Generates all TypeScript files for the application.

Parameters

  • otp_app - The OTP application name
  • opts - Options keyword list including hook configuration and endpoints

Returns

  • {:ok, %{path => content}} - Map of file paths to generated content
  • {:error, message} - Error message if generation fails