Skip to content

add event node support#985

Merged
lorisleiva merged 9 commits intocodama-idl:mainfrom
daog1:event-node-support
Mar 26, 2026
Merged

add event node support#985
lorisleiva merged 9 commits intocodama-idl:mainfrom
daog1:event-node-support

Conversation

@daog1
Copy link
Copy Markdown
Contributor

@daog1 daog1 commented Mar 21, 2026

Summary

I added this while making dynamic-parsers support full Anchor-format parsing, and I want to upstream the base event support first so that work can stay aligned with main.

This PR adds EventNode support across the core packages and imports Anchor events into the program AST.

A follow-up change depends on this.

Changes

  • add EventNode to node types and node constructors
  • add ProgramNode.events
  • import Anchor v0.1 events
  • avoid duplicating event structs in definedTypes
  • update core visitors for eventNode
  • add tests

Validation

  • pnpm lint
  • pnpm test

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

🦋 Changeset detected

Latest commit: af23064

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

This PR includes changesets to release 12 packages
Name Type
@codama/errors Minor
@codama/node-types Minor
@codama/nodes-from-anchor Patch
@codama/nodes Minor
@codama/visitors-core Minor
@codama/dynamic-codecs Patch
@codama/dynamic-parsers Patch
codama Minor
@codama/renderers-core Patch
@codama/validators Minor
@codama/visitors Minor
@codama/cli 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

Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've made some important comments but this is a solid base. I'll give it another thorough review after these are addressed.

Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Another round of comments. 🙏

Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you! Just a quick nit and I think we're good to go.

Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've just noticed we don't have a documentation page for the new node though. Would you mind adding one under packages/nodes/docs/ErrorNode.md? There should be a _template.md file to help with that. Additionally, the ProgramNode.md page needs updating and so does the main packages/nodes/README.md.

Another thing that would be good to update is the getDefinedTypeHistogramVisitor to ensure it tracks link usages inside event nodes as well.

@daog1
Copy link
Copy Markdown
Contributor Author

daog1 commented Mar 25, 2026

Thanks! I've just noticed we don't have a documentation page for the new node though. Would you mind adding one under packages/nodes/docs/ErrorNode.md? There should be a _template.md file to help with that. Additionally, the ProgramNode.md page needs updating and so does the main packages/nodes/README.md.

Another thing that would be good to update is the getDefinedTypeHistogramVisitor to ensure it tracks link usages inside event nodes as well.

Added and updated.

Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🚀

@lorisleiva lorisleiva merged commit 6487af5 into codama-idl:main Mar 26, 2026
4 checks passed
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.

2 participants