chore: migrate footprinter to zod v4 - #726
Conversation
|
The failed build job did not reach the build step: |
|
Dependency coordination update: commit 123b945 now requires circuit-json@^0.0.455, the Zod 4 release emitted after circuit-json PR #661 merges. The branch is intentionally stacked, so registry-only CI cannot install that version until then. Local Zod 4 validation remains green: bun test, bunx tsc --noEmit, and bun run build. |
|
Now green and ready for review — Verified on the current head:
CI on this branch is passing (Build, Bun Test, Format Check). This is the footprinter half of the Zod v4 migration tracked in tscircuit/core#2810. |
|
Note on the red checks here: this is blocked upstream, not by anything in this PR. The published Unblocked by tscircuit/circuit-json#661, which is green and ready — once that merges and publishes, I'll refresh this branch and the checks should go green. Happy to close this and reopen after the circuit-json release if you'd rather not have a red PR sitting in the queue. |
|
Same blocker as tscircuit/props#752, re-verified today. The failing CI here predates The real blocker is unchanged: the published 0.0.455 build still ships v3-shaped types.
tscircuit/circuit-json#661 must merge and publish first. It's Happy to close and reopen after that lands if a red check is unhelpful in the meantime. |
|
Pushed What was failing and why. Only The split is that Worth noting the pin isn't something a version bump escapes — I checked Fix is a five-line "overrides": { "@tscircuit/circuit-json-util": { "zod": "^4.0.0" } }That's accurate rather than a suppression: Verified both package managers and the full suite, since an override that fixes npm could easily break bun: I also confirmed this is specific to the branch and not pre-existing: the same npm install succeeds on One sequencing note for the chain: this PR is downstream of circuit-json#661. |
7c3d968 to
5208b29
Compare
|
Rebased onto current The conflict was in A merge-clean result was not enough here. After resolving, one test failed that passes on
This is the migration's whole failure mode, so it's worth flagging for future Verified against a The 5 ( |
Keep transformed footprint defaults on the input path and align Circuit JSON schema composition on Zod v4.
smdpinheader landed on main after this branch's zod v4 migration, so its
`length.default(...)` calls were never converted. On zod v4 `.default()`
applies to the OUTPUT type, so the transformed length values stayed as
raw strings ("2.54mm") instead of numbers, failing the parity assertion.
`.prefault()` applies on the input side, matching every other length
field in this branch. Literal booleans keep `.default()`.
Rebasing onto current main surfaced a real break rather than just a
conflict. fpc, led2835 and led5050 were merged into main after this
branch was cut, so their length fields still use .default() while the
rest of the codebase moved to .prefault().
Under zod v4 that is not a style difference. .default() short-circuits
the transform, so the declared value is handed back verbatim:
before {"x": null, "y": null, "w": "2mm", "h": "1.1mm"}
after {"x": -2.4, "y": 1.7, "w": 2, "h": 1.1}
Coordinates came out null and dimensions as strings, which is why the
led5050/led2835 tests and both KiCad parity tests failed on the rebased
branch but pass on main.
Verified the branch now fails exactly what main fails and nothing more:
main 5 fail (diode0603, diode1210, melf, sod323fl, sod923)
this PR 5 fail (identical list)
479 pass on both.
5208b29 to
9a91970
Compare
|
Rebased onto current The conflicts themselvesTwo files, both the same shape: Kept both sides — the new fields with the migration applied to them. No upstream field was dropped or reordered. The part that mattered
Under zod v4 that is not a style difference. Coordinates Migrated those three files too, which is what this branch is for. VerificationCompared failures on both sides with the same lockfile, since Same five, and they fail on Worth noting the general risk here: any def merged while this was open will have the same problem, because |
Summary
Dependency order
This is intentionally a draft until circuit-json PR #661 merges and its release workflow publishes [email protected]. The coordinated rollout is circuit-json, footprinter, @tscircuit/props, then core. The exact 0.0.455 range prevents a Zod 3 circuit-json schema from being composed with this package.
Verification