etkachev / nx-webstorm

Plugin for Webstorm that strives to function the same as Nx Console for VsCode. UI for Nx
MIT License
35 stars 4 forks source link

Doesn't work with custom schematics #80

Open tamtakoe opened 3 years ago

tamtakoe commented 3 years ago

Current Behavior

There is no custom workspace generators in the IDE menu (in comparison on NX console Idea project)

How to Reproduce

Make NX project (I used angular-nest preset) Create generator in the /tools/generators. Set the same directory in the plugin Custom Schematics settings. Run nx workspace-generator custom-component "demo-component" to test that cli works

Expected Behavior

workspace-schematic:CustomComponent should be in the IDE menu

but it is not.

etkachev commented 2 years ago

Hello. Are you still having this issue? I did the following:

  1. ran nx generate @nrwl/workspace:workspace-generator --name=custom-component
  2. then searching in the nx toolwindow, I see the new generator below image
pongells commented 1 year ago

@etkachev it seems workspace-schematic are deprecated in favor of "local generators" (https://nx.dev/recipes/generators/local-generators) which are basically the same but inside a library... I am struggling to make these recognised by your plugin even changing the path in the settings.. any idea?

etkachev commented 1 year ago

yea I haven't updated to latest nx features. Do you keep your local generators in different projects within the workspace?

pongells commented 1 year ago

Hmm in my case, I have a library called "tools" under "libs/" and I use it in the entire monorepo. But nothing prevents you from having multiple libraries.. what they call "local plugins" are just special libraries, as far as I understand.

e.g. in the "tools" library I have a file called generators.json which contains the definition of the generators available in that library..

// generators.json
{
  "$schema": "http://json-schema.org/schema",
  "name": "my-tools",
  "version": "0.0.1",
  "generators": {
    "my-tools": {
      "factory": "./src/generators/my-tools/generator",
      "schema": "./src/generators/my-tools/schema.json",
      "description": "my-tools generator"
    },
    "my-component": {
      "factory": "./src/generators/my-component/generator",
      "schema": "./src/generators/my-component/schema.json",
      "description": "my component generator"
    }
  }
}

I assume this is the same format as the "external generators" like @nrwl/react etc... it is even added to the tsconfig.base.json paths

etkachev commented 1 year ago

I also wanted to let you know about slowly deprecating this plugin in favor for the official on by Nrwl: https://plugins.jetbrains.com/plugin/21060-nx-console