pub fn generate_codecs(
root: &Path,
types: &[BoundaryType],
mode: CodegenMode,
) -> Result<CodecReport, CodegenError>Expand description
Generates (or, in CodegenMode::Check, verifies) the package’s codecs
module src/<package>_codecs.gleam from its boundary types.
The codecs are derived from the types module alone — not the activity
declarations — so this runs before the package’s manifest() is
executed to extract the declarations: the author’s activities module
references codecs.<type>_codec(), which must already compile for the
extraction build to succeed. generate_activities emits the remaining
plumbing (wrappers, worker, golden) once the declarations are known.
§Errors
Returns a CodegenError for an unreadable gleam.toml, a write
failure, or — in check mode — a missing or drifted codecs module.