Skip to content

fix(fpc): default num_pins to 12 when called by bare string - #802

Open
rudra496 wants to merge 1 commit into
tscircuit:mainfrom
rudra496:fix/fpc-bare-string-default-pins
Open

fix(fpc): default num_pins to 12 when called by bare string#802
rudra496 wants to merge 1 commit into
tscircuit:mainfrom
rudra496:fix/fpc-bare-string-default-pins

Conversation

@rudra496

Copy link
Copy Markdown

Summary

Fixes #786.

Previously, `fpc_def` did not provide a default for `num_pins`. When called by bare string `fp.string("fpc")`, `num_pins` was `undefined` and coerced to `NaN`, throwing a raw Zod parse error.

Changes

  1. Default Pin Count: Added `.default(12)` to `num_pins` in `fpc_def`, matching the standard 12-pin layout (FPC-05F-12PH20).
  2. Unit Tests: Added `tests/fpc-bare-string.test.ts` verifying that bare string `fpc` renders 14 pads (12 signal pins + 2 mounting pads) without error.

Verification

  • `bun test tests/fpc-bare-string.test.ts` (2/2 passing).

Fixes tscircuit#786 by adding .default(12) to num_pins in fpc_def, matching the default footprint parameters of FPC-05F-12PH20 and preventing ZodError on bare name calls.
Copilot AI lite review requested due to automatic review settings August 15, 2026 20:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

fpc throws a raw parse error when called by its bare name, unlike every other pin-count footprint

2 participants