Skip to content

Make websafe bundle avoid core dependency - #362

Open
seveibar wants to merge 1 commit into
mainfrom
codex/fix-websafe-detection-code
Open

Make websafe bundle avoid core dependency#362
seveibar wants to merge 1 commit into
mainfrom
codex/fix-websafe-detection-code

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Motivation

  • The browser/websafe build was pulling in a heavy runtime path (via @tscircuit/coregraphics-debug / pretty) that injects a TTY shim into the generated dist/browser bundle, breaking the intent of the websafe entrypoint.

Description

  • Added a local normalizePinLabels implementation at lib/utils/normalize-pin-labels.ts and replaced the websafe import to use it instead of @tscircuit/core.
  • Updated lib/convert-easyeda-json-to-tscircuit-soup-json.ts to import the local helper and re-exported it from the package entry (lib/index.ts).
  • Added a regression test tests/websafe/browser-bundle-websafe.test.ts that runs the browser build and asserts the bundle does not contain known non-websafe artifacts (TTY shim, pretty, graphics-debug).

Testing

  • Ran bun test tests/normalize-pin-labels.test.ts and all tests passed.
  • Ran bun test tests/websafe/browser-bundle-websafe.test.ts which builds the browser bundle and the guard passed (no TTY/pretty/graphics-debug patterns found).
  • Ran bun test tests/fetch-tests/c2040.test.ts which passed.
  • Ran typecheck with bunx tsc --noEmit, bun run build, and bun run format, all of which completed successfully.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant