nx icon indicating copy to clipboard operation
nx copied to clipboard

Nx affected incorrectly considering all packages with workspaceRoot input

Open joshlartz opened this issue 1 year ago • 0 comments

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

  1. edit a file in packages/app/configs
  2. run pnpm nx show projects --affected
  3. observe that all 5 packages are returned
  4. edit nx.json named input config to {projectRoot}/../app/configs/**/*
  5. commit the change to main
  6. run pnpm nx show projects --affected
  7. 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

joshlartz avatar Feb 10 '24 03:02 joshlartz