Hi Folks I am new to …

2 minute read

Hi Folks,

I am new to Nx and I am in the process of creating some custom schematics for my workspace. Specifically, I want help in running custom plugins that contain schematics that is local to my workspace.

Details:

However, I would like to have this part of a plugin so:

I am not sure how to run this custom schematic that is part of my lib/custom-react plugin library.

I checked the docs: https://nx.dev/react/plugins/nx-plugin/overview and I could not find a way to run this locally.

Can someone please help me. Thanks!

Responses:

I actually ran into this recently and would like to know as well.

One obvious solution would be to publish your plugin to npm or a private registry and then add it to your package.json, but that seems overkill for sure.

There’s no easy way to run an nx plugin within a repo, without actually publishing it. This functionality could be added though :thinking_face:

Thanks, Jon, nx workspace-schematic works great and would satisfy my current need. Except that: • It would be nice to use nx list <plugin> to see the list of schematics • And use the regular nx generate <plugin>:<schematic> command pattern (one less command to remember :slightly_smiling_face: ) Just a couple of thoughts.

I ran into this. The docs default to a brand new workspace for plugin creation, but then say: > If you do not want to create a new workspace, install the @nrwl/nx-plugin dependency in an already existing workspace with npm or yarn. Then run nx g @nrwl/nx-plugin:plugin [pluginName]. But don’t mention how to run them it seems.

on https://nx.dev/react/plugins/nx-plugin/overview

The plugins themselves aren’t able to be ran within their workspace. They’re intended to be published and shared across orgs

A feature request could be created on github and I could carve out some time to investigate

That would be awesome . If someone else doesn’t get to it before me I’ll try to write up a feature request later this week.

created a github feature request: https://github.com/nrwl/nx/issues/3231 for this. Also liked this slack thread in the description.

Thanks!

Relevant office hours q https://youtu.be/ChQsqGheQzc?t=1124

Updated: