-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
- I'd be willing to implement this feature (contributing guide)
- This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
We all want fast yarn install, and node_modules which don't eat our disk.
Pnp is pretty good solution, but it has compatibility issues: bundlers, resolvers, etc. Migration effort if pretty high.
Describe the solution you'd like
Fuse linker.
Idea consist from three elements:
-
pnpm layout.
I forked pnpm linker, removed hardlinks logic from it.
I've split packages into two dirs, .store-fuse and .store-unplugged.
Unplugged has packages which need postinstalls, they are unpacked to fs.
Fuse has other packages, and mounted as readonly.
If fuse linker is not supported in OS, all packages fallback to unplugged. -
fuse mount of .store-fuse.
Supported os: linux (libfuse), macos 15.4 (fskit). Probably windows with wsl 2.
For unprivileged mounts linux needs fusermount util installed.
Macos need app installed.
I've implemented custom fuse fs, which ended to be a bit complicated. After finished I've found out that I can generateerofs
binary image instead, and reuse erofs-fuse or even erofs native mount on linux (it's supported by kernel, but needs root). -
fetching archives on demand from remote cache (optional)
Fuse fs supports async fs actions, which means that we can add fetching data when its requested.
This all will make yarn install time = resolution + cache fulfil + postinstalls.
Sources: https://github.com/goloveychuk/fuse
Describe the drawbacks of your solution
Needs binaries downloaded, need support by OS, could have bugs.
Describe alternatives you've considered
pnp
@arcanis wdyt?