-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn/pnpm/workspace-support: Make export work #86
Conversation
Great starting-point of this problem @jim-lub ! I do think traversing up the users disk is too tricky to do, since we don’t know if there’s an unrelated lock-file present outside of the project-dir of the user. I’ve done some research and it seems to be possible to get information about workspaces, which we can use to figure out the root of the project. We can use this to get the exact location of the lock-file in the root of it. Doing this did raise the question though: While we’re looking for the lock-file in the root, shouldn’t we be looking for the lock-file for the server specifically? In workspaces this isn’t present, but is there a way to generate it at will? It seems that we’re not alone: yarnpkg/yarn#4521. As I can figure out atm, this isn’t possible (yet), but using the lock-file in the root seems to be the correct approach after all: yarnpkg/yarn#4521 (comment). I’ll keep digging a bit, and otherwise use the yarn-cli to get to the root of the repo and get the lock-file from there. TBC
|
First of all, I've added the pnpm-lockfile as well 😊 Also, after some internal discussion with @jim-lub and @kamilafsar, we've concluded that it's allright to traverse up the directory-structure (it's better than having dependencies on multiple package-managers anyway), but let's make it a bit more secure, because we'll prevent leaving the project-root as much as possible:
I'll dive into implementing these changes in the upcoming days 👍 |
d90d975 should do it, I'll get into testing this extensively soon 😊 |
So we won't forget, this should be fixing #88 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. If we create a RC I can test this out in my yarn workspace somewhere in the next few days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems solid. I'd like to make the error a bit more descriptive as "lockfile" without context could be a bit confusing. The other stuff you can threat it as recommendation for better readability :)
Co-authored-by: Kamil Afsar <[email protected]>
This is released in To test it yourself, run:
|
yarn.lock
filelock
file in the server directory we go up a maximum of 5 levels to find it. This allows the export to be used in aworkspaces
setup.