Skip to content

Commit 629a97c

Browse files
authored
Merge pull request #9 from macalinao/igm/more-docs
Add support for automatic instruction accounts deduping, fix docs
2 parents 91fd167 + 9d59913 commit 629a97c

File tree

292 files changed

+46517
-5321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

292 files changed

+46517
-5321
lines changed

.changeset/cute-steaks-dig.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@macalinao/codama-renderers-markdown": patch
3+
---
4+
5+
Modify error code output format

.changeset/every-trees-sip.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@macalinao/codama-instruction-accounts-dedupe-visitor": patch
3+
"@macalinao/codama-nodes-from-anchor-x": patch
4+
"@macalinao/codama-renderers-markdown": patch
5+
"@macalinao/codama-renderers-js-esm": patch
6+
"@macalinao/codama-rename-visitor": patch
7+
"@macalinao/clients-kamino-lending": patch
8+
"@macalinao/clients-token-metadata": patch
9+
"@macalinao/clients-quarry": patch
10+
"@macalinao/coda": patch
11+
"coda-docs": patch
12+
---
13+
14+
Update documentation

.changeset/green-oranges-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@macalinao/codama-instruction-accounts-dedupe-visitor": patch
3+
---
4+
5+
Only apply deduping if necessary

.changeset/sharp-mugs-design.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@macalinao/codama-renderers-markdown": minor
3+
"@macalinao/codama-rename-visitor": minor
4+
---
5+
6+
Refactor packages

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: bun install --frozen-lockfile
3232

3333
- name: Build all packages
34-
run: bun run build
34+
run: bun run build:ci
3535

3636
- name: Run linting
3737
run: bun run lint

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: bun install --frozen-lockfile
4646

4747
- name: Build packages
48-
run: bun run build
48+
run: bun run build:ci
4949

5050
- name: Setup NPM authentication
5151
run: |

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export default defineConfig({
189189
- Arrays use shorthand syntax: `string[]` not `Array<string>`
190190
- **Use double quotes for strings** (not single quotes)
191191
- ES modules with `.js` extensions for imports
192+
- **File naming**: Use kebab-case for all TypeScript files (e.g., `root-node-from-anchor.ts`, `create-codama-from-idls.ts`)
192193

193194
### After Making Code Changes
194195
**Always run these commands to ensure code quality:**

apps/docs/content/docs/examples.mdx

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,39 @@ The Quarry client demonstrates Coda's **multi-program** capabilities:
3939

4040
Ideal for protocol developers managing multiple interconnected programs or anyone building comprehensive DeFi integrations.
4141

42-
## Add Your Example
42+
### Kamino Lending Client
4343

44-
Using Coda in your project? We'd love to showcase it!
44+
[![npm version](https://img.shields.io/npm/v/@macalinao/clients-kamino-lending.svg?style=flat-square)](https://www.npmjs.com/package/@macalinao/clients-kamino-lending)
45+
[![npm downloads](https://img.shields.io/npm/dm/@macalinao/clients-kamino-lending.svg?style=flat-square)](https://www.npmjs.com/package/@macalinao/clients-kamino-lending)
4546

46-
**[Submit a Pull Request ](https://github.com/macalinao/coda/pulls)** to add your project to this documentation.
47+
[View on GitHub ](https://github.com/macalinao/coda/tree/master/clients/kamino-lending)
4748

48-
### How to Add Your Example
49+
The Kamino Lending client demonstrates Coda's ability to handle **complex IDLs with overlapping account names**:
4950

50-
1. Fork the [Coda repository](https://github.com/macalinao/coda)
51-
2. Edit this file at `apps/docs/content/docs/examples.mdx`
52-
3. Add your project following this format:
51+
- **Overlapping account names** - Handles instructions with duplicate account names across nested structures
52+
- **Automatic flattening** - Intelligently flattens nested account groups to avoid naming conflicts
53+
- **Complex DeFi protocol** - Full lending protocol with deposit, withdraw, and liquidation operations
54+
- **Production-scale IDL** - Processes large IDL with numerous instructions and account types
5355

54-
```mdx
55-
### Your Project Name
56+
This example is particularly useful for developers working with:
5657

57-
[View on GitHub →](https://github.com/yourname/yourproject)
58+
- Complex DeFi protocols with nested account structures
59+
- IDLs that have evolved over time with naming inconsistencies
60+
- Programs requiring sophisticated account management patterns
61+
- Large-scale production protocols with intricate instruction sets
5862

59-
Brief description of what makes your implementation unique:
63+
The Kamino Lending client showcases how Coda's automatic account flattening feature (via `codama-instruction-accounts-dedupe-visitor`) resolves naming conflicts that would otherwise cause compilation errors in generated TypeScript code.
6064

61-
- **Key feature 1** - Description
62-
- **Key feature 2** - Description
63-
- **Key feature 3** - Description
65+
## Add Your Example
6466

65-
What developers can learn from your example.
66-
```
67+
Using Coda in your project? We'd love to showcase it!
68+
69+
**[Submit a Pull Request →](https://github.com/macalinao/coda/pulls)** to add your project to this documentation.
6770

68-
4. Submit your PR with a clear description
71+
### How to Add Your Example
6972

70-
We welcome examples that demonstrate:
71-
- Novel configuration approaches
72-
- Integration patterns
73-
- Complex visitor usage
74-
- Multi-program setups
75-
- Custom code generation workflows
76-
- Production deployment strategies
73+
1. Fork the [Coda repository](https://github.com/macalinao/coda)
74+
2. Edit this file at `apps/docs/content/docs/examples.mdx`
75+
3. Submit your PR with a clear description
7776

78-
Help the Solana developer community by sharing your Coda implementation!
77+
Help the Solana developer community by sharing your Coda implementation!

apps/docs/content/docs/meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"generating-clients",
1212
"generating-docs",
1313
"examples",
14+
"---Packages---",
15+
"packages",
1416
"---Reference---",
1517
"api"
1618
]

0 commit comments

Comments
 (0)