Skip to content

[2.x] Release package (rc) - #110

Open
codama-releases[bot] wants to merge 1 commit into
mainfrom
changeset-release/main
Open

[2.x] Release package (rc)#110
codama-releases[bot] wants to merge 1 commit into
mainfrom
changeset-release/main

Conversation

@codama-releases

@codama-releases codama-releases Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

main is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on main.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@codama/spec@2.0.0-rc.0

Major Changes

  • #137 dbeced1 Thanks @lorisleiva! - Allow any type node as account data. accountNode.data now accepts every member of the typeNode union — links included — aligning it with eventNode.data, so accounts can be non-structs or reuse a shared defined type via definedTypeLinkNode.

    BREAKING CHANGES

    accountNode.data widens from structTypeNode to typeNode. Consumers can no longer assume account data is a struct; nodes that reference account fields by name (accountFieldValueNode, fieldDiscriminatorNode, PDA seed defaults) are only valid when the data type resolves to a struct, following links — a constraint enforced by validators rather than by the spec shape.

      accountNode({
          name: 'mint',
    -     data: structTypeNode([/* fields copied from the shared type */]),
    +     data: definedTypeLinkNode('mintState'),
      });
  • #136 e6f9c63 Thanks @lorisleiva! - Replace the nested type wrappers with a flat transforms array. The seven wrapper type nodes (fixedSizeTypeNode, sizePrefixTypeNode, preOffsetTypeNode, postOffsetTypeNode, sentinelTypeNode, hiddenPrefixTypeNode, hiddenSuffixTypeNode) and the nestedTypeNode recursive alias are removed. Instead, a new transform category defines one transform node per former wrapper (same attributes minus the inner type), and every member of the typeNode union — links included — carries an optional transforms array, applied in order with the first transform innermost. A type's kind is now stable whether or not it is modified, and attributes that pinned a wrapped inner kind (accountNode.data, enum variant payloads, numeric prefixes) become plain node references.

  • #138 996c20a Thanks @lorisleiva! - Unify enum variants into a single enumVariantTypeNode with an optional data payload. The node also gains an optional docs attribute, closing the gap where enum variants could not carry documentation.

    BREAKING CHANGES

    enumEmptyVariantTypeNode, enumStructVariantTypeNode and enumTupleVariantTypeNode are replaced by enumVariantTypeNode. Absent data is a unit variant; a struct payload gives named fields, a tuple payload gives positional fields, and any other type node is carried as-is. The name, optional discriminator and optional display attributes carry over unchanged; the former struct/tuple attributes both become data. When upgrading, a v1 tuple variant holding exactly one item should unwrap to that single type — the 1-tuple was the workaround spelling of a single-type payload — unless the item is a structTypeNode, tupleTypeNode or definedTypeLinkNode: those shapes determine the variant flavour in data position, so unwrapping them would change the generated API (e.g. V(InlineStruct) becoming V { … }) even though the wire format is identical. Renderers whose target requires a wrapper (e.g. Rust) re-wrap single-type payloads on their side.

      enumTypeNode([
    -     enumEmptyVariantTypeNode('flip'),
    -     enumTupleVariantTypeNode('rotate', tupleTypeNode([numberTypeNode('u32')])),
    -     enumStructVariantTypeNode('move', structTypeNode([/* … */])),
    +     enumVariantTypeNode('flip'),
    +     enumVariantTypeNode('rotate', numberTypeNode('u32')),
    +     enumVariantTypeNode('move', structTypeNode([/* … */])),
      ]);

    The enumVariantTypeNode union no longer exists. The name now identifies the node itself; enumTypeNode.variants is an array of that node, and the registeredTypeNode union references it directly.

  • #139 ab4e253 Thanks @lorisleiva! - Remove the origin attribute from programNode and the programOrigin enumeration. The attribute recorded which toolchain generated the description from a closed whitelist (anchor/shank) that cannot keep up with an open ecosystem, described provenance rather than the program itself, and went stale as IDLs were edited after generation.

    BREAKING CHANGES

    programNode.origin and the programOrigin enumeration are removed. Tools that need provenance metadata can attach it via the universal plugins list instead.

      programNode({
          name: 'myProgram',
    -     origin: 'anchor',
    +     plugins: [pluginNode('anchor')],
          // ...
      });
  • #134 f14dd93 Thanks @lorisleiva! - Restructure the package for the one-major-per-line release model: the root entrypoint now hosts the current major's spec surface from src/spec/ (formerly src/v1/), the ./v1 subpath export is removed (the v1 spec remains available as @codama/spec@^1 from the 1.x line), and the generated artifacts move from v1/ to the repository root (spec.json, schema.json, docs/). The generated docs landing page now links to the docs of previous majors on their maintenance branches.

  • #135 f9cfe95 Thanks @lorisleiva! - Give every node a plugins list via a new base-attribute mechanism. The meta-model's Spec type gains an optional base block (authored with the new defineBase helper) declaring attributes shared by every node; codegen targets append them after each node's declared attributes, so they always serialise last. The spec declares one base attribute — plugins, an optional array of pluginNode — making every node extensible with namespaced, consumer-defined data. instructionNode no longer declares plugins locally (the universal base attribute replaces it), and validate rejects base attributes that collide with declared attributes or carry unresolved references.

  • #105 ca0e36e Thanks @lorisleiva! - Start Codama IDL v2. This is the beginning of the v2 line of the Codama standard; release candidates publish under the rc dist-tag while the spec evolves.

@codama-releases
codama-releases Bot force-pushed the changeset-release/main branch 5 times, most recently from fb001f5 to 9db1f6f Compare August 28, 2026 14:51
@codama-releases
codama-releases Bot force-pushed the changeset-release/main branch 5 times, most recently from 2506bdb to 69c81ec Compare September 1, 2026 08:21
@codama-releases
codama-releases Bot force-pushed the changeset-release/main branch from 69c81ec to e936582 Compare September 1, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants