nrwl/nx

Can't move angular library to a grouping folder

Chudroy opened this issue · 0 comments

Chudroy commented

Current Behavior

If I want to move an angular library to a grouping folder with other libs already in it, I get an error

Invalid destination: [libs/shared] - Path is not empty.

Expected Behavior

To be able to move my lib to a folder that already has another lib within it, as per nx folder structure docs, to be able to use grouping folders.

GitHub Repo

https://github.com/Chudroy/nx-move-lib-bug

Steps to Reproduce

1.npx nx generate @nx/angular:library --directory=libs/test-lib --no-interactive

2.npx nx generate @nx/angular:library --directory=libs/shared/test-lib-2 --no-interactive

3.npx nx generate @nx/workspace:move --destination=libs/shared --projectName=test-lib --no-interactive --dry-run

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.11.0
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 10.9.0

nx                     : 20.2.2
@nx/js                 : 20.2.2
@nx/jest               : 20.2.2
@nx/eslint             : 20.2.2
@nx/workspace          : 20.2.2
@nx/angular            : 20.2.2
@nx/devkit             : 20.2.2
@nx/eslint-plugin      : 20.2.2
@nx/module-federation  : 20.2.2
@nx/web                : 20.2.2
@nx/webpack            : 20.2.2
typescript             : 5.6.3
---------------------------------------
Community plugins:
angular-eslint : 19.0.2

Failure Logs

NX   Invalid destination: [libs/shared] - Path is not empty.

Error: Invalid destination: [libs/shared] - Path is not empty.
    at checkDestination (/home/ngaritagoitia/Documentos/playground/test/node_modules/@nx/workspace/src/generators/move/lib/check-destination.js:18:15)
    at moveGenerator (/home/ngaritagoitia/Documentos/playground/test/node_modules/@nx/workspace/src/generators/move/move.js:25:46)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async /home/ngaritagoitia/Documentos/playground/test/node_modules/nx/src/command-line/generate/generate.js:240:26
    at async handleErrors (/home/ngaritagoitia/Documentos/playground/test/node_modules/nx/src/utils/handle-errors.js:8:24)
    at async Object.handler (/home/ngaritagoitia/Documentos/playground/test/node_modules/nx/src/command-line/generate/command-object.js:13:22)

Package Manager Version

No response

Operating System

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

Additional Information

No response