fix(yarn) pnp workspace support#1393
fix(yarn) pnp workspace support#1393charlespierce merged 2 commits intovolta-cli:mainfrom mufasa71:fix-workspace-pnp
Conversation
charlespierce
left a comment
There was a problem hiding this comment.
Thanks for taking this on! A suggestion to avoid duplicating work. Also, there may be some merge conflicts with #1388 which is adding another file to the checks here, so if that is merged first, it will need to be resolved.
crates/volta-core/src/project/mod.rs
Outdated
| base_dir.join(".pnp.js").exists() | ||
| || base_dir.join(".pnp.cjs").exists() | ||
| || self | ||
| .workspace_roots() |
There was a problem hiding this comment.
I think this winds up duplicating work: self.workspace_roots() includes as the first entry the parent of self.manifest_file, so we're re-checking that. Instead, I think this check that you have is already exactly what we want (and can replace the whole self.manifest_file... check)
self
.workspace_roots()
.any(|dir| dir.join(".pnp.cjs").exists() || dir.join(".pnp.js").exists())There was a problem hiding this comment.
Thanks I applied changes, will wait until #1388 is merged to resolve conflicts.
There was a problem hiding this comment.
Looks like #1388 is merged, can we merge this now?
Yarn berry works great with single mode, but does not works if inside workspace directory. I found that this line does not respect root monorepo:
volta/crates/volta-core/src/project/mod.rs
Line 176 in 7827ade
as it expect
.pnp.json same level as root dir. But workspace dir does not have.pnp.jshence it works fine with yarn berry. likeyarn why packagename