Skip to content

Apply CLI platform defaults to exports (enable platform autorouters + loaders)#3561

Open
maci0 wants to merge 1 commit into
tscircuit:mainfrom
maci0:fix/export-platform-defaults
Open

Apply CLI platform defaults to exports (enable platform autorouters + loaders)#3561
maci0 wants to merge 1 commit into
tscircuit:mainfrom
maci0:fix/export-platform-defaults

Conversation

@maci0

@maci0 maci0 commented Jul 7, 2026

Copy link
Copy Markdown

Bug

tsci export renders the board with the raw platformConfig, but the spice path wraps it with getPlatformConfigWithCliDefaults(...). Result: kicad / gerbers / pcb / etc. exports never receive the CLI platform defaults from @tscircuit/eval — the autorouterMap (e.g. the krt KiCad-routing-tools autorouter), the static-file loaders and footprint loaders.

Concretely, a board with autorouter="krt" silently falls back to the built-in router on export (verified: selecting krt changed nothing until this fix, after which the platform autorouter is actually invoked).

cli/export/register.ts:

// spice branch (already correct):
platformConfig: getPlatformConfigWithCliDefaults(platformConfig),
// export branch (was raw):
-  platformConfig,
+  platformConfig: getPlatformConfigWithCliDefaults(platformConfig),

Fix

Wrap the export platformConfig the same way the spice path does, so exports and the dev server resolve the same platform autorouters and loaders. One line, mirrors existing behavior.

Verification

With autorouter="krt", before this change the export produced the built-in-router result; after it, the krt platform autorouter is invoked (route changes). Happy to add a regression test asserting a board with a platform-mapped autorouter routes via that autorouter on export.

…oaders)

The export command rendered the board with the raw platformConfig, while the spice
path wraps it with getPlatformConfigWithCliDefaults. So kicad/gerber/pcb/etc.
exports never got the CLI platform defaults - the eval autorouterMap (e.g. the krt
KiCad-routing-tools autorouter), static-file loaders and footprint loaders. A board
with autorouter="krt" silently fell back to the built-in router on export.

Wrap the export platformConfig the same way spice does, so exports and the dev
server resolve the same platform autorouters and loaders.
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.

1 participant