dinbtechit / jetbrains-nestjs

NestJS CLI and IntelliSense
https://plugins.jetbrains.com/plugin/22771-nestjs
BSD 2-Clause "Simplified" License
5 stars 1 forks source link

Add monorepo support: Right now schematics are not showing up under "New..." #2

Closed MattFromGer closed 2 weeks ago

MattFromGer commented 10 months ago

Question:

After installing the plugin from the marketplace and restarting the IDE, the NestJs Schematics are not showing up in the "New..." context menu. Are there any prerequisites I'm missing?

Platform & Language Details:

dinbtechit commented 10 months ago

is there a nestjs.cli file exist in the root of the project? Every nestjs project should have one. If there isn't one, then NestJS Schematics will not show up in the new context menu.

MattFromGer commented 10 months ago

There's a nest-cli.json in my project, but it's not in the root directory, since my Nest project is part of a npm workspaces monorepo

dinbtechit commented 10 months ago

ahh! You have a monorepo of npm workspaces. interesting. It definitely does not handle the npm monorepo workspaces. Just to test, can you try creating an empty nest-cli.json file in the root of the project. Hopefully that should show you the nest schematics in the new context menu.

MattFromGer commented 10 months ago

Yes indeed, if I copy the file to the root directory, the plugin works as intended

radoslawkoziol commented 9 months ago

The same here. I have a nestjs / angular monorepo structured like this:

my_project/
├─ packages/
│  ├─ front /
│  ├─ api/
│  │  ├─ nest-cli.json

front contains angular project, api contains nestJS project. I think it should see API directory as nestJS project. To have the context menu and nestJS file icons

dinbtechit commented 9 months ago

@radoslawkoziol - Thank you for the additional context.

radoslawkoziol commented 5 months ago

@dinbtechit Any updates on this? Can we expect the fix? ;)

dinbtechit commented 5 months ago

@radoslawkoziol - sorry for the delay... I haven't much bandwidth to work on this. But I'll look into this over the weekend.

lots0logs commented 2 months ago

I think the easiest way to solve this issue would be to make the path to the nest-cli.json file configurable in settings.

dinbtechit commented 2 months ago

I guess that's definitely one way of solving the problem but some projects don't even have a nest-cli.json file in them. Btw can you send me your file structure?

radoslawkoziol commented 2 months ago

Well, so parsing package.json and looking there for nest.js could be another way

radoslawkoziol commented 2 months ago

And, as I understand, the plugin looks for nest-cli.json only to get the root directory of the project. So what @lots0logs means is we could have a configurable root directory.

lots0logs commented 2 months ago

So what @lots0logs means is we could have a configurable root directory.

Yes, that's what I meant. My root level project is just a meta repo full of submodules that contain all the things. So I don't think knowing the specific directory structure would be helpful since everyone's directory structures will be different. But for the record, my nest project is located at web/apps/auth-server (relative to the idea project root).

I kind of wonder how beneficial it actually is to not fully load the plugin when it doesn't find a nest project. I doubt it makes much of a difference performance-wise anyway (vs removing the check and always loading the plugin)

radoslawkoziol commented 2 months ago

I think it's not about the performance, but just not to have nest-related things in a non-nest project.

Anyway, fixing it shouldn't be difficult.

dinbtechit commented 2 weeks ago

Fixed in v0.0.3