Coda
Packages

Packages

Core packages that power Coda's client generation capabilities

Coda is built as a modular system of packages that work together to generate high-quality TypeScript clients from Solana IDLs. Each package serves a specific purpose in the generation pipeline.

Core Packages

@macalinao/coda

The main CLI tool for generating TypeScript clients from Anchor IDLs. Works out of the box with sensible defaults and extensible configuration.

@macalinao/create-coda

Project scaffolding tool that bootstraps new Coda client projects with TypeScript, ESLint, and all configurations pre-set.

Parsers

@macalinao/codama-nodes-from-anchor-x

Creates Codama root nodes from multiple Anchor IDLs with enhanced support for various IDL versions.

Visitors

@macalinao/codama-instruction-accounts-dedupe-visitor

Flattens nested account structures from Anchor IDLs while preserving relationships through naming conventions.

@macalinao/codama-rename-visitor

Renames accounts, instructions, and defined types in the Codama AST to avoid conflicts and customize naming.

Renderers

@macalinao/codama-renderers-js-esm

ESM-native TypeScript renderer that generates modern JavaScript modules with proper .js extensions.

@macalinao/codama-renderers-markdown

Generates comprehensive Markdown documentation from Codama AST nodes, perfect for API documentation.

Package Architecture

Each package in the Coda ecosystem follows a consistent structure:

  • TypeScript-first: All packages are written in TypeScript with full type safety
  • ES Modules: Uses modern JavaScript modules with "type": "module"
  • Simple builds: Direct tsc compilation without complex bundling
  • Consistent scripts: Standardized build, test, lint commands

Installation

Each package can be installed individually based on your needs:

# Using npm
npm create @macalinao/create-coda@latest my-client

# Using bun
bun create @macalinao/create-coda my-client

Install the Main CLI

# Using npm
npm install -D @macalinao/coda

# Using bun
bun add -D @macalinao/coda

Install Parsers

# Using npm
npm install @macalinao/codama-nodes-from-anchor-x

# Using bun
bun add @macalinao/codama-nodes-from-anchor-x

Install Visitors

# Using npm
npm install @macalinao/codama-instruction-accounts-dedupe-visitor
npm install @macalinao/codama-rename-visitor

# Using bun
bun add @macalinao/codama-instruction-accounts-dedupe-visitor
bun add @macalinao/codama-rename-visitor

Install Renderers

# Using npm
npm install @macalinao/codama-renderers-js-esm
npm install @macalinao/codama-renderers-markdown

# Using bun
bun add @macalinao/codama-renderers-js-esm
bun add @macalinao/codama-renderers-markdown

Contributing

All packages follow the same development workflow:

# Build the package
bun run build

# Run tests
bun test

# Fix linting issues
bun run lint:fix