Closed MattFromGer closed 2 weeks 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.
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
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.
Yes indeed, if I copy the file to the root directory, the plugin works as intended
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
@radoslawkoziol - Thank you for the additional context.
@dinbtechit Any updates on this? Can we expect the fix? ;)
@radoslawkoziol - sorry for the delay... I haven't much bandwidth to work on this. But I'll look into this over the weekend.
I think the easiest way to solve this issue would be to make the path to the nest-cli.json
file configurable in settings.
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?
Well, so parsing package.json and looking there for nest.js could be another way
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
.
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)
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.
Fixed in v0.0.3
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:
PhpStorm 2023.3.2