Skip to content

refactor: resolve component-specific Footprinter definitions in core - #4959

Merged
imrishabh18 merged 21 commits into
mainfrom
codex/update-footprinter-0-0-445
Oct 29, 2026
Merged

imrishabh18 merged 21 commits into
mainfrom
codex/update-footprinter-0-0-445

Conversation

@imrishabh18

@imrishabh18 imrishabh18 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Core and Footprinter could both generate polarity artwork for LEDs, producing duplicate symbols. Bare LED package sizes also selected resistor definitions. Resolve each component's effective footprint and let Footprinter generate the requested artwork.

  • Use published Footprinter 0.0.450 and its resolvePassiveFootprintDefinition API to select capacitor and diode families while retaining explicit families, dimensions, units, and modifiers.
  • Chip.resolveFootprint() requests _nonpolarized only for diode/LED packages that generate automatic electrical polarity artwork. Ordinary chip footprints such as soic8, qfn32, and dip8 retain their definitions. Explicit polarity modifiers are preserved.
  • Capacitor.getFootprinterString() owns capacitor family selection, polarity options, and terminal mapping. PCB and CAD use the same definition.
  • Diodes and LEDs share diode-specific footprint and port helpers under lib/utils/footprints/. Component class files retain their class export; a CI regression rejects additional runtime exports in normal component class files.
  • Read parameters directly from Footprinter instead of maintaining a duplicate Zod schema. Convert authored pin options at the terminal-mapping boundary, preserving label conflict checks and distinct numeric 1 | 2 terminals.
  • Keep NormalComponent generic and authored props immutable. Remove core's duplicate LED/capacitor fabrication generators while preserving imported/custom artwork.

For example, a polarized capacitor using 0805 resolves to cap0805_polarized; an 0805 LED resolves to diode0805; a generic chip using sod123 resolves to sod123_nonpolarized, while soic8 remains soic8.

Validation:

  • 38 focused tests across 33 files pass, covering footprint resolution, PCB/CAD parity, diode/LED behavior, capacitor polarity, terminal conflicts, geometry, and class exports.
  • TypeScript check, package build, distribution smoke tests, formatting, and git diff --check pass.

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tscircuit-core-benchmarks Ready Ready Preview Oct 29, 2026 12:04pm UTC

Request Review

@imrishabh18
imrishabh18 marked this pull request as ready for review October 27, 2026 12:50
Comment thread package.json Resolved
@imrishabh18 imrishabh18 changed the title chore: update footprinter to latest published version chore: update footprinter to 0.0.447 Oct 27, 2026
@imrishabh18 imrishabh18 changed the title chore: update footprinter to 0.0.447 fix: update footprinter and avoid duplicate LED artwork Oct 27, 2026
@imrishabh18
imrishabh18 marked this pull request as draft October 27, 2026 14:25
@imrishabh18 imrishabh18 changed the title fix: respect explicit footprint polarity artwork refactor: let core own automatic polarity fabrication notes Oct 27, 2026

@seveibar seveibar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revising my review- not sure about this- seems like fabrication notes could be handled by footprinter

@seveibar seveibar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@seveibar seveibar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have concerns

@imrishabh18
imrishabh18 merged commit 6f23636 into main Oct 29, 2026
19 checks passed
@imrishabh18
imrishabh18 deleted the codex/update-footprinter-0-0-445 branch October 29, 2026 12:09

This branch was successfully deployed

1 active deployment
Preview — 9083f1d3 Deployed Oct 29, 2026 by vercel[bot]
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.

2 participants