Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #786
Summary
fpcwas 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 toundefined,z.coerce.number()coerced that toNaN, and the schema parse failed with a raw ZodError.Changes
num_pinsdefaults to12. The existing schema defaults already fully describe the 12-pin FPC-05F-12PH20 part — thefpc12test renders it from nothing but the defaults (p0.5mm pw0.3mm pl1.25mm mpw2mm mpl2.5mm, withmpx/mpycomputed to 8.88/2.575) — so a barefpcnow has an obvious intended result.Testing
tests/fpc-bare-name.test.ts: barefpcrenders the 12-contact + 2-mounting-pad FPC-05F-12PH20 layout with the same pad geometry as the explicitfpc12testfpc.test.tssnapshot unchanged