A developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning formats, what should the new package version number be?
Correct Answer: D
The correct answer is D.
Semantic versioning usually follows this format:
MAJOR.MINOR.PATCH
For the version:
1.1.3
The parts are:
1 = MAJOR
1 = MINOR
3 = PATCH
A package version should be updated based on the type of change:
MAJOR version changes when there are breaking changes.
MINOR version changes when new features are added in a backward-compatible way.
PATCH version changes when backward-compatible bug fixes are added.
The question says the developer added new features that do not break backward compatibility. That means the minor version should increase.
Starting version:
1.1.3
Increase the minor version from 1 to 2, and reset the patch version to 0:
1.2.0
Why the other options are incorrect:
A . 1.2.3 is incorrect because when the minor version increases, the patch version should reset to 0.
B . 1.1.4 is incorrect because that would represent a patch update, usually for bug fixes, not new features.
C . 2.0.0 is incorrect because that would represent a major version update, usually for breaking changes.
D . 1.2.0 is correct because it represents a backward-compatible feature release.
Therefore, the verified answe r is D.