Skip to content

fix(fpc): default num_pins to 12 so the bare name renders - #903

Open
Furox-Art wants to merge 2 commits into
tscircuit:mainfrom
Furox-Art:fix/fpc-default-pin-count
Open

Furox-Art wants to merge 2 commits into
tscircuit:mainfrom
Furox-Art:fix/fpc-default-pin-count

Conversation

@Furox-Art

Copy link
Copy Markdown

Fixes #786

Summary

fpc was the only pin-count footprint that threw from its bare name: num_pins: z.coerce.number().int().min(2) had no default, so the proxy set it to undefined, z.coerce.number() coerced that to NaN, and the schema parse failed with a raw ZodError.

Changes

  • num_pins defaults to 12. The existing schema defaults already fully describe the 12-pin FPC-05F-12PH20 part — the fpc12 test renders it from nothing but the defaults (p0.5mm pw0.3mm pl1.25mm mpw2mm mpl2.5mm, with mpx/mpy computed to 8.88/2.575) — so a bare fpc now has an obvious intended result.

Testing

  • tests/fpc-bare-name.test.ts: bare fpc renders the 12-contact + 2-mounting-pad FPC-05F-12PH20 layout with the same pad geometry as the explicit fpc12 test
  • Existing fpc.test.ts snapshot unchanged

fpc was the only pin-count footprint without a default; bare
fp.string("fpc") threw a raw ZodError because z.coerce.number() turned
the missing num_pins into NaN. The existing schema defaults already
describe the 12-pin FPC-05F-12PH20 (fpc12 passes them with no
overrides), so default num_pins to 12 and document that.

Fixes tscircuit#786
@Furox-Art

Copy link
Copy Markdown
Author

Friendly maintainer review request: this contribution has been updated with the latest fixes and checks. Please review when convenient. Thank you.

This branch has not been deployed

No deployments
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

1 participant