1
Renaming a module
Gregor Martynus edited this page 2016-03-22 12:21:38 -04:00
Let’s say you have mymodule-oldname with the latest version 1.2.3 released in the npm registry, and you want to rename it to mymodule-newname, you need do to three things, before you push your changes to master and let semantic-release do its thing.
- In package.json, where
"name"should already be"mymodule-newname", add"version": "1.2.3"(or what ever the latest released version ofmymodule-oldnameis. - run
npm publish, this will create+mymodule-newname@1.2.3in the npm registry git checkout package.jsonto make sure you do not commit the added"version"
After a package name change, it’s recommended to do a major version bump. For that you can do something like this:
git commit --allow-empty -m 'chore: renamed module to mymodule-newname
BREAKING CHANGE:
The repository has been renamed from `mymodule-oldname` to `mymodule-newname`
That way you can make sure that the semantic-release setup works with the new package name, and also avoid send a signal that there might be breaking changes and people should test their code before updating.