Skip to content
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

Cannot ignore root directories #20358

Closed
1 of 4 tasks
itsRems opened this issue Nov 21, 2023 · 6 comments · Fixed by #20500
Closed
1 of 4 tasks

Cannot ignore root directories #20358

itsRems opened this issue Nov 21, 2023 · 6 comments · Fixed by #20500
Assignees
Labels

Comments

@itsRems
Copy link

itsRems commented Nov 21, 2023

Current Behavior

Considering the following structure:

├─ v1/
│ ├─ packages
│ │├─ pkg-a 
│ │└─ pkg-b
└ packages/
   └─ pkg-c

I would like to set my .nxignore to:

./packages

in order to ignore the root packages directory, but NOT the packages in the v1/packages directory.

However, nx fails to respect my ignore when using the ./ prefix, and therefore includes all packages when running commands.

Expected Behavior

This works fine in nx 16.1.4, where only the root ./packages directory is ignored, but hasn't worked any time we've tried to update nx since. 17.1.3 still has the issue

GitHub Repo

No response

Steps to Reproduce

try to ignore any root directory

Nx Report

Node   : 18.17.1
   OS     : darwin-arm64
   yarn   : 4.0.1
   
   nx          : 17.1.3
   @nrwl/tao   : 17.1.3
   typescript  : 5.2.2

Failure Logs

No response

Package Manager Version

yarn 4.0.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the scope: core core nx functionality label Nov 29, 2023
@Cammisuli
Copy link
Member

Cammisuli commented Nov 29, 2023

can you try using /packages? The nxignore uses the same logic as gitignore, so that one should work.

We used to read and parse the nxignore file manually and handle special cases like this, but now we use a proper engine that allows us specify custom ignore files, and ./dir does not work in regular gitignore files.

@itsRems
Copy link
Author

itsRems commented Nov 30, 2023

@Cammisuli /packages ignores v1/packages

@Cammisuli
Copy link
Member

oh no, thats not right then. Let me take a closer look

@Cammisuli
Copy link
Member

After #20500 is released, you can use /packages in the root .nxignore properly. Sorry about that!

@itsRems
Copy link
Author

itsRems commented Nov 30, 2023

@Cammisuli thanks ! 🙌

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants