Skip to content

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

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

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.
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions Bot closed this Jul 12, 2026
@maci0

maci0 commented Jul 14, 2026

Copy link
Copy Markdown
Author

Reopen request: stale-bot closed after 1 day, not reviewed. Applying platform defaults (autorouterMap + loaders) on export, not just spice, keeps headless export consistent with the dev server. CI-green; branch intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant