Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(conventional-commits): Preserve major version zero on breaking c…
…hanges (#2486) According to semver, major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable. The version 1.0.0 defines the (initial stable) public API. To allow monorepos to use major version zero meaningfully, the transition from 0.x to 1.x must be explicitly requested by the user. Breaking changes MUST NOT automatically bump the major version from 0.x to 1.x. The usual convention is to use semver-patch bumps for bugfix releases and semver-minor for everything else, including breaking changes. This matches the behavior of `^` operator as implemented by `npm`. This commit implements the convention described above: - a patch-level change bumps semver-patch version (NO CHANGE) - a minor-level change bumps semver-minor version (NO CHANGE) - a major-level (breaking) change bumps semver-minor version (NEW) Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
- Loading branch information
Showing
8 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
core/conventional-commits/__tests__/__fixtures__/major-zero/lerna.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"command": { | ||
"publish": { | ||
"conventionalCommits": true | ||
} | ||
}, | ||
"version": "independent" | ||
} |
5 changes: 5 additions & 0 deletions
5
core/conventional-commits/__tests__/__fixtures__/major-zero/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "conventional-commits-major-zero", | ||
"repository": "lerna/conventional-commits-major-zero", | ||
"version": "0.0.0-root" | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
core/conventional-commits/__tests__/__fixtures__/major-zero/packages/package-0/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "package-0", | ||
"repository": "lerna/conventional-commits-major-zero", | ||
"version": "0.1.0" | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
core/conventional-commits/__tests__/__fixtures__/major-zero/packages/package-1/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "package-1", | ||
"repository": "lerna/conventional-commits-major-zero", | ||
"version": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters