Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MattFromGer opened this issue Jan 4, 2024 · 15 comments
Labels
enhancement New feature or request

Comments

@MattFromGer
Copy link

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:

  • IDE Details: PhpStorm 2023.3.2
@MattFromGer MattFromGer added the question Further information is requested label Jan 4, 2024
@dinbtechit
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

dinbtechit commented Jan 5, 2024

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
Copy link
Author

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

@MattFromGer MattFromGer changed the title [Question] - Schematics not showing up under "New..." Add monorepo support: Right now schematics are not showing up under "New..." Jan 5, 2024
@radoslawkoziol
Copy link

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
Copy link
Owner

@radoslawkoziol - Thank you for the additional context.

@radoslawkoziol
Copy link

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

@dinbtechit
Copy link
Owner

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

@lots0logs
Copy link

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
Copy link
Owner

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
Copy link

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

@radoslawkoziol
Copy link

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
Copy link

lots0logs commented Sep 8, 2024

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
Copy link

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 added a commit that referenced this issue Oct 26, 2024
@dinbtechit dinbtechit added enhancement New feature or request and removed question Further information is requested labels Oct 26, 2024
dinbtechit added a commit that referenced this issue Oct 26, 2024
@dinbtechit
Copy link
Owner

dinbtechit commented Oct 26, 2024

Fixed in v0.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants