Hi guys happy easter …

2 minute read

Hi guys, happy easter! :rabbit: I was wondering if the tools directory in a nx workspace is supposed to be the place where I put my custom nx-plugins into? And if so, how would I do that? if I create a new nx-plugin using the nx schematics within an existing nx workspace, it will be created inside the libs folder, and there will be a related e2e test inside the apps folder. I would very much like to separate tooling from application, so is there a way to move the plugin related code into the tools folder?

Responses:

tools is used more for custom schematics, build tools etc etc. Custom plugin is a library so belongs in the lib folder

but this “plugin” is a custom schematic - a custom build step in my pipeline actually. from my point of view it should go into the tools folder. it feels wrong to have that next the application code

A build step isnt the same as schematic. Is it an facade builder or is it a just a way for creating boilerplate for the pipeline? Can i see an example. Don’t forget the concept of a library is for reusable and 3rd party.

I created a nx-plugin for our project for compodoc, it has 2 builders, one for generating static output in ci pipeline, one for creating watch mode locally for developers. it also contains a schematic to add compodoc configurations for library projects within the nx workspace. the whole plugin is clearly tooling to the project. my developers get confused because there is suddenly libs and e2e tests next to application code which is not connected to the application.

Now one could argue that this plugin should have its own project and its own repo. Be that as it may, this plugin is targeting our nx monorepo, so I don’t see the need to put it in a separate repo - I indeed want to have it in the same repo, just not in the same folder

to me, the tools folder clearly is the perfect location for plugin related code

THis is actually a nice little library and should belong in the libs. Also could you opensource this lib or publish it. It be nice for my projects. Im always using compodocs

What you have built isn’t a tooling. Its a library to help create the project.

TBH i was shocked when at first with creating plugins in libraries. However it does make perfect sense

anyway you are right, this should be open sourced… I guess I will make that my easter project

Updated: