Shared helper functions for code generation.
Summary
Functions
Builds a TypeScript type name from a resource module. Uses the custom typescript_type_name if defined, otherwise derives from module name.
Converts a PascalCase name to camelCase by lowercasing the first character.
Returns formatted client field names for a resource's public fields.
Determines if a return type is complex (requires special metadata handling).
Determines if a calculation is simple (no arguments, no complex return type). Simple calculations are treated like regular fields in the schema.
Looks up the type of an aggregate field by traversing relationship paths.
Functions
Builds a TypeScript type name from a resource module. Uses the custom typescript_type_name if defined, otherwise derives from module name.
Converts a PascalCase name to camelCase by lowercasing the first character.
Examples
iex> AshTypescript.Codegen.Helpers.camel_case_prefix("Todo")
"todo"
iex> AshTypescript.Codegen.Helpers.camel_case_prefix("OrgTodo")
"orgTodo"
Returns formatted client field names for a resource's public fields.
Collects public attributes, calculations (with field?: true), and
aggregates. Optionally includes relationships when include_relationships: true.
Field names are formatted using the configured output formatter.
Determines if a return type is complex (requires special metadata handling).
Determines if a calculation is simple (no arguments, no complex return type). Simple calculations are treated like regular fields in the schema.
Looks up the type of an aggregate field by traversing relationship paths.