codama-idl / codama

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

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

Closed lorisleiva closed 3 months ago

lorisleiva commented 3 months 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 3 months 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