-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[node_modules] Implement transparent handling of some node_modules roots non-existence #993
Conversation
Thanks for the PR! I will check how long it takes with this patch and with a cache on Travis later today.
It's almost impossible, because it isn't possible to do with globs: we would need to hard-code all the workspace, and always keep the list up to date. I also have another idea: what if we store workspaces dependencies not inside Then, when running This would allow storing a complete cache of all the EDIT: Maybe I could try implementing it using a plugin. |
I'm worried this logic would be quite complicated for a somewhat uncommon use case (plus, ideally very few packages would need to be stored inside the individual workspace directories) 🤔 |
I agree with @arcanis, this will be a non-standard |
Ok 👍 Note that even if I might go with the custom plugin, I think that this PR is still needed since currently monorepo caches which were working with yarn 1 are broken "by default", and it's hard to understand why. |
I agree, it's almost impossible to list them all with the globs, yet it's possible to have fairly good dir list to cache via: Edit: actually its possible I think, one should just glob all the workspaces. For example, in the case of babel, we have:
so, theoretically This PR will gives some extra confidence, so it's nice to have in any case. |
Oh, what I meant is "Travis CI doesn't support globs" 😅 |
@nicolo-ribaudo Oh, well, in this case I would have cached on Travis at least some of these:
|
Good idea! |
What's the problem this PR addresses?
This PR adds support for common CI workflow, when user caches only some of
node_modules
roots, top-levelnode_modules
root for example and "forgets" to cache them all (or it is difficult for the user to do so)How did you fix it?
When we read previous install state, we now run fast check to see wether all the
node_modules
roots are present on the file system and if some of them do not - we account that the tree branch that starts from non-existent module root is not here and should be installed.cc @nicolo-ribaudo