Major Changes
-
#199
d9777f9Thanks @codama-releases! - Start major 4. Release candidates publish under thercdist-tag while this major is in development. -
#200
f21f004Thanks @lorisleiva! - Render IDLs of the Codama v2 standard. The renderer now depends on the v2 releases of@codama/nodes,@codama/visitors-coreand@codama/errors, and on@codama/fragmentsinstead of@codama/renderers-core.BREAKING CHANGES
Codama v2 IDLs are required. The renderer only accepts trees of the v2 standard, and rendering a root node whose
versionis not a 2.x version throwsCODAMA_ERROR__VERSION_MISMATCH. Upgrade v1 IDLs with thecodama upgradecommand, or with@codama/upgradeas abeforevisitor of your Codama configuration.{ "idl": "program/idl.json", "before": ["@codama/upgrade"], "scripts": { "rust": { "from": "@codama/renderers-rust", "args": ["clients/rust"] } } }Node.js 22.12.0 or later is required, as Codama v2 does.
Account and instruction data must be structs. Instruction arguments are read from the
dataof the instruction. Account or instruction data of any other type, e.g. a link to a defined type, which only native v2 IDLs can express, throwsCODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE.Names are derived from identifiers of any casing. Node identifiers keep their original casing in v2, e.g.
transfer_tokensfrom an Anchor IDL, and every generated name goes through the casing helpers of@codama/fragments/casing. Fields of struct values now use their snake_case form, matching the fields of the generated structs.Option keys must match identifiers exactly. Keys of
linkOverridesandtraitOptions.overridesare compared with node identifiers as they are, e.g.Counterrather thancounterfor a type from an Anchor IDL.The
resolverslink override is removed, since resolvers are no longer value nodes in Codama v2 and the renderer never rendered them.