Commit e1bff79
committed
perf(deps): share dependencies across checkouts via the bun global store
The isolated linker was already in use, but without the global store each
checkout copied a full dependency tree into its own node_modules/.bun.
Anyone keeping several worktrees open paid roughly 2G per checkout for
identical packages.
Enabling globalStore installs each package once into a shared store and
symlinks it in. Measured across a whole checkout: 2098M drops to 32M.
The store resolves dependencies through symlinks whose real path lies
outside the project, and TypeScript follows symlinks by default. A
dependency re-exporting React's own types, such as LucideProps extending
SVGProps<SVGSVGElement>, can no longer reach @types/react by walking up
from the store path, so its React-contributed props disappear. Pinning
the react and react-dom specifiers to the workspace copy fixes it for the
whole program, including inside dependency .d.ts files.
claw-app had no paths block of its own and inherited one through extends.
Since a paths block replaces rather than merges, the generated wxt
aliases are restated there alongside the redirect.
Verified by full typecheck in three configurations, all producing an
identical 39 findings:
no store, no paths (before this change)
store + paths (local development)
paths only, no store (CI on the pinned bun, which ignores globalStore)1 parent 195b15c commit e1bff79
3 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
9 | 30 | | |
10 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
0 commit comments