Add make:clone command to duplicate existing modules
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 I would like to contribute to this feature. Assign this to me
Hi @rocambille I have created a PR for this feature. You can review it https://github.com/rocambille/start-express-react/pull/16
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 :)