conventional-recommended-bump 1.0.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -1
- package/README.md +9 -1
- package/cli.js +5 -2
- package/index.js +1 -1
- package/package.json +5 -5
- package/presets/eslint.js +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
<a name="1.2.1"></a>
|
|
7
|
+
## [1.2.1](https://github.com/conventional-changelog/conventional-recommended-bump/compare/conventional-recommended-bump@1.2.0...conventional-recommended-bump@1.2.1) (2018-02-05)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package conventional-recommended-bump
|
|
13
|
+
|
|
14
|
+
<a name="1.2.0"></a>
|
|
15
|
+
# [1.2.0](https://github.com/conventional-changelog/conventional-recommended-bump/compare/conventional-recommended-bump@1.1.0...conventional-recommended-bump@1.2.0) (2018-01-29)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* allow to specify a tagPrefix in conventional-recommended-bump ([f60f86f](https://github.com/conventional-changelog/conventional-recommended-bump/commit/f60f86f))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<a name="1.1.0"></a>
|
|
26
|
+
# [1.1.0](https://github.com/conventional-changelog/conventional-recommended-bump/compare/conventional-recommended-bump@1.0.3...conventional-recommended-bump@1.1.0) (2017-12-08)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **recommended-bump:** add `eslint` preset ([#256](https://github.com/conventional-changelog/conventional-recommended-bump/issues/256)) ([64abf07](https://github.com/conventional-changelog/conventional-recommended-bump/commit/64abf07))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<a name="1.0.3"></a>
|
|
37
|
+
## [1.0.3](https://github.com/conventional-changelog/conventional-recommended-bump/compare/conventional-recommended-bump@1.0.2...conventional-recommended-bump@1.0.3) (2017-11-13)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
**Note:** Version bump only for package conventional-recommended-bump
|
|
5
43
|
|
|
6
44
|
<a name="1.0.2"></a>
|
|
7
45
|
## [1.0.2](https://github.com/conventional-changelog/conventional-recommended-bump/compare/conventional-recommended-bump@1.0.1...conventional-recommended-bump@1.0.2) (2017-10-01)
|
package/README.md
CHANGED
|
@@ -77,6 +77,15 @@ An array of parsed commits. The commits are from last semver tag to `HEAD` and i
|
|
|
77
77
|
|
|
78
78
|
If it returns with `level` `0` it will be a `major` bump. If `1`, `minor` bump. If `2`, `patch`.
|
|
79
79
|
|
|
80
|
+
##### tagPrefix
|
|
81
|
+
|
|
82
|
+
Type: `string`
|
|
83
|
+
|
|
84
|
+
Specify a prefix for the git tag that will be taken into account during the comparison.
|
|
85
|
+
|
|
86
|
+
For instance if your version tag is prefixed by `version/` instead of `v` you would specify `--tagPrefix=version/`
|
|
87
|
+
|
|
88
|
+
|
|
80
89
|
#### parserOpts
|
|
81
90
|
|
|
82
91
|
See the [conventional-commits-parser](https://github.com/conventional-changelog/conventional-commits-parser) docs.
|
|
@@ -97,7 +106,6 @@ Type: `string` Possible values: `'major'`, `'minor'` and `'patch'`
|
|
|
97
106
|
|
|
98
107
|
The value of what it should release as.
|
|
99
108
|
|
|
100
|
-
|
|
101
109
|
## Related
|
|
102
110
|
|
|
103
111
|
- [conventional-github-releaser](https://github.com/conventional-changelog/conventional-github-releaser) - Make a new GitHub release from git metadata
|
package/cli.js
CHANGED
|
@@ -23,6 +23,7 @@ var cli = meow({
|
|
|
23
23
|
' -f, --field-pattern Regex to match other fields',
|
|
24
24
|
' -v, --verbose Verbose output',
|
|
25
25
|
' -l, --lerna-package Recommend a bump for a specific lerna package (:pkg-name@1.0.0)',
|
|
26
|
+
' -t, --tag-prefix Tag prefix to consider when reading the tags',
|
|
26
27
|
' --commit-path Recommend a bump scoped to a specific directory'
|
|
27
28
|
]
|
|
28
29
|
}, {
|
|
@@ -36,13 +37,15 @@ var cli = meow({
|
|
|
36
37
|
n: 'noteKeywords',
|
|
37
38
|
f: 'fieldPattern',
|
|
38
39
|
v: 'verbose',
|
|
39
|
-
l: 'lernaPackage'
|
|
40
|
+
l: 'lernaPackage',
|
|
41
|
+
t: 'tagPrefix'
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
var options = {
|
|
44
46
|
path: cli.flags.commitPath,
|
|
45
|
-
lernaPackage: cli.flags.lernaPackage
|
|
47
|
+
lernaPackage: cli.flags.lernaPackage,
|
|
48
|
+
tagPrefix: cli.flags.tagPrefix
|
|
46
49
|
};
|
|
47
50
|
var flags = cli.flags;
|
|
48
51
|
var preset = flags.preset;
|
package/index.js
CHANGED
|
@@ -83,7 +83,7 @@ function conventionalRecommendedBump(options, parserOpts, cb) {
|
|
|
83
83
|
|
|
84
84
|
cb(null, result);
|
|
85
85
|
}));
|
|
86
|
-
}, {lernaTags: !!options.lernaPackage, package: options.lernaPackage});
|
|
86
|
+
}, {lernaTags: !!options.lernaPackage, package: options.lernaPackage, tagPrefix: options.tagPrefix});
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
module.exports = conventionalRecommendedBump;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conventional-recommended-bump",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Get a recommended version bump based on conventional commits",
|
|
5
5
|
"homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump",
|
|
6
6
|
"author": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"concat-stream": "^1.4.10",
|
|
26
|
-
"conventional-commits-filter": "^1.
|
|
27
|
-
"conventional-commits-parser": "^2.
|
|
28
|
-
"git-
|
|
29
|
-
"git-
|
|
26
|
+
"conventional-commits-filter": "^1.1.1",
|
|
27
|
+
"conventional-commits-parser": "^2.1.1",
|
|
28
|
+
"git-raw-commits": "^1.3.0",
|
|
29
|
+
"git-semver-tags": "^1.3.0",
|
|
30
30
|
"meow": "^3.3.0",
|
|
31
31
|
"object-assign": "^4.0.1"
|
|
32
32
|
},
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var presetOpts = {
|
|
2
|
+
whatBump: function(commits) {
|
|
3
|
+
var level = 2;
|
|
4
|
+
var breakings = 0;
|
|
5
|
+
var features = 0;
|
|
6
|
+
|
|
7
|
+
commits.forEach(function(commit) {
|
|
8
|
+
if (!commit.type) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (commit.type.toLowerCase() === 'breaking') {
|
|
13
|
+
breakings += 1;
|
|
14
|
+
level = 0;
|
|
15
|
+
} else if (commit.type.toLowerCase() === 'new') {
|
|
16
|
+
features += 1;
|
|
17
|
+
if (level === 2) {
|
|
18
|
+
level = 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
level: level,
|
|
25
|
+
reason: 'There are ' + breakings + ' breaking changes and ' + features + ' features'
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
parserOpts: {
|
|
29
|
+
headerPattern: /^(\w*): (.*)$/,
|
|
30
|
+
headerCorrespondence: [
|
|
31
|
+
'type',
|
|
32
|
+
'subject'
|
|
33
|
+
],
|
|
34
|
+
revertPattern: /^[rR]evert:\s([\s\S]*?)\s*This reverts commit (\w*)\./,
|
|
35
|
+
revertCorrespondence: ['header', 'hash']
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = presetOpts;
|