mantra-cli icon indicating copy to clipboard operation
mantra-cli copied to clipboard

Feature Request: rename

Open PolGuixe opened this issue 9 years ago • 4 comments
trafficstars

It would be handy to have a possibility to rename certain modules, containers, components, etc. Doing it manually tends to produce human errors :)

PolGuixe avatar Jul 27 '16 10:07 PolGuixe

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.

sungwoncho avatar Jul 28 '16 10:07 sungwoncho

Let me know if you need help implementing it or testing it

PolGuixe avatar Jul 30 '16 03:07 PolGuixe

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.

macrozone avatar Sep 09 '16 09:09 macrozone

+1 for this. Renaming component, container or other types would be a great feature

oracle000 avatar Oct 17 '16 06:10 oracle000