Skip to content

fix(convert): bind KiCad footprint reference text to props.name - #5933

Open
MoAccelerator wants to merge 1 commit into
tscircuit:mainfrom
MoAccelerator:fix/convert-kicad-reference-text
Open

MoAccelerator wants to merge 1 commit into
tscircuit:mainfrom
MoAccelerator:fix/convert-kicad-reference-text

Conversation

@MoAccelerator

Copy link
Copy Markdown

Summary

  • Preserves KiCad footprint reference-field semantics when converting .kicad_mod files to reusable TSX components via tsci convert.
  • Adds cli/convert/bind-kicad-footprint-reference-texts.ts to mark fp_text reference, KiCad 8 property "Reference", and ${REFERENCE} / %R placeholders with a sentinel before Circuit JSON conversion, then emits text={props.name} (or template-interpolated text={...} for composite labels) in the generated TSX while leaving ordinary user text literal.
  • Adds regression tests in tests/cli/convert/convert-kicad-footprint-reference.test.ts instantiating generated TSX components as U1 and U2 and verifying per-instance pcb_silkscreen_text and pcb_fabrication_note_text values.

Verification

  • bun test --timeout 30000 tests/cli/convert/convert-kicad-footprint-reference.test.ts (2 pass, 0 fail, 14 expect() calls)
  • bun run format:check (672 files, no fixes applied)
  • bunx tsc --noEmit
  • bun scripts/check-for-dependencies.ts

Closes #4708

@MoAccelerator
MoAccelerator force-pushed the fix/convert-kicad-reference-text branch from 0da5bcf to e3c46f3 Compare November 30, 2026 15:28
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.

tsci convert hardcodes KiCad reference placeholder REF** in reusable TSX footprints

1 participant