nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.63k stars 2.36k forks source link

graph: `include` & `exclude` params being ignored #12608

Closed alexciesielski closed 1 year ago

alexciesielski commented 2 years ago

Current Behavior

Running

nx graph --focus=todos-feature-main --exclude=project-one,project-two

correctly focuses on todos-feature-main but does not exclude projects project-one and project-two.

Expected Behavior

I expect both projects project-one and project-two to not be highlighted/visible/selected

Steps to Reproduce

git clone git@github.com:nrwl/nx-examples.git
cd nx-examples
npm i
nx graph --focus=cart --exclude=shared-header

Even though I exclude shared-header, it is still highlighted and rendered in the graph. Basically whatever I define for --include or --exclude is not being considered when rendering the graph. The only param that works is --focus.

Environment

Tried in both the nx-examples repo and in my project with the latest version of nx.

   OS   : darwin arm64
   npm  : 8.16.0

   nx : 14.8.6
   @nrwl/angular : 14.8.6
   @nrwl/cypress : 14.8.6
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.8.6
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 14.8.6
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.8.6
   @nrwl/js : 14.8.6
   @nrwl/linter : 14.8.6
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.7.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : 14.8.6
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.8.6
   @nrwl/web : 14.8.6
   @nrwl/webpack : 14.8.6
   @nrwl/workspace : 14.8.6
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
     @datorama/akita: 7.1.1
     @fortawesome/angular-fontawesome: 0.11.1
     @ngneat/hot-toast: 4.1.0
     @ngneat/tailwind: 7.0.3
     ngx-daterangepicker-material: 3.0.4
     @storybook/angular: 7.0.0-alpha.33
     ng-mocks: 14.0.1
     nx-stylelint: 13.5.3
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

lewsmith commented 1 year ago

I've got this issue too. I have a custom plugin in my libs dir that I don't want on my graph. But when running

nx graph --exclude=my-custom-plugin

I still see the my-custom-plugin project.

Would be nice to have a way to permanently disable a project from the graph without having to specify --exclude, but for now I'd be more than happy if it worked, it's been a while since I've used the option, it was definitely working for me a while back.

Node   : 18.16.0
   OS     : linux x64
   pnpm   : 8.3.1
   Hasher : Native

   nx             : 16.1.4
   @nx/js         : 16.1.4
   @nx/jest       : 16.1.4
   @nx/linter     : 16.1.4
   @nx/workspace  : 16.1.4
   @nx/devkit     : 16.1.4
   @nrwl/tao      : 16.1.4
   nx-cloud       : 16.0.5
   typescript     : 4.9.5
github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.