Skip to content

Regenerate the node types from the v2 spec - #1158

Draft
lorisleiva wants to merge 1 commit into
mainfrom
09-17-regenerate_the_node_types_from_the_v2_spec
Draft

lorisleiva wants to merge 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. It is the base of the codama v2 adaptation stack; hand-written package adaptation to the v2 shapes follows in stacked PRs on top, so downstream packages remain red until the stack is green.

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.02.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.
  • 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. No changeset beyond the v2 major entry (this line rides the cut's pre-mode rc).

@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 commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

@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
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