Open tamtakoe opened 3 years ago
Hello. Are you still having this issue? I did the following:
nx generate @nrwl/workspace:workspace-generator --name=custom-component
@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?
yea I haven't updated to latest nx features. Do you keep your local generators in different projects within the workspace?
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
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
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. Runnx workspace-generator custom-component "demo-component"
to test that cli worksExpected Behavior
workspace-schematic:CustomComponent
should be in the IDE menubut it is not.