Open timostamm opened 4 months ago
Thanks for the report! The package scoping is definitely a bug.
It looks like --filter requires the leading ./ as well:
This is correct, directory based filters start with a ./
to indicate you're specifying a path and not a package name. See https://turbo.build/repo/docs/crafting-your-repository/running-tasks#filtering-by-directory
Verify canary release
Link to code that reproduces this issue
https://github.com/timostamm/turbotest
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
v2.0.5 - there's no newer canary
Describe the Bug
In an npm project where workspaces are declared with a leading
./
, Automatic Package Scoping is unable to locate the package.package.json:
It looks like
--filter
requires the leading./
as well:We do not get a match when omitting
./
:Expected Behavior
I expect filters to match
packages/foo
regardless of the leading./
declared in the workspace path, same as npm.Ideally,
./packages/foo
would match both forms. It appears that paths are already normalized (npx turbo run test -F ./packages/../packages/bar
locatesbar
as expected), but don't normalize the leading./
.To Reproduce
See https://github.com/timostamm/turbotest for a minimal reproducible example.
Additional context
Also see discussion https://github.com/vercel/turbo/discussions/8514