up icon indicating copy to clipboard operation
up copied to clipboard

Inline symlinked when outside of root

Open tj opened this issue 6 years ago • 11 comments

Currently Up supports symlinks, however these will fail your files are outside of the root dir as they're not in the zip at all. We could just readlink and pull the file in.

tj avatar Mar 30 '18 15:03 tj

Hey @tj I just want to bump this. Would you consider giving this a go or is this not high up on your priority list. Thanks. 🙇‍♂️

ferdinandsalis avatar May 21 '18 18:05 ferdinandsalis

I'll try and check it out soon, I don't think too many people are hitting it but it should be pretty quick to add! I should have written down the use-case hahah, it was for Yarn workspaces or something like that right?

tj avatar May 21 '18 19:05 tj

This would be awesome! Yes, this was for monorepos — yarn, lerna, etc.

ferdinandsalis avatar May 22 '18 07:05 ferdinandsalis

Hmm unless I'm doing it wrong, it looks like Yarn doesn't symlink those modules in, it just uses Node's delegation of parent node_modules to resolve them

tj avatar May 22 '18 17:05 tj

I am sure you are not doing anything wrong. Yarn seems to use nodes module resolution, lerna though uses symlinks.

ferdinandsalis avatar May 22 '18 19:05 ferdinandsalis

hey @tj so its node module resolution for hoisted dependencies and symlinks for linking packages within your monorepo. Sorry for my ill informed answer earlier.

ferdinandsalis avatar May 29 '18 13:05 ferdinandsalis

ahhh darn, we might be out of luck there unless Up becomes Node-aware to resolve the same way. It would be cool if they had a mode to symlink everything

tj avatar May 29 '18 15:05 tj

There is also bolt for mono repos which symlinks everything — https://github.com/boltpkg/bolt

ferdinandsalis avatar Jun 04 '18 15:06 ferdinandsalis

We are running into the exact same issue with Lerna and Yarn workspaces. We hacked our way around this issue in CI by not using workspaces there and running yarn install again within our package folder but it's far from ideal.

loicplaire avatar Jun 04 '18 22:06 loicplaire

@tj & I talked on slack. yarn has a nohoist configuration option, that can be used on the package that uses up.

nohoist will cause yarn to download external dependencies into the package node_modules directory & symlink to the dependency packages in the monorepo. It would be sufficient if up were to zip the files contained in each of the symlinks.

btakita avatar Aug 03 '18 23:08 btakita

Still waiting for support symlink outside of rootDir Is it possible? or I should try another solution?

hunt avatar Jan 23 '20 03:01 hunt