-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Wrong dependent task gets run when using pnpm relative path reference (eg. workspace:../path/to/dep
)
#6744
Comments
workspace:../path/to/dep
referenceworkspace:../path/to/dep
)
Possibly related turbo/crates/turborepo-repository/src/package_graph/builder.rs Lines 624 to 626 in 4be6e0e
|
I know this isn't a fix for the underlying issue, but could you use the other |
I mentioned that alternate strategy in a note in the original issue text, yeah. That strategy won't work for me for reasons that I shouldn't get into here. I just want to make sure that Vercel is aware of the bug in Turbo. |
Ah, my bad for not reading the issue closely enough. Thanks for opening the issue and the repro. |
### Description Fixes #6744 I highly suggest reviewing each commit on it's own as the code move done in the first commit makes the cumulative diff hard to understand. I wanted to clean up this code a bit as we'll need to extend it further for supporting #7188 This adds support for the PNPM feature of [aliasing a package via path](https://pnpm.io/workspaces#referencing-workspace-packages-through-their-relative-path). The slightly tricky part of this is that there are many valid specifiers for the `workspace:` protocol. We currently support `workspace:1.2.3`, `workspace:*`, [`workspace:bar@*`](https://pnpm.io/workspaces#referencing-workspace-packages-through-aliases), `workspace:../path/to/package`. ### Testing Instructions Added unit tests for the case of a dependency of the form `"foo": "workspace:../bar"` where `foo` is another workspace package. Verified fix works with repro provided in: #6744
Verify canary release
Link to code that reproduces this issue
https://github.com/steveluscher/pnpm-alias-pathspec-repro.git
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
1.11.1-canary.0
Describe the Bug
Imagine that you:
"luigi": "workspace:../waluigi"
)luigi
)…then you run some turborepo task.
pnpm i cd packages/app/ pnpm turbo hello
Turborepo will run the task in the wrong workspace package; the
hello
script fromluigi/package.json
runs.Expected Behavior
Since the dependency
luigi
is aliased toworkspace:../waluigi
, I would expect thehello
script fromwaluigi/package.json
to run.To Reproduce
Follow the README in https://github.com/steveluscher/pnpm-alias-pathspec-repro.git.
Additional context
Note
If you change the dependency in
app/package.json
from"luigi": "workspace:../waluigi"
to"luigi": "workspace:waluigi@*"
it works as expected.TURBO-1899
The text was updated successfully, but these errors were encountered: