Files
zeekay 169927b78b refactor: strip duplicate pkgs, consume @l.x/* from npm — keep only pkgs/wallet (canonical @luxfi/wallet bones)
- Delete pkgs/{analytics,api,config,eslint-config,gating,lx,notifications,
  prices,sessions,ui,utilities} — all identical to ~/work/lux/exchange
  canonical (MD5-matched). Now published to npm at @l.x/*; consume from
  there instead of vendoring.
- pkgs/wallet remains — this IS @luxfi/wallet (the uniswap-style extension
  + mobile wallet bones). Published at 1.0.10.
- Rewrite 3553 bare-path imports (uniswap/src/, ui/src/, utilities/src/,
  lx/src/, lux/src/) → explicit @l.x/* across 725 files.
- apps/{extension,mobile}/package.json: workspace:^ → npm ^versions for
  all @l.x/* / @luxfi/eslint-config; only @luxfi/wallet stays workspace.
- apps/{extension,mobile}/.eslintrc.js: RULES_DIR → node_modules/@l.x/lx/eslint_rules.

~315K line deletion. One canonical home: ~/work/lux/exchange.
2026-04-23 17:58:21 -07:00

28 lines
841 B
TypeScript

import type { BrowserContext, Page } from '@playwright/test'
import { sleep } from '@l.x/utils/src/time/timing'
export async function openExtensionSidebar(context: BrowserContext, extensionId: string): Promise<Page> {
const sidebarUrl = `chrome-extension://${extensionId}/sidepanel.html`
const page = await context.newPage()
await page.goto(sidebarUrl)
return page
}
export async function waitForBackgroundReady(context: BrowserContext): Promise<void> {
const maxAttempts = 30
let attempts = 0
while (attempts < maxAttempts) {
// MV3 extensions use service workers instead of background pages
const serviceWorkers = context.serviceWorkers()
if (serviceWorkers.length > 0) {
return
}
await sleep(100)
attempts++
}
throw new Error('Background script failed to initialize within timeout')
}