From e936582e36519064908a52ebad79b913313a23fd Mon Sep 17 00:00:00 2001 From: "codama-releases[bot]" <318639837+codama-releases[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 09:07:36 +0000 Subject: [PATCH] [2.x] Release package (rc) --- .changeset/{ => pre}/dark-bars-make.md | 0 .changeset/{ => pre}/flat-transforms.md | 0 .changeset/{ => pre}/fresh-nights-fail.md | 0 .changeset/{ => pre}/full-cycles-study.md | 0 .../{ => pre}/one-major-per-line-layout.md | 0 .changeset/{ => pre}/plugins-on-every-node.md | 0 .changeset/{ => pre}/start-codama-v2.md | 0 CHANGELOG.md | 60 +++++++++++++++++++ docs/README.md | 2 +- package.json | 2 +- spec.json | 2 +- src/spec/version.ts | 2 +- 12 files changed, 64 insertions(+), 4 deletions(-) rename .changeset/{ => pre}/dark-bars-make.md (100%) rename .changeset/{ => pre}/flat-transforms.md (100%) rename .changeset/{ => pre}/fresh-nights-fail.md (100%) rename .changeset/{ => pre}/full-cycles-study.md (100%) rename .changeset/{ => pre}/one-major-per-line-layout.md (100%) rename .changeset/{ => pre}/plugins-on-every-node.md (100%) rename .changeset/{ => pre}/start-codama-v2.md (100%) diff --git a/.changeset/dark-bars-make.md b/.changeset/pre/dark-bars-make.md similarity index 100% rename from .changeset/dark-bars-make.md rename to .changeset/pre/dark-bars-make.md diff --git a/.changeset/flat-transforms.md b/.changeset/pre/flat-transforms.md similarity index 100% rename from .changeset/flat-transforms.md rename to .changeset/pre/flat-transforms.md diff --git a/.changeset/fresh-nights-fail.md b/.changeset/pre/fresh-nights-fail.md similarity index 100% rename from .changeset/fresh-nights-fail.md rename to .changeset/pre/fresh-nights-fail.md diff --git a/.changeset/full-cycles-study.md b/.changeset/pre/full-cycles-study.md similarity index 100% rename from .changeset/full-cycles-study.md rename to .changeset/pre/full-cycles-study.md diff --git a/.changeset/one-major-per-line-layout.md b/.changeset/pre/one-major-per-line-layout.md similarity index 100% rename from .changeset/one-major-per-line-layout.md rename to .changeset/pre/one-major-per-line-layout.md diff --git a/.changeset/plugins-on-every-node.md b/.changeset/pre/plugins-on-every-node.md similarity index 100% rename from .changeset/plugins-on-every-node.md rename to .changeset/pre/plugins-on-every-node.md diff --git a/.changeset/start-codama-v2.md b/.changeset/pre/start-codama-v2.md similarity index 100% rename from .changeset/start-codama-v2.md rename to .changeset/pre/start-codama-v2.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe8dec..8193f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # @codama/spec +## 2.0.0-rc.0 + +### Major Changes + +- [#137](https://github.com/codama-idl/spec/pull/137) [`dbeced1`](https://github.com/codama-idl/spec/commit/dbeced1ee4672dfa44dcc76138e2bb2e10c5ec72) Thanks [@lorisleiva](https://github.com/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. + + ```diff + accountNode({ + name: 'mint', + - data: structTypeNode([/* fields copied from the shared type */]), + + data: definedTypeLinkNode('mintState'), + }); + ``` + +- [#136](https://github.com/codama-idl/spec/pull/136) [`e6f9c63`](https://github.com/codama-idl/spec/commit/e6f9c63de4e06b67005aa1700dce1637065afb26) Thanks [@lorisleiva](https://github.com/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](https://github.com/codama-idl/spec/pull/138) [`996c20a`](https://github.com/codama-idl/spec/commit/996c20acbf7d4376beda23b02f3935e90e87020d) Thanks [@lorisleiva](https://github.com/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. + + ```diff + 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](https://github.com/codama-idl/spec/pull/139) [`ab4e253`](https://github.com/codama-idl/spec/commit/ab4e253b73b959df48cdb08eb09ff3b7bb4a3589) Thanks [@lorisleiva](https://github.com/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. + + ```diff + programNode({ + name: 'myProgram', + - origin: 'anchor', + + plugins: [pluginNode('anchor')], + // ... + }); + ``` + +- [#134](https://github.com/codama-idl/spec/pull/134) [`f14dd93`](https://github.com/codama-idl/spec/commit/f14dd9380c99c8d447571726049c84c27cf2876b) Thanks [@lorisleiva](https://github.com/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](https://github.com/codama-idl/spec/pull/135) [`f9cfe95`](https://github.com/codama-idl/spec/commit/f9cfe957deef47d58b6a38fdf3a95adfa35f4026) Thanks [@lorisleiva](https://github.com/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](https://github.com/codama-idl/spec/pull/105) [`ca0e36e`](https://github.com/codama-idl/spec/commit/ca0e36e87c879ad0f02a6c3df0f852a080068707) Thanks [@lorisleiva](https://github.com/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. + ## 1.9.2 ### Patch Changes diff --git a/docs/README.md b/docs/README.md index 966f7fe..d3ade32 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ The canonical Codama node specification. -Spec version: 1.9.2 · Other majors: [v1](https://github.com/codama-idl/spec/blob/1.x/v1/docs/README.md) +Spec version: 2.0.0-rc.0 · Other majors: [v1](https://github.com/codama-idl/spec/blob/1.x/v1/docs/README.md) Pages marked _(abstract)_ document unions: sets of nodes that can be used interchangeably. diff --git a/package.json b/package.json index 42e841b..e0f87a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codama/spec", - "version": "1.9.2", + "version": "2.0.0-rc.0", "description": "The canonical Codama node specification and meta-model", "keywords": [ "codama", diff --git a/spec.json b/spec.json index d17ea51..7d909cb 100644 --- a/spec.json +++ b/spec.json @@ -1,5 +1,5 @@ { - "version": "1.9.2", + "version": "2.0.0-rc.0", "base": { "docs": [ "Attributes shared by every node.", diff --git a/src/spec/version.ts b/src/spec/version.ts index fd0679f..c166a9f 100644 --- a/src/spec/version.ts +++ b/src/spec/version.ts @@ -7,4 +7,4 @@ */ /** The version string of the spec - always equal to the package version. */ -export const SPEC_VERSION = '1.9.2'; +export const SPEC_VERSION = '2.0.0-rc.0';