Skip to content

[2.x] Regenerate the node types from the v2 spec - #1158

Merged
lorisleiva merged 1 commit into
mainfrom
09-17-regenerate_the_node_types_from_the_v2_spec
Sep 30, 2026
Merged

lorisleiva merged 1 commit into
mainfrom
09-17-regenerate_the_node_types_from_the_v2_spec

Conversation

@lorisleiva

@lorisleiva lorisleiva commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

This PR repoints @codama-internal/spec-generators at @codama/spec@2.0.0-rc.0 and regenerates @codama/node-types, @codama/nodes and @codama/visitors-core against the v2 spec. The hand-written packages are adapted to the v2 shapes in the follow-up PRs, so they remain red until those land.

Generator changes

  • Single-major generator. Drops the @codama/spec-v1 alias and the frozen v1 generation step. The v1 node types in @codama/upgrade are now a frozen static snapshot (packages/upgrade/src/v1/README.md); the generator only renders the spec on its own branch, and prior majors are ported forward by patch.
  • Base attributes. Appends spec.base (the universal plugins) to every node, so plugins is a TPlugins type parameter on every interface and constructor and is visited by the identity/merge visitors. textNode gains plugins too.
  • docs === text. Both render as string | TextNode and are visited (guarding the string-or-textNode duality). Deletes the v1 Docs alias and the parseDocs/DocsInput array layer.
  • Identifier casing preserved. Constructors brand identifiers via identifierString rather than re-casing them, per v2 dropping the camelCase mandate.
  • CODAMA_VERSION names the spec shape. Pre-release metadata is stripped (2.0.0-rc.0 → 2.0.0); the CodamaVersion type stays strict.
  • Constructor ergonomics. Trailing optional positional parameters fold into the options bag (e.g. constantNode(identifier, type, value, { docs })); pluginNode(namespace, payload?, { plugins }) keeps its payload positional.
  • Branded-string validation. Factories accept plain string for identifier/namespace/path/integer/decimal attributes and validate them through identifierString/namespaceString/pathString/integerString/decimalString, which throw CODAMA_ERROR__INVALID_BRANDED_STRING on a malformed value.
  • Dead meta-model removed. Nested-union / tuple / float handling deleted.

Verification

Generated output type-checks, lints and is idempotent; the frozen v1 snapshot is untouched. The v2 changes are documented in a single major changeset alongside the seeded one from the cut.

@changeset-bot

changeset-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e9dfcfa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@codama/node-types Major
@codama/nodes Major
@codama/visitors-core Major
@codama/errors Major
@codama/cli Patch
@codama/dynamic-codecs Patch
@codama/dynamic-parsers Patch
codama Major
@codama/nodes-from-anchor Patch
@codama/renderers-core Patch
@codama/upgrade Patch
@codama/validators Major
@codama/visitors Major
@codama/dynamic-address-resolution Patch
@codama/dynamic-client Patch
@codama/dynamic-instructions Patch
@codama/fragments Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva
lorisleiva force-pushed the 09-17-regenerate_the_node_types_from_the_v2_spec branch from 7cfb417 to e9dfcfa Compare September 17, 2026 22:03
@lorisleiva lorisleiva changed the title Regenerate the node types from the v2 spec [2.x] Regenerate the node types from the v2 spec Sep 22, 2026
@lorisleiva
lorisleiva marked this pull request as ready for review September 30, 2026 13:46
@lorisleiva
lorisleiva merged commit 08d72e7 into main Sep 30, 2026
2 of 4 checks passed
@lorisleiva
lorisleiva deleted the 09-17-regenerate_the_node_types_from_the_v2_spec branch September 30, 2026 13:50
@lorisleiva
lorisleiva restored the 09-17-regenerate_the_node_types_from_the_v2_spec branch September 30, 2026 13:50
@lorisleiva
lorisleiva deleted the 09-17-regenerate_the_node_types_from_the_v2_spec branch September 30, 2026 14:04
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.

1 participant