From 609f7b3641980e13ed24c75d25e63c01c9788cf0 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 23 Sep 2026 15:30:46 +0200 Subject: [PATCH 1/2] chore: remove stale ts-bridge references The build now uses plain tsc, so point comments and AGENTS.md at that instead of ts-bridge. --- AGENTS.md | 2 +- packages/perps-controller/src/PerpsController.ts | 2 +- packages/snap-account-service/src/types.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5d79379f615..c9446b2ea25 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -228,7 +228,7 @@ Environment prerequisites (Node LTS + Yarn 4 via Corepack + `yarn install`) are Standard lint/test/build commands are documented above and in `docs/processes/`. Non-obvious caveats for this environment: -- `yarn build` (whole monorepo, via `ts-bridge`) takes ~100s. `yarn lint:eslint` takes ~3–4 minutes. +- `yarn build` (whole monorepo, via `tsc --build`) takes ~100s. `yarn lint:eslint` takes ~3–4 minutes. - `yarn lint:eslint` runs `build:only-clean` first, which **deletes all `packages/*/dist`**. Run `yarn build` again afterward if you need the built artifacts (tests don't need `dist`; they run TS/Babel directly). - The full `yarn lint` does much more than ESLint (constraints, `knip` dependency checks, changelog/teams/tsconfig/codeowners checks); prefer `yarn lint:eslint` for a quick code-quality pass. - Per-package tests are fast: `yarn workspace run test`. `yarn test` across all packages is heavy. diff --git a/packages/perps-controller/src/PerpsController.ts b/packages/perps-controller/src/PerpsController.ts index 10044831789..fb7916ab15a 100644 --- a/packages/perps-controller/src/PerpsController.ts +++ b/packages/perps-controller/src/PerpsController.ts @@ -2367,7 +2367,7 @@ export class PerpsController extends BaseController< // is only used when explicitly enabled and selected. const isLighterEnabled = this.#isLighterProviderEnabled(); if (isLighterEnabled) { - // NOTE: Keep the path in a variable so ts-bridge does not rewrite the + // NOTE: Keep the path in a variable so build tooling does not rewrite the // import argument and strip the webpackIgnore magic comment in core dist. const lighterModulePath = './providers/LighterProvider'; this.#lighterRegistrationPromise = import( diff --git a/packages/snap-account-service/src/types.ts b/packages/snap-account-service/src/types.ts index e9485a7d5fe..7f567da2d8a 100644 --- a/packages/snap-account-service/src/types.ts +++ b/packages/snap-account-service/src/types.ts @@ -12,8 +12,7 @@ import { AccountId } from '@metamask/keyring-utils'; * `multichain-account-service` legitimately depends on `snap-account-service` * (for `:ensureReady`), and `account-tree-controller` legitimately depends on * `multichain-account-service`. Importing `AccountTreeController` types here - * would close the cycle and crash `ts-bridge` with a stack overflow during - * project-reference builds. + * would close the cycle and break project-reference builds (`tsc --build`). * * Keep these signatures in sync with `@metamask/account-tree-controller`. */ From 202fa1aadb6bf8a12fd132032af0568614ea2a3f Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 23 Sep 2026 15:47:20 +0200 Subject: [PATCH 2/2] chore(perps-controller): explain why the Lighter import path stays in a variable tsc keeps the literal and the webpackIgnore comment, so the old reason no longer applies. The variable still stops Metro from statically bundling the Lighter provider. --- packages/perps-controller/src/PerpsController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/perps-controller/src/PerpsController.ts b/packages/perps-controller/src/PerpsController.ts index fb7916ab15a..641d05742c4 100644 --- a/packages/perps-controller/src/PerpsController.ts +++ b/packages/perps-controller/src/PerpsController.ts @@ -2367,8 +2367,9 @@ export class PerpsController extends BaseController< // is only used when explicitly enabled and selected. const isLighterEnabled = this.#isLighterProviderEnabled(); if (isLighterEnabled) { - // NOTE: Keep the path in a variable so build tooling does not rewrite the - // import argument and strip the webpackIgnore magic comment in core dist. + // NOTE: Keep the path in a variable so bundlers that ignore the + // webpackIgnore magic comment (e.g. Metro) cannot statically resolve the + // import and pull the Lighter provider into the client bundle. const lighterModulePath = './providers/LighterProvider'; this.#lighterRegistrationPromise = import( /* webpackIgnore: true */ lighterModulePath