libero/codegen

Cross-cutting naming helpers used by codegen submodules.

Values

pub fn build_module_alias_map(
  modules: List(String),
) -> dict.Dict(String, String)

Build a resolver function that maps a module path to its import alias. Uses the last segment when unique, or the full underscored path when two or more modules share the same last segment.

pub fn module_to_mjs_path(
  module_path module_path: String,
  package package: String,
) -> String

Convert a Gleam module path to its compiled .mjs bundle path. The package name is the Gleam package that owns the module (determines the top-level directory in the JS build output).

pub fn module_to_underscored(module_path: String) -> String

Convert a Gleam module path like “shared/discount” to a flat underscore-separated alias. e.g. “shared/discount” -> “shared_discount”.

pub fn to_pascal_case(name: String) -> String

Convert a snake_case name to PascalCase.

Search Document