nrwl / nx

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

Adding NX to existing NestJS project guide #28807

Open ChristianBell1995 opened 2 weeks ago

ChristianBell1995 commented 2 weeks ago

Documentation issue

Adding nx to an existing NestJS project

I have an existing NestJS project with ~5 applications and ~30-40 libs which are used across these applications. I was wondering if anyone has any experience adding nx to an existing project?

I followed the guide here:

Using this library https://nx.dev/nx-api/nest I can create nest libs or applications which will show up in the dependency graph but can't see anywhere in the docs where you can run commands to add existing modules to the nx project.

Would be great if anyone has experience doing this so I know if it would be possible + how much time it would take! Thanks

jasonbdt commented 2 weeks ago

To generate NestJS Modules, Services etc. you have to use Generators that are provided by the @nx/nest Plugin.

Modules nx g @nx/nest:module apps/your-app/src/app/your-module

Services nx g @nx/nest:service apps/your-app/src/app/your-service

Did you mean this or do you need help migrating your existing Nest Project into nx workspace?