Sublime Forum

Package Control Versioning

#1

How exactly does Package Control detect versions, does it use the tag or the commit of a tag to determine the version? What effect would it have, if an author decides to rename all previous tags and use a new versioning scheme?

For a package of mine I made the foolish decision to follow the version numbers of the software it adds support for. The version started at 5.x and now I was wondering what would happen if I decide to use my own version numbers, renaming all previous 5.x releases to 1.x. Would this break Package Control updates? Is there a graceful way around this?

0 Likes

#2

Version numbers for newer packages grab the list of tags and search for tags that are valid semver version numbers (with optional leading v). Older packages with branch-based releases (a new release with every commit), have the date of the commit converted to a very low semver (0.0.1 plus a date-based suffix). Whether tags or a branch is used is controlled by the JSON at https://github.com/wbond/package_control_channel.

When a package is installed, the current version number is then stored on the user’s machine in the package-metadata.json file in the package. When an automatic or manual upgrade happens, it looks for packages with newer versions than what is installed. Thus, once a version number has been released, the only direction it can go is up. In your case that means it is not feasible to go from 5.x to 1.x.

4 Likes