start-express-react icon indicating copy to clipboard operation
start-express-react copied to clipboard

Add make:clone command to duplicate existing modules

Open rocambille opened this issue 1 year ago • 3 comments

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

When creating a new module, I often need something very similar to an existing one. Currently, I have to manually copy files, rename classes, and adjust references, which is time-consuming and error-prone.

Describe the solution you'd like

Introduce a new command:

npm run make:clone path/to/existing/module path/to/new/module

This would automatically duplicate the structure and logic of existing module into new module, updating identifiers accordingly (case sensitive).

Describe alternatives you've considered

  • Manually copying and renaming files (slow, error-prone).
  • Adding an opinionated ̀make:crud (but this generates from a template, not from a working module).
  • Writing ad-hoc scripts per project (not reusable, not consistent).

Additional context

This feature would speed up development when building similar modules. It’s especially useful in large projects where patterns repeat but with slight variations.

rocambille avatar Sep 29 '25 12:09 rocambille

@rocambille I would like to contribute to this feature. Assign this to me

AhmadRaza365 avatar Oct 03 '25 09:10 AhmadRaza365

Hi @rocambille I have created a PR for this feature. You can review it https://github.com/rocambille/start-express-react/pull/16

AhmadRaza365 avatar Oct 03 '25 19:10 AhmadRaza365

Thank you so much @AhmadRaza365 🙏

It will take some time to test and review your proposition. Meanwhile I tagged the PR with the "hacktoberfest-accepted" label since it's high quality :)

rocambille avatar Oct 04 '25 08:10 rocambille