nestjs / nest-cli

CLI tool for Nest applications 🍹

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[discussion] Duplicates and rename resource structure command

LeDevNovice 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

When I develop NestJS application, I have often the moment where I used nest generate to create a new resources with its module, controller and service structure. But it appears that this new resource is exactly or almost exactly the same than another module of my project.

Describe the solution you'd like

One of my previous solution was to copy and paste a resource folder and manually change all the label where the resource name appear on filename and inside the codebase. But I have tested a bash script that make the works for me automatically and seems to be a good solution personally.

I was wondering if it was possible that I work on a solution where I implement a new command on the cli to have the same logic that in my bash script that I started to work on : https://github.com/LeDevNovice/nestjs-module-cloner

Teachability, documentation, adoption, migration strategy

No response

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

The primary purpose of this project is to streamline the process of creating new modules in a NestJS project by duplicating an existing module. This is particularly useful when you have a template module and want to create a new module with similar structure and functionality. It facilitates the duplication and renaming of a module in a NestJS application. It allows you to copy an existing module and update the filenames and content to reflect the new module and resource names.

To me this is something that you could achieve with a custom angular schematics. Otherwise seems to opinative to be in @nestjs/cli

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.