fix: pass rawEasy object shape to convertRawEasyToTsx in CLI convert (#400) - #414
fix: pass rawEasy object shape to convertRawEasyToTsx in CLI convert (#400)#414DPS0340 wants to merge 1 commit into
Conversation
Fixes tscircuit#400. convertRawEasyToTsx takes { rawEasy } but the CLI convert path called it with the raw JSON directly, so EasyEdaJsonSchema.parse(undefined) threw for every part when outputting .tsx/.ts. Other output formats were unaffected. Adds a network-free regression test converting a local .raweasy.json asset to a tsx file (fails on main with the invalid_type ZodError).
|
@seveibar mind a quick look? This is a 2-file, +40 fix.
CI green and mergeable. |
|
@Abse2001 @rushabhcodes @techmannih — flagging this one specifically because it's the highest impact-to-risk ratio of my three open PRs here, and it's a one-line change.
The diff is literally: - convertRawEasyToTsx(rawEasyEdaJson)
+ convertRawEasyToTsx({ rawEasy: rawEasyEdaJson })Two files total (the fix + a CLI regression test). Verified the exact repro from #400: CI green, |
Fixes #400.
Problem
easyeda convert -i <part> -o <file>.tsxcrashed for every part:convertRawEasyToTsxtakes{ rawEasy }but the CLI convert path (lib/convert-easyeda-json-to-various-formats.ts:87) called it with the raw JSON directly, soEasyEdaJsonSchema.parse(undefined)threw. Only.tsx/.tsoutput was affected — other formats never hit this call.Fix
One-line call-shape fix:
convertRawEasyToTsx(rawEasyEdaJson)→convertRawEasyToTsx({ rawEasy: rawEasyEdaJson }).Verified the exact repro from the issue now works:
Verification
C46749.raweasy.jsonasset to a tsx file (fails onmainwith the ZodError from the issue)bunx tsc --noEmit/biome check— clean