From 7754b1bee756abe2051348efbf312f076cf87fae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:51:48 +0000 Subject: [PATCH] Release package --- .changeset/happy-parents-know.md | 9 --------- .changeset/hip-snakes-sin.md | 13 ------------ .changeset/keen-zebras-melt.md | 9 --------- .changeset/pre.json | 15 -------------- .changeset/release-1-6-0.md | 5 ----- .changeset/spotty-cases-smash.md | 7 ------- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++ package.json | 2 +- 8 files changed, 35 insertions(+), 59 deletions(-) delete mode 100644 .changeset/happy-parents-know.md delete mode 100644 .changeset/hip-snakes-sin.md delete mode 100644 .changeset/keen-zebras-melt.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/release-1-6-0.md delete mode 100644 .changeset/spotty-cases-smash.md diff --git a/.changeset/happy-parents-know.md b/.changeset/happy-parents-know.md deleted file mode 100644 index 1f116ea..0000000 --- a/.changeset/happy-parents-know.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@codama/spec': minor ---- - -Add a `'docs'` `TypeExpr` kind for documentation arrays. The `docs()` semantic alias now returns `{ kind: 'docs' }` rather than desugaring to `array(string())`, preserving the documentation intent in the encoded spec. Each codegen target maps the new kind to the language's idiomatic documentation array type (e.g. `Array` in TypeScript, `Vec` in Rust). - -Expose the authoring API at the new `@codama/spec/api` subpath. Consumers building hand-authored specs (typically test fixtures or future tooling) can now import `defineNode`, `attribute`, `optionalAttribute`, primitives (`u32`, `string`, `boolean`, …), compounds (`array`, `tuple`), `defineUnion`, `defineEnumeration`, and `variant` directly. The default `@codama/spec` entrypoint continues to expose the latest version's spec data and types only. - -The `gen-ts-node-types` generator now emits arrays as `Array` rather than `T[]`, so a literal-union element type (e.g. `array(literalUnion(true, 'either'))`) doesn't need extra parentheses to preserve precedence with `|`. The generator also collapses `literalUnion(true, false, …)` to `boolean | …` when both `true` and `false` are present — a TypeScript-only readability normalisation; the encoded spec keeps the explicit `true | false` representation so other codegen targets can still emit a multi-variant enum. diff --git a/.changeset/hip-snakes-sin.md b/.changeset/hip-snakes-sin.md deleted file mode 100644 index 68ca934..0000000 --- a/.changeset/hip-snakes-sin.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@codama/spec': minor ---- - -Reshape the spec meta-model into per-category groups, replace the top-level `nestedTypeNodeWrappers` list with a flexible `NestedUnionSpec` construct, and type all `docs?` fields as `readonly string[]`. - -`Spec` no longer carries flat `nodes`, `unions`, `enumerations`, and `nestedTypeNodeWrappers` lists. Instead, `Spec.categories: readonly CategorySpec[]` groups related entities together — each `CategorySpec` carries its own `nodes`, `unions`, `enumerations`, and `nestedUnions`. Category names are arbitrary strings; codegen targets pick how to honour them. The v1 spec uses `'type'`, `'value'`, `'link'`, `'pdaSeed'`, `'count'`, `'discriminator'`, `'contextualValue'`, `'shared'`, and `'topLevel'`. - -`NestedUnionSpec` replaces the implicit `nestedTypeNodeWrappers` list with an explicit, named recursive type alias. Each `NestedUnionSpec` carries a `name`, a `base: TypeExpr`, and a `wrappers: readonly string[]` list. The v1 spec declares one such alias (`NestedTypeNode`) under the `type` category. The `nestedTypeNode(name)` `TypeExpr` constructor is renamed to `nestedUnion(alias, innerKind)` to make the alias reference explicit, opening the door to further recursive families in future spec versions. - -All `docs?` fields on `AttributeSpec`, `NodeSpec`, `UnionSpec`, `EnumerationSpec`, `EnumerationVariantSpec`, `CategorySpec`, and `NestedUnionSpec` now take `readonly string[]` — one paragraph per array element. This brings the meta-model into alignment with the generated `Docs = Array` shape and lets codegen targets render multi-paragraph documentation natively. - -New authoring helpers: `defineCategory(name, options)` and `defineNestedUnion(name, options)`. The `gen-ts-node-types` generator is updated to walk the new structure, renders one alias file per `NestedUnionSpec`, and maps each spec category to its TypeScript-monorepo subdirectory via a small renderer-side table. diff --git a/.changeset/keen-zebras-melt.md b/.changeset/keen-zebras-melt.md deleted file mode 100644 index d7eb3b2..0000000 --- a/.changeset/keen-zebras-melt.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@codama/spec': minor ---- - -Two spec changes that adjust the encoded shape: - -- **Identifier casing.** All spec identifiers are now camelCase. Enumerations, unions, and nested-union aliases that were PascalCase (`TypeNode`, `BytesEncoding`, `NestedTypeNode`, …) are renamed to camelCase (`typeNode`, `bytesEncoding`, `nestedTypeNode`, …). `validate.ts` now enforces camelCase on unions, enumerations, and nested unions alongside the existing node-kind check. - -- **New `address` type-expression kind.** A new primitive `{ kind: 'address' }` (plus an `address()` factory) replaces `string()` on attributes that hold a Solana address. Applied to `programNode.publicKey`, `publicKeyValueNode.publicKey`, and `pdaNode.programId`. Attribute names and node kinds are unchanged; only the type expression changes. Codegen targets can now render these as a dedicated address type (e.g. `Address` in Rust) rather than collapsing to a generic string. diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index e0ff293..0000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "mode": "exit", - "tag": "rc", - "initialVersions": { - "@codama/spec": "1.6.0-rc.0" - }, - "changesets": [ - "bold-spiders-rest", - "happy-parents-know", - "hip-snakes-sin", - "keen-zebras-melt", - "spotty-cases-smash", - "verify-trusted-publishing" - ] -} diff --git a/.changeset/release-1-6-0.md b/.changeset/release-1-6-0.md deleted file mode 100644 index 35892e7..0000000 --- a/.changeset/release-1-6-0.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@codama/spec': minor ---- - -First stable release of `@codama/spec`. The v1 spec shape settled across the `1.6.0-rc.*` line is now published as `1.6.0`. Reference implementations in [TypeScript](https://github.com/codama-idl/codama) and [Rust](https://github.com/codama-idl/codama-rs) consume this package to render their own node types, factories, visitors, and validators from a single source of truth. Future Codama majors will land alongside the `v1` entrypoint as `v2`, `v3`, …, with the default `@codama/spec` entrypoint tracking the latest stable. diff --git a/.changeset/spotty-cases-smash.md b/.changeset/spotty-cases-smash.md deleted file mode 100644 index 14ecf18..0000000 --- a/.changeset/spotty-cases-smash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@codama/spec': patch ---- - -Disable `splitting` in the tsup build config. - -Multi-entry ESM builds (`index` + `v1`) were causing tsup's automatic code splitting to lift shared modules into hashed `chunk-*.mjs` files. Those chunks were not listed in `package.json#files`, so the published tarball shipped entrypoints that re-exported from missing modules and ESM consumers failed at import time with `Cannot find module '...chunk-XXXXX.node.mjs'`. Disabling splitting makes each entry inline its dependencies and the published `dist/` self-contained. diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a452e..3e0c7ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # @codama/spec +## 1.6.0 + +### Minor Changes + +- [`4a46ebf`](https://github.com/codama-idl/spec/commit/4a46ebf6ef88d9e170e7174fcb104bd93fd389f3) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add a `'docs'` `TypeExpr` kind for documentation arrays. The `docs()` semantic alias now returns `{ kind: 'docs' }` rather than desugaring to `array(string())`, preserving the documentation intent in the encoded spec. Each codegen target maps the new kind to the language's idiomatic documentation array type (e.g. `Array` in TypeScript, `Vec` in Rust). + + Expose the authoring API at the new `@codama/spec/api` subpath. Consumers building hand-authored specs (typically test fixtures or future tooling) can now import `defineNode`, `attribute`, `optionalAttribute`, primitives (`u32`, `string`, `boolean`, …), compounds (`array`, `tuple`), `defineUnion`, `defineEnumeration`, and `variant` directly. The default `@codama/spec` entrypoint continues to expose the latest version's spec data and types only. + + The `gen-ts-node-types` generator now emits arrays as `Array` rather than `T[]`, so a literal-union element type (e.g. `array(literalUnion(true, 'either'))`) doesn't need extra parentheses to preserve precedence with `|`. The generator also collapses `literalUnion(true, false, …)` to `boolean | …` when both `true` and `false` are present — a TypeScript-only readability normalisation; the encoded spec keeps the explicit `true | false` representation so other codegen targets can still emit a multi-variant enum. + +- [`70febc6`](https://github.com/codama-idl/spec/commit/70febc6f3ffbdad235c01d120e521fb2051aab16) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Reshape the spec meta-model into per-category groups, replace the top-level `nestedTypeNodeWrappers` list with a flexible `NestedUnionSpec` construct, and type all `docs?` fields as `readonly string[]`. + + `Spec` no longer carries flat `nodes`, `unions`, `enumerations`, and `nestedTypeNodeWrappers` lists. Instead, `Spec.categories: readonly CategorySpec[]` groups related entities together — each `CategorySpec` carries its own `nodes`, `unions`, `enumerations`, and `nestedUnions`. Category names are arbitrary strings; codegen targets pick how to honour them. The v1 spec uses `'type'`, `'value'`, `'link'`, `'pdaSeed'`, `'count'`, `'discriminator'`, `'contextualValue'`, `'shared'`, and `'topLevel'`. + + `NestedUnionSpec` replaces the implicit `nestedTypeNodeWrappers` list with an explicit, named recursive type alias. Each `NestedUnionSpec` carries a `name`, a `base: TypeExpr`, and a `wrappers: readonly string[]` list. The v1 spec declares one such alias (`NestedTypeNode`) under the `type` category. The `nestedTypeNode(name)` `TypeExpr` constructor is renamed to `nestedUnion(alias, innerKind)` to make the alias reference explicit, opening the door to further recursive families in future spec versions. + + All `docs?` fields on `AttributeSpec`, `NodeSpec`, `UnionSpec`, `EnumerationSpec`, `EnumerationVariantSpec`, `CategorySpec`, and `NestedUnionSpec` now take `readonly string[]` — one paragraph per array element. This brings the meta-model into alignment with the generated `Docs = Array` shape and lets codegen targets render multi-paragraph documentation natively. + + New authoring helpers: `defineCategory(name, options)` and `defineNestedUnion(name, options)`. The `gen-ts-node-types` generator is updated to walk the new structure, renders one alias file per `NestedUnionSpec`, and maps each spec category to its TypeScript-monorepo subdirectory via a small renderer-side table. + +- [`cb59ce7`](https://github.com/codama-idl/spec/commit/cb59ce770097319f5173f6bb5dd38751047bdff2) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Two spec changes that adjust the encoded shape: + + - **Identifier casing.** All spec identifiers are now camelCase. Enumerations, unions, and nested-union aliases that were PascalCase (`TypeNode`, `BytesEncoding`, `NestedTypeNode`, …) are renamed to camelCase (`typeNode`, `bytesEncoding`, `nestedTypeNode`, …). `validate.ts` now enforces camelCase on unions, enumerations, and nested unions alongside the existing node-kind check. + + - **New `address` type-expression kind.** A new primitive `{ kind: 'address' }` (plus an `address()` factory) replaces `string()` on attributes that hold a Solana address. Applied to `programNode.publicKey`, `publicKeyValueNode.publicKey`, and `pdaNode.programId`. Attribute names and node kinds are unchanged; only the type expression changes. Codegen targets can now render these as a dedicated address type (e.g. `Address` in Rust) rather than collapsing to a generic string. + +- [#20](https://github.com/codama-idl/spec/pull/20) [`55d06e2`](https://github.com/codama-idl/spec/commit/55d06e29387f13d3b0aac0ab0781a43df6c4d3fc) Thanks [@lorisleiva](https://github.com/lorisleiva)! - First stable release of `@codama/spec`. The v1 spec shape settled across the `1.6.0-rc.*` line is now published as `1.6.0`. Reference implementations in [TypeScript](https://github.com/codama-idl/codama) and [Rust](https://github.com/codama-idl/codama-rs) consume this package to render their own node types, factories, visitors, and validators from a single source of truth. Future Codama majors will land alongside the `v1` entrypoint as `v2`, `v3`, …, with the default `@codama/spec` entrypoint tracking the latest stable. + +### Patch Changes + +- [`f345ba3`](https://github.com/codama-idl/spec/commit/f345ba3c7f6800e16c1afca8656edca8c8c7ece1) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Disable `splitting` in the tsup build config. + + Multi-entry ESM builds (`index` + `v1`) were causing tsup's automatic code splitting to lift shared modules into hashed `chunk-*.mjs` files. Those chunks were not listed in `package.json#files`, so the published tarball shipped entrypoints that re-exported from missing modules and ESM consumers failed at import time with `Cannot find module '...chunk-XXXXX.node.mjs'`. Disabling splitting makes each entry inline its dependencies and the published `dist/` self-contained. + ## 1.6.0-rc.6 ### Minor Changes diff --git a/package.json b/package.json index b48b56e..4a2687e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codama/spec", - "version": "1.6.0-rc.6", + "version": "1.6.0", "description": "The canonical Codama node specification and meta-model", "keywords": [ "codama",