nestjs / nest-cli

CLI tool for Nest applications 🍹

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] - nestCLI option to generate Command and Events

dinbtechit opened this issue · comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Currently, we have to manually create the Command, Command Handler, Event, and EventHandler, and then add them to the module file. It would be helpful to have an automation feature for this process.

Describe the solution you'd like

nest g command kill-dragon

Should generate:
kill-dragon.command.ts
kill-dragon.handler.ts

nest g event hero-kill-dragon

Should generate:
hero-killed-dragon.event.ts
hero-killed-dragon.handler.ts

Teachability, documentation, adoption, migration strategy

No response

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

I'm the developer of NestJS plugin for Jetbrains IDE. I would like the plugin to support code generation for command and events. This would also help to implement the navigating between the usage and implementation as I would have a more consistent folder structure.

Thanks for your suggestion!

There are no plans to implement it in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.