You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, due to the Windows path separator, this filter fails to work properly on Windows machines. When dirPath is apps/test and q is file-a.json, the join(this.rp(dirPath), q) function returns 'apps\test\file-a.json', which is not recognized by recordedChanges. As a result, the filter always returns true, causing deleted files to remain in the list.
Special thanks to @jesusreal for your collab investigation. 🙏
Expected Behavior
The tree.children method should filter out deleted files from the list.
Go to the src/app/app.component.spec.ts file where there is a test to add a file with a nested path to the tree then remove it and expect the list from tree.children to be empty
Run the test in that file
You should see the test fails on a Windows machine which indicates that the tree.children doesn't work. As a result, the children list is not empty.
Nx Report
> NX Report complete - copy this into the issue template
Node : 18.15.0
OS : win32 x64
npm : 9.5.0
nx : 15.9.2
@nrwl/js : 15.9.2
@nrwl/jest : 15.9.2
@nrwl/linter : 15.9.2
@nrwl/workspace : 15.9.2
@nrwl/angular : 15.9.2
@nrwl/cli : 15.9.2
@nrwl/cypress : 15.9.2
@nrwl/devkit : 16.1.4
@nrwl/eslint-plugin-nx : 15.9.2
@nrwl/tao : 15.9.2
@nrwl/web : 15.9.2
@nrwl/webpack : 15.9.2
typescript : 4.9.5
---------------------------------------
The following packages should match the installed version of nx
- @nrwl/[email protected]
To fix this, run `nx migrate [email protected]
Failure Logs
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
Currently, there is a filter in the
tree.children
method to exclude deleted files from the list.nx/packages/nx/src/generators/tree.ts
Lines 284 to 287 in 881067b
However, due to the Windows path separator, this filter fails to work properly on Windows machines. When
dirPath
isapps/test
andq
isfile-a.json
, thejoin(this.rp(dirPath), q)
function returns'apps\test\file-a.json'
, which is not recognized byrecordedChanges
. As a result, the filter always returnstrue
, causing deleted files to remain in the list.Special thanks to @jesusreal for your collab investigation. 🙏
Expected Behavior
The
tree.children
method should filter out deleted files from the list.GitHub Repo
https://github.com/neen-psk/nx-tree-children
Steps to Reproduce
npm i
src/app/app.component.spec.ts
file where there is a test to add a file with a nested path to the tree then remove it and expect the list fromtree.children
to be emptytree.children
doesn't work. As a result, the children list is not empty.Nx Report
Failure Logs
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: