codama-idl / codama

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

Handle `::` in conflicting Anchor type names #335

Open lorisleiva opened 4 days ago

lorisleiva commented 4 days ago

When generating an Anchor IDL that exports conflicting types, it will use the fully qualified name — e.g. some::crate::MyType — instead of the type name alone — e.g. MyType.

Since Codama only support camel-cased names, this is not compatible with the standard. The side-effect is that we have JavaScript generated imports that look like import { some::crate::MyType } from '../types'.

Two possible solutions: