Skip to content

feat: generate barrel index.ts for multi-contract sync#42

Merged
satoshai-dev merged 1 commit intomainfrom
feat/barrel-file
Mar 5, 2026
Merged

feat: generate barrel index.ts for multi-contract sync#42
satoshai-dev merged 1 commit intomainfrom
feat/barrel-file

Conversation

@satoshai-dev
Copy link
Copy Markdown
Owner

Summary

  • After abi-cli sync, generates an index.ts barrel file that re-exports all ABIs
  • Export names derived from name alias (or contract name), converted to camelCase with Abi suffix
  • Only generated for ts format (skipped for json)

Closes #20

Example

Config:

{
  "outDir": "./abis",
  "contracts": [
    { "id": "SP102...amm-pool-v2-01", "name": "amm-pool" },
    { "id": "SP2PA...nft-trait" }
  ]
}

Generated abis/index.ts:

export { abi as ammPoolAbi } from './amm-pool.js';
export { abi as nftTraitAbi } from './nft-trait.js';

Test plan

  • toCamelCase conversion (kebab-case, camelCase, single word, with numbers)
  • generateBarrel output format and sorting
  • Sync generates index.ts for ts format
  • Sync skips barrel for json format
  • Barrel uses name alias when available
  • All 82 tests pass, typecheck and lint clean

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@satoshai-dev satoshai-dev merged commit 8b94d68 into main Mar 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: multi-contract barrel file generation

1 participant