Renaming a Companion Module
Occasionally you will need to rename a module, perhaps for example, to make the name more inclusive as you add more devices, or the manufacturer releases a new device.
-
Ask in the module-development slack for approval on the new name
This is so that we can be sure the new name conforms to our standard structure ofcompanion-module-manufacturer-product(orcompanion-module-manufacturer-protocol). -
Once approved, the team will be able to rename the GitHub repository for you.
-
Some additional changes need to be made. This might be done for you, or might be left for you to do:
- Update the
nameand any urls in thepackage.json - Update the
nameand related fields incompanion/manifest.json - Add the old name to the
legacyIdsarray incompanion/manifest.json. This lets Companion know of the rename, so that existing users will be migrated across.
- Update the
-
Once everything is updated, you will want to publish a new version and submit that for inclusion
When renaming a module like this, you must not decrease the number of upgrade scripts. The count will continue from the old module name, so removing any upgrade scripts will cause new ones to be missed for many users.