nrwl / nx

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

Generating a nestjs app targeting a directory create the e2e project with the wrong name #18806

Closed carantes closed 1 year ago

carantes commented 1 year ago

Current Behavior

Created a new Nestjs app targeting a directory using the following command

nx g @nx/nest:app myservice --directory services

The new app was bootstrapped correctly inside of the apps/services folder but the e2e app was created with a wrong name: services-myservice-e2e.

NX version: v16.7.2``

Expected Behavior

The e2e app was created in the right folder but with an incorrect name, it should be the same name defined to myservice.

/apps/services/myservice

GitHub Repo

No response

Steps to Reproduce

  1. Create a new NX workspace npx create-nx-workspace myworkspace --preset=nest

  2. Create a new NestJS app targeting a directory

nx g @nx/nest:app myservice --directory services

Nx Report

nx report

 >  NX   Configuration Error

   The following implicitDependencies point to non-existent project(s):
     gateway-e2e
       gateway

Failure Logs

No response

Operating System

Additional Information

No response

carantes commented 1 year ago

Also the project name in the project.json file was created with the directory appended to it, I had to manually change it. After change it the configuration error in the nx report disappeared.

FrozenPandaz commented 1 year ago

I think this was unintentionally fixed by #18701.

Could you check this behavior on 16.8.0-beta.2?

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! 🙏

carantes commented 1 year ago

@FrozenPandaz I retested it on v16.8.1 and it works if you use the full path, including the service name on the --directory flag:

nx g @nx/nest:app myservice --directory apps/services/myservice

Screenshot 2023-09-08 at 09 06 45

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.