Skip to content

fix: export ControlledSchematicViewer from the package entry point - #251

Open
Priyanshubhartistm wants to merge 3 commits into
tscircuit:mainfrom
Priyanshubhartistm:export-controlled-schematic-viewer
Open

fix: export ControlledSchematicViewer from the package entry point#251
Priyanshubhartistm wants to merge 3 commits into
tscircuit:mainfrom
Priyanshubhartistm:export-controlled-schematic-viewer

Conversation

@Priyanshubhartistm

Copy link
Copy Markdown

Summary

  • ControlledSchematicViewer wraps SchematicViewer and manages editEvents/onEditEvent for you — it's the pattern 7 of the example fixtures use for drag-to-edit, and it's referenced in docs/dragndrop-spec.md.
  • Added export { ControlledSchematicViewer } from "./components/ControlledSchematicViewer" to lib/index.ts.
  • Updated the 7 fixtures that previously deep-imported it from lib/components/ControlledSchematicViewer to import from lib/index instead, so the examples now demonstrate the actual public API.
  • Added tests/lib-index-exports.test.ts to lock in the package's export surface so this can't silently regress again.

Why

ControlledSchematicViewer was never added to lib/index.ts, so consumers of the published @tscircuit/schematic-viewer package had no way to import it only Cosmos's lib/* path alias made the examples work, and that alias doesn't exist in dist/.

Impact

Consumers of @tscircuit/schematic-viewer can now import ControlledSchematicViewer directly, matching the pattern every relevant example and the drag-and-drop docs already show as the intended usage.

Validation

  • bun run format:check
  • bunx tsc --noEmit
  • bun test (6 pass, 0 fail)
  • Verified visually in Cosmos: ran bun run start, drove example1, example4, example5, and example14 with Playwright after switching their imports to lib/index — all render correctly, zero page errors.

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
schematic-viewer Ready Ready Preview Aug 15, 2026 5:17pm

Request Review

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