Skip to content

feat: add bom-csv export format#2484

Open
mendarb wants to merge 2 commits intotscircuit:mainfrom
mendarb:feat/bom-csv-export
Open

feat: add bom-csv export format#2484
mendarb wants to merge 2 commits intotscircuit:mainfrom
mendarb:feat/bom-csv-export

Conversation

@mendarb
Copy link

@mendarb mendarb commented Mar 20, 2026

/claim #1950

Summary

  • Add bom-csv to the list of allowed export formats in tsci export
  • Use the existing circuit-json-to-bom-csv package to convert circuit JSON to BOM CSV
  • Add .bom.csv output extension mapping
  • Add test covering the new export format

Usage

tsci export path/to/example.tsx --format bom-csv
# or with custom output path:
tsci export path/to/example.tsx --format bom-csv --output path/to/bom.csv

Changes

  • lib/shared/export-snippet.ts: Added bom-csv format, import, extension mapping, and switch case
  • package.json: Added circuit-json-to-bom-csv dependency
  • tests/cli/export/export-bom-csv.test.ts: New test for BOM CSV export

Test plan

  • bun test tests/cli/export/export-bom-csv.test.ts passes
  • Existing export tests still pass (verified readable-netlist)
  • bun run format:check passes

Add support for `tsci export --format bom-csv` using the existing
circuit-json-to-bom-csv package. This enables BOM generation from CLI
for automated builds, cost estimation, and component procurement.

Closes tscircuit#1950

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The check-dependencies CI check requires all dependencies to be in
devDependencies. Move circuit-json-to-bom-csv from dependencies to
devDependencies to fix the failing check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant