Skip to content
PirefactorWeb1 file · +6 −6

Fix @pi-web/bridge subpath exports for svelte package

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

2msession
0interventions
GOAL

Avoid needing to write 'src' in the path when packages/svelte imports from packages/bridge.

  1. Prompt · +0
    Avoid needing to add 'src' to paths when packages/svelte imports packages/bridge
  2. Agent did · +0m
    Explored monorepo structure, read AGENTS.md, package.json and tsconfig files across bridge, svelte, bin and root to understand the export/import setup and how @pi-web/bridge/src/types paths were being used
  3. Agent did · +0m
    Checked packages/bin usage of @pi-web/bridge, ran build and check scripts to establish baseline, which surfaced errors in both bin build and svelte check
  4. Fail · +0m
    pnpm build for packages/bin and pnpm check for packages/svelte both failed with errors related to bridge import paths
  5. Agent did · +1m
    Changed packages/bridge/package.json exports from './*.ts' to './src/*.ts', then rewrote all svelte imports from '@pi-web/bridge/src/types' to '@pi-web/bridge/types' across multiple component and composable files
  6. Agent did · +1m
    Re-ran pnpm -C packages/svelte check, pnpm run build:web, and pnpm -C packages/bin check to verify the fix, then double-checked remaining bridge/types references in transcript.ts, bridgeStore.svelte.ts and composerBarState.svelte.ts
  7. Outcome · +2m
    Fixed bridge package.json exports to map subpaths to src/*.ts and updated all svelte imports; svelte-check found 0 errors, build:web succeeded, and packages/bin check passed clean
VERDICT

Next time I'd start the prompt by pointing directly at the package.json exports field since that's where the real fix ended up living, rather than letting the agent explore the whole monorepo structure first. The correction that mattered was updating the bridge export map to './src/*.ts' and then bulk-fixing all the svelte-side imports to drop the 'src' segment, verified by running check and build across all three affected packages.

I tried this · 0

Discussion · 0

How Builds work