codama-idl / codama

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

[0.21] Fix a bug that reuses the same `ImportMap` in fragments #200

Closed lorisleiva closed 1 month ago

lorisleiva commented 1 month ago

Currently, if you pass the same ImportMap to two fragments using the fragment function, each of these separate fragments will reference the same ImportMap instance. This causes other bugs as, when we update the imports of one fragments, we end up updating the imports of another.

This PR fixes this by cloning the ImportMap when creating a new fragment.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: cb9a3ca53a8d9d2fafdd412ff518fd5e273a1e58

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

This PR includes changesets to release 2 packages | Name | Type | | ----------------------- | ----- | | @kinobi-so/renderers-js | Patch | | @kinobi-so/renderers | 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