nx
nx copied to clipboard
Nx affected incorrectly considering all packages with workspaceRoot input
Current Behavior
The named input config targets the app packages config directory. When a file in packages/app/configs is modified, nx affected shows all packages. Additionally, changing the syntax a bit has the reverse problem where the other packages are never affected.
{workspaceRoot}/packages/app/configs/**/* - all packages affected
{projectRoot}/../app/configs/**/* - only app affected
Expected Behavior
When a file in packages/app/configs is modified, nx affected should show only app, it, and e2e as they are the only packages with a target that uses the input.
GitHub Repo
https://github.com/joshlartz/nx-workspace-input-affected
Steps to Reproduce
- edit a file in packages/app/configs
- run
pnpm nx show projects --affected - observe that all 5 packages are returned
- edit
nx.jsonnamed inputconfigto{projectRoot}/../app/configs/**/* - commit the change to main
- run
pnpm nx show projects --affected - observe that only the app package is returned
Nx Report
Node : 18.19.0
OS : darwin-arm64
pnpm : 7.33.6
nx : 17.3.2
@nrwl/tao : 17.3.2
typescript : 5.3.3
Failure Logs
No response
Package Manager Version
7.33.6
Operating System
- [X] macOS
- [X] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response