1
Renaming a module
Gregor Martynus edited this page 2016-03-22 12:21:38 -04:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Lets 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.

  1. In package.json, where "name" should already be "mymodule-newname", add "version": "1.2.3" (or what ever the latest released version of mymodule-oldname is.
  2. run npm publish, this will create +mymodule-newname@1.2.3 in the npm registry
  3. git checkout package.json to make sure you do not commit the added "version"

After a package name change, its 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.