Fix @pi-web/bridge subpath exports for svelte package
Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk
Click a segment to jump to that moment
2msession
0interventions
GOAL
Avoid needing to write 'src' in the path when packages/svelte imports from packages/bridge.
- +0Prompt · +0Avoid needing to add 'src' to paths when packages/svelte imports packages/bridge
- +0mAgent did · +0mExplored 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
- +0mAgent did · +0mChecked 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
- +0mFail · +0mpnpm build for packages/bin and pnpm check for packages/svelte both failed with errors related to bridge import paths
- +1mAgent did · +1mChanged 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
- +1mAgent did · +1mRe-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
- +2mOutcome · +2mFixed 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.