codama-idl / codama

Generate clients, CLIs, documentation and more from your Solana programs
MIT License
73 stars 16 forks source link

Add `RemainderOptionTypeNode` #111

Closed lorisleiva closed 2 months ago

lorisleiva commented 2 months ago

This PR adds a node that represents an optional item using a child TypeNode. The item can either be present — i.e. Some<T> — or absent — i.e. None — depending on whether or not there are remaining bytes in the buffer.

Closes https://github.com/kinobi-so/kinobi/issues/59 using Option 1 described there. This is because Option 2 can be achieved in a better way using composable BooleanTypeNodes but this needs a whole refactoring anyway so we can delay that to later.


Side note: This PR also updates the main CI workflow so that it gets executed on any stacked PRs, not just the ones that target the main branch directly.

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 3b8b3072f60d416ecef54023fb2269fd6d0aeab8

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

This PR includes changesets to release 13 packages | Name | Type | | ---------------------------- | ----- | | @kinobi-so/renderers-js-umi | Minor | | @kinobi-so/renderers-rust | Minor | | @kinobi-so/visitors-core | Minor | | @kinobi-so/renderers-js | Minor | | @kinobi-so/node-types | Minor | | @kinobi-so/errors | Minor | | @kinobi-so/nodes | Minor | | @kinobi-so/renderers | Patch | | @kinobi-so/renderers-core | Patch | | @kinobi-so/validators | Minor | | @kinobi-so/visitors | Minor | | kinobi | Minor | | @kinobi-so/nodes-from-anchor | 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 2 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @lorisleiva and the rest of your teammates on Graphite Graphite