rally/generator/client

Client package generation.

Assembles the standalone Gleam project that compiles to the browser SPA: gleam.toml, app.gleam (Lustre entry point with per-page TEA loop), transport.gleam (WebSocket FFI bridge), and router.gleam (client-side route parsing). The generated package lives in .generated_clients/.

Types

pub type GeneratedFile {
  GeneratedFile(path: String, content: String)
}

Constructors

  • GeneratedFile(path: String, content: String)

Values

pub fn generate_package(
  routes routes: List(types.ScannedRoute),
  contracts contracts: List(
    #(types.ScannedRoute, types.PageContract),
  ),
  config config: types.ScanConfig,
  server_deps server_deps: dict.Dict(String, tom.Toml),
  transport_ffi_content transport_ffi_content: String,
  has_client_context has_client_context: Bool,
) -> List(GeneratedFile)
pub fn generate_package_with_client_context_contract(
  routes routes: List(types.ScannedRoute),
  contracts contracts: List(
    #(types.ScannedRoute, types.PageContract),
  ),
  config config: types.ScanConfig,
  server_deps server_deps: dict.Dict(String, tom.Toml),
  transport_ffi_content transport_ffi_content: String,
  client_context_contract client_context_contract: option.Option(
    types.ClientContextContract,
  ),
  client_context_module client_context_module: String,
  protocol protocol: String,
) -> List(GeneratedFile)
Search Document