mantra-cli
mantra-cli copied to clipboard
Feature Request: rename
It would be handy to have a possibility to rename certain modules, containers, components, etc. Doing it manually tends to produce human errors :)
There were definitely moments when I thought such feature would be useful. I suppose we can add a command:
mantra rename [type] [original name] [new name]
For each types, we will need to change:
- containers - rename container, component, test
- component - rename component, test
- collection - rename collection, change variables in
/collections/index.js - method - rename method, change variables in
/methods/index.js - module - rename the module name, and change variables in the entry file.
Changing variable names is kind of tricky. Currently we are using this function, but I have seen some edge cases. We need more thorough testing.
I think it is not an easy feature, but is worth implementing.
Let me know if you need help implementing it or testing it
This would be indeed very handy, though, its not completly trivial. Maybe we should start with renaming all files and imports (that's the easy part). Changing variable names is more tricky, as @sungwoncho stated.
+1 for this. Renaming component, container or other types would be a great feature