Integrate @codama/spec@1.8.0#1023
Merged
Merged
Conversation
This PR integrates `@codama/spec@1.8.0`, threading the new `pluginNode` and `json` type expression through the TypeScript reference implementation. The node-types, nodes, and visitors-core packages are regenerated: `pluginNode` gains its interface and `pluginNode(name, payload?)` factory, `instructionNode` gains an optional `plugins` array, and the `json` type expression renders as `unknown`. A `PluginNode` visitor test fixture is added to satisfy the coverage gate. All changes are additive and optional.
🦋 Changeset detectedLatest commit: 4596cd3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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
marked this pull request as ready for review
July 14, 2026 12:25
Member
Author
trevor-cortex
approved these changes
Jul 14, 2026
trevor-cortex
left a comment
There was a problem hiding this comment.
Summary
Integrates @codama/spec@1.8.0 and threads the new pluginNode + json type expression through the TS reference implementation:
@codama/node-types: addsPluginNodeinterface (kind: 'pluginNode',name: CamelCaseString, optionalpayload: unknown); adds it to theNodeunion; adds optionalTPluginsgeneric +plugins?field onInstructionNode; bumpsCodamaVersionto'1.8.0'.@codama/nodes: addspluginNode(name, payload?)factory (freezes result, camelCases the name, omitspayloadwhen undefined); threadsTPluginsthroughinstructionNode; registers'pluginNode'inREGISTERED_NODE_KINDS; bumpsCODAMA_VERSION.@codama/spec-generators: bumps@codama/specdep to1.8.0; maps the newjsontype expression tounknownin both nodeTypes and nodes typeExpr fragments; registerspluginNodepositional args (name,payload) inNODE_CONFIGS; appendspluginsto the instruction generic-param order and to both merge/identity visitor walk orders.@codama/visitors-core: regeneratesidentityVisitor(recursively visitsplugins, filters with'pluginNode'),mergeVisitor(flatMapsplugins), andnodeTestPaths(addspluginNode: 'PluginNode'). Adds aPluginNode.test.tsfixture covering merge/identity/deleteNodes/debugString.- Changeset:
@codama/nodesminor.
All additions are optional and backward-compatible with existing IDLs.
Things to watch out for
- Ordering is consistent everywhere.
pluginsis placed last inInstructionNode's generics, inGENERIC_PARAM_ORDER, in bothMERGE_VISITOR_WALK_ORDERandIDENTITY_VISITOR_WALK_ORDER, and afterdisplayin theinstructionNodefactory spread. Good — matches the existing convention of appending new optional fields at the end. - Opaque payload.
pluginNode.payloadisunknownby design (JSDoc: "Codama itself treats the payload as opaque"). It is not deep-frozen or cloned by the factory — consumers passing mutable objects will see them shared. That looks intentional given the "carried through the graph verbatim" contract, but worth noting for downstream renderers. - Visitor filter tag.
identityVisitorfilters withremoveNullAndAssertIsNodeFilter('pluginNode'), matching the registered kind — correct. - Debug string.
PluginNodehits thedefaultbranch ofgetDebugStringVisitor'sgetNodeDetails, which returns[node.name]since'name' in node. So the test's expectedpluginNode [anchor]is right, and nogetDebugStringVisitorchange is needed. json→unknown. Same mapping in bothnodeTypes/fragments/typeExpr.tsandnodes/fragments/typeExpr.ts; consistent.
Notes for subsequent reviewers
- The
packages/nodesandpackages/visitors-corediffs are generated output — the source of truth ispackages/spec-generatorsplus the pinned@codama/spec@1.8.0. Worth spot-checking that the regenerated files match what the generators would produce from a clean run, but structurally everything lines up. - Consider whether a follow-up should extend
getDebugStringVisitor's explicitswitchto include'pluginNode'(e.g. to also surface a payload marker), or leave it on thedefaultbranch as-is. Not a blocker. - No renderer changes here; downstream renderers (
renderers-js,renderers-rust, etc.) will need their own passes to actually consumepluginsandjson. Presumably tracked separately.
LGTM — clean, additive, and consistent with how other optional instruction fields (provides, display) were introduced.
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR integrates
@codama/spec@1.8.0, threading the newpluginNodeandjsontype expression through the TypeScript reference implementation. The node-types, nodes, and visitors-core packages are regenerated:pluginNodegains its interface andpluginNode(name, payload?)factory,instructionNodegains an optionalpluginsarray, and thejsontype expression renders asunknown. APluginNodevisitor test fixture is added to satisfy the coverage gate. All changes are additive and optional.