Add jlcpcb cad model support to eval#2699
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2138f0674
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This reverts commit 4a81ee4.
seveibar
reviewed
May 18, 2026
seveibar
reviewed
May 18, 2026
Contributor
seveibar
left a comment
There was a problem hiding this comment.
Never introduce a utils directory. Directory names should be domain specific and domain organized. Eg lib/getPlatformConfig/extractCadModelFromCircuitJson
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
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.
What changed
cadModelextraction to the defaultjlcpcbfootprint resolver ingetPlatformConfigjlcpcb:footprints and make it deterministic with a localC156301fixturejlcpcbreturns bothfootprintCircuitJsonand extractedcadModelC156301circuit-json fixture for the testsWhy
kicad:andjlcpcb:both go through the genericlib:namefootprint loading path incore, but they were not symmetric ineval.For
kicad:, the resolver already returned both:footprintCircuitJsoncadModelFor
jlcpcb:, the resolver only returnedfootprintCircuitJson, even when the fetched circuit-json already contained embeddedcad_componentmetadata. That meant PCB rendering worked, butjlcpcb:did not match thekicad:behavior for 3D model handoff.Now that
corehas merged support for extracting CAD from library footprints,evalstill needs to provide the same explicit resolver-level behavior askicad:so the default platform config is complete and consistent.Why this is needed in
evalevalis where the default platform wiring lives. This change makes the built-injlcpcbfootprint loader behave like the built-inkicadloader:footprintCircuitJsoncadModelThe main difference is just the source of the CAD metadata:
kicad:constructs CAD URLs directly from the KiCad cache URL patternjlcpcb:extracts CAD metadata from the fetched EasyEDA-derived circuit-jsonTest notes
The render and CAD tests use a committed
C156301circuit-json fixture instead of a live network fetch.That is intentional so the tests stay deterministic and do not depend on EasyEDA availability or proxy behavior during CI. The part number and the payload are aligned to the same
C156301fixture.Validation
bun test ./tests/features/jlcpcb-footprint-library-map.test.tsx ./tests/features/jlcpcb-footprint-library-map-cadmodel.test.tsxbunx tsc --noEmit