I have two queries Is there only one way to delete lightning Component? that is Dev Console File--> Delete
How To Rename Lightning Component?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You can also query for the AuraDefinitionBundle from developer console and simply change the DeveloperName
The other way to do this via ANT migration tool .You will create a destructive xml like below
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>page</members> <members>example</members> <name>AuraDefinitionBundle</name> </types> <version>37.0</version>
and then an empty package.xml
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <version>37.0</version> </Package>
Use ANT to build this and this would destroy the component bundle mentioned in the destrutiveChanges xml
Renaming Currently is pain ,I prefer recreating a new component and copy paste it and delete older via dev console .Using tools like ANT or force.com CLI is quicker .
We can run below query in developer console query editor. It will return all the aura component name in DeveloperName column.
SELECT Id, DeveloperName FROM AuraDefinitionBundle
Now we can edit Developer Name and save it. It will reflect all the place wherever the component is used. If you are using the component in controller and helper, It will reflect there also.
I just ran through this issue and found that renaming the files in a lightning component, plus all the controllers, is a huge pain. Especially if you are creating a managed package.
What I found to be the easiest was to provide a new label for the component via the design file. This will change the name presented in the UI and requires no file name or metadata changes.
<design:component label="A Better Name"> </design:component>