Software Engineering
versioning semantic-versioning
Updated Tue, 30 Aug 2022 11:32:33 GMT

Semantic Versioning and splitting apart a library, providing a bundled build


I've got a nice, fairly popular JavaScript library that is following Semantic Versioning.

The current library has a few dependency libraries, which are available either as separate downloads or as part of a single bundled download. I see a need to head down this path further. I want to extract additional, smaller libraries out of the one larger library. Each of these extracted libraries would be available as separate files, or inside of the one bundled build, again.

If I go down this path of extracting the libraries, and providing a bundled version of the final code, does this require a full version change in semantic versioning? Would I have to bump from 1.x to 2.x?

My first thought it no: I will not change any public API, so I don't have to change the major version number. But then I wonder... well, I am restructuring a lot of things, even though the final API for the bundled version would be the same.

Is there a clear answer from semver on something like this? Do I need to bump first, second or third dot? Or something else?




Solution

You should increment the patch (third) number.

While you are not fixing a bug, you are refactoring, that is modifying the structure of the problem without changing its behavior. You are also not changing the public API.

Relevant quotes from Semantic Versioning below

What should I do if I update my own dependencies without changing the public API?

That would be considered compatible since it does not affect the public API. Software that explicitly depends on the same dependencies as your package should have their own dependency specifications and the author will notice any conflicts. Determining whether the change is a patch level or minor level modification depends on whether you updated your dependencies in order to fix a bug or introduce new functionality. I would usually expect additional code for the latter instance, in which case it's obviously a minor level increment.

-

Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.







External Links

External links referenced by this document: