docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

Add documentations on how to write Custom Plugin to work with NestCLI

Open nartc opened this issue 5 years ago • 8 comments
trafficstars

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request (new chapter/page)
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Currently, there is no documentations on NestJS site to point consumers to building their own custom plugins for NestJS CLI. The information about TypeScript plugin is scarce as it is.

Expected behavior

NestJS docs should at least have a section (which page? which section?) to get developers started on how they can build and use a custom plugin with NestJS CLI

What is the motivation / use case for changing the behavior?

Consider how powerful and useful the Swagger Plugin is, it is beneficial to provide a short documentation on the topic. Maybe the consumers have their own library and they want to leverage NestJS CLI to run their plugins as well.

Others:

I can write the documentation for this. This issue is mainly seeking for an "OK" and a place (which page? which section?) where to put the documentation about this.

nartc avatar Feb 05 '20 15:02 nartc

For now, I would consider plugins as a veeery experimental feature. We should add a dedicated chapter at some point in the future though :)

kamilmysliwiec avatar Feb 05 '20 19:02 kamilmysliwiec

Any news about this issue?

eduardosplima avatar Jun 28 '21 18:06 eduardosplima

I certainly would benefit from this feature, for example the Swagger Plugin appends decorators on the fly based on certain modifiable rules. I would enjoy being able to extend this plugin or create a new one, in order to, for instance, append the @ApiUnauthorizedResponse() decorator to all routes which are not public. I don't know if the DiscoveryService would suffice.

DanielMaranhao avatar Jan 07 '23 17:01 DanielMaranhao

For now, I would consider plugins as a veeery experimental feature. We should add a dedicated chapter at some point in the future though :)

Is it the future now, by any chance?

RWOverdijk avatar Jul 31 '23 15:07 RWOverdijk

Any update?

havsar avatar Aug 19 '23 01:08 havsar

I'm also very interested in updates here, since I'm planning to create a custom transformer and I don't want to use solutions like ttypescript or ts-patch, at least not directly, and because nest.js have this feature for many years, I'm quite sure this is stable enough to be shared outside.

jefersonla avatar Oct 16 '23 15:10 jefersonla

I'm also interested. Any news on this?

sgmonda avatar Feb 02 '24 10:02 sgmonda

Hello again, for the use case I mentioned above, I've tried using the DiscoveryService inside an onApplicationBootstrap() method to obtain references to the controllers and then the route handlers. After that, I modified the metadata related to the Swagger responses. I've checked that the previous metadata existed and just appended to it but still, the modification does not appear on the Swagger UI. Maybe this is happening "too late", would someone know of an alternative? Or is this custom plugin feature absolutely necessary?

DanielMaranhao avatar May 05 '24 21:05 DanielMaranhao