conventional-recommended-bump 6.0.5 → 6.0.9
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 +11 -0
- package/README.md +7 -0
- package/cli.js +17 -17
- package/index.js +19 -19
- package/package.json +8 -8
- package/preset-resolver.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.0.9](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-recommended-bump@6.0.5...conventional-recommended-bump@6.0.9) (2020-05-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update yargs-parser to move off a flagged-vulnerable version. ([#635](https://github.com/conventional-changelog/conventional-changelog/issues/635)) ([aafc0f0](https://github.com/conventional-changelog/conventional-changelog/commit/aafc0f00412c3e4b23b8418300e5a570a48fe24d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.0.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-recommended-bump@6.0.4...conventional-recommended-bump@6.0.5) (2019-11-14)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package conventional-recommended-bump
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Got the idea from https://github.com/conventional-changelog/conventional-changel
|
|
|
19
19
|
- [whatBump](#whatbump)
|
|
20
20
|
- [tagPrefix](#tagprefix)
|
|
21
21
|
- [lernaPackage](#lernapackage)
|
|
22
|
+
- [path](#path)
|
|
22
23
|
- [parserOpts](#parseropts)
|
|
23
24
|
- [callback](#callback)
|
|
24
25
|
- [License](#license)
|
|
@@ -119,6 +120,12 @@ Specify the name of a package in a [Lerna](https://lernajs.io/)-managed reposito
|
|
|
119
120
|
|
|
120
121
|
For instance if your project contained a package named `conventional-changelog`, you could have only commits that have happened since the last release of `conventional-changelog` was tagged by specifying `--lernaPackage=conventional-changelog` using the CLI, or `conventional-changelog` as the value of the `lernaPackage` option.
|
|
121
122
|
|
|
123
|
+
##### path
|
|
124
|
+
|
|
125
|
+
**Type:** `string`
|
|
126
|
+
|
|
127
|
+
Specify the path to only calculate with git commits related to the path. If you want to calculate recommended bumps of packages in a [Lerna](https://lernajs.io/)-managed repository, `path` should be use along with `lernaPackage` for each of the package.
|
|
128
|
+
|
|
122
129
|
#### parserOpts
|
|
123
130
|
|
|
124
131
|
**Type:** `object`
|
package/cli.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
-
const meow = require(
|
|
6
|
-
const conventionalRecommendedBump = require(
|
|
7
|
-
const path = require(
|
|
5
|
+
const meow = require('meow')
|
|
6
|
+
const conventionalRecommendedBump = require('./')
|
|
7
|
+
const path = require('path')
|
|
8
8
|
|
|
9
9
|
const cli = meow(`
|
|
10
10
|
Usage
|
|
@@ -28,38 +28,38 @@ const cli = meow(`
|
|
|
28
28
|
--commit-path Recommend a bump scoped to a specific directory
|
|
29
29
|
`, {
|
|
30
30
|
flags: {
|
|
31
|
-
|
|
32
|
-
alias:
|
|
31
|
+
preset: {
|
|
32
|
+
alias: 'p'
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
alias:
|
|
34
|
+
config: {
|
|
35
|
+
alias: 'g'
|
|
36
36
|
},
|
|
37
37
|
'header-pattern': {
|
|
38
|
-
alias:
|
|
38
|
+
alias: 'h'
|
|
39
39
|
},
|
|
40
40
|
'header-correspondence': {
|
|
41
|
-
alias:
|
|
41
|
+
alias: 'c'
|
|
42
42
|
},
|
|
43
43
|
'reference-actions': {
|
|
44
|
-
alias:
|
|
44
|
+
alias: 'r'
|
|
45
45
|
},
|
|
46
46
|
'issue-prefixes': {
|
|
47
|
-
alias:
|
|
47
|
+
alias: 'i'
|
|
48
48
|
},
|
|
49
49
|
'note-keywords': {
|
|
50
|
-
alias:
|
|
50
|
+
alias: 'n'
|
|
51
51
|
},
|
|
52
52
|
'field-pattern': {
|
|
53
|
-
alias:
|
|
53
|
+
alias: 'f'
|
|
54
54
|
},
|
|
55
|
-
|
|
56
|
-
alias:
|
|
55
|
+
verbose: {
|
|
56
|
+
alias: 'v'
|
|
57
57
|
},
|
|
58
58
|
'lerna-package': {
|
|
59
|
-
alias:
|
|
59
|
+
alias: 'l'
|
|
60
60
|
},
|
|
61
61
|
'tag-prefix': {
|
|
62
|
-
alias:
|
|
62
|
+
alias: 't'
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
})
|
package/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
const concat = require(
|
|
3
|
-
const conventionalCommitsFilter = require(
|
|
4
|
-
const conventionalCommitsParser = require(
|
|
5
|
-
const conventionalChangelogPresetLoader = require(
|
|
6
|
-
const gitSemverTags = require(
|
|
7
|
-
const gitRawCommits = require(
|
|
8
|
-
const presetResolver = require(
|
|
2
|
+
const concat = require('concat-stream')
|
|
3
|
+
const conventionalCommitsFilter = require('conventional-commits-filter')
|
|
4
|
+
const conventionalCommitsParser = require('conventional-commits-parser')
|
|
5
|
+
const conventionalChangelogPresetLoader = require('conventional-changelog-preset-loader')
|
|
6
|
+
const gitSemverTags = require('git-semver-tags')
|
|
7
|
+
const gitRawCommits = require('git-raw-commits')
|
|
8
|
+
const presetResolver = require('./preset-resolver')
|
|
9
9
|
|
|
10
|
-
const VERSIONS = [
|
|
10
|
+
const VERSIONS = ['major', 'minor', 'patch']
|
|
11
11
|
|
|
12
12
|
module.exports = conventionalRecommendedBump
|
|
13
13
|
|
|
14
14
|
function conventionalRecommendedBump (optionsArgument, parserOptsArgument, cbArgument) {
|
|
15
|
-
if (typeof optionsArgument !==
|
|
16
|
-
throw new Error(
|
|
15
|
+
if (typeof optionsArgument !== 'object') {
|
|
16
|
+
throw new Error('The \'options\' argument must be an object.')
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const options = Object.assign({ ignoreReverted: true }, optionsArgument)
|
|
20
20
|
|
|
21
|
-
const cb = typeof parserOptsArgument ===
|
|
21
|
+
const cb = typeof parserOptsArgument === 'function' ? parserOptsArgument : cbArgument
|
|
22
22
|
|
|
23
|
-
if (typeof cb !==
|
|
24
|
-
throw new Error(
|
|
23
|
+
if (typeof cb !== 'function') {
|
|
24
|
+
throw new Error('You must provide a callback function.')
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
let presetPackage = options.config || {}
|
|
@@ -44,8 +44,8 @@ function conventionalRecommendedBump (optionsArgument, parserOptsArgument, cbArg
|
|
|
44
44
|
? config.recommendedBumpOpts.whatBump
|
|
45
45
|
: noop)
|
|
46
46
|
|
|
47
|
-
if (typeof whatBump !==
|
|
48
|
-
throw Error(
|
|
47
|
+
if (typeof whatBump !== 'function') {
|
|
48
|
+
throw Error('whatBump must be a function')
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// TODO: For now we defer to `config.recommendedBumpOpts.parserOpts` if it exists, as our initial refactor
|
|
@@ -58,7 +58,7 @@ function conventionalRecommendedBump (optionsArgument, parserOptsArgument, cbArg
|
|
|
58
58
|
: config.parserOpts,
|
|
59
59
|
parserOptsArgument)
|
|
60
60
|
|
|
61
|
-
const warn = typeof parserOpts.warn ===
|
|
61
|
+
const warn = typeof parserOpts.warn === 'function' ? parserOpts.warn : noop
|
|
62
62
|
|
|
63
63
|
gitSemverTags({
|
|
64
64
|
lernaTags: !!options.lernaPackage,
|
|
@@ -70,8 +70,8 @@ function conventionalRecommendedBump (optionsArgument, parserOptsArgument, cbArg
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
gitRawCommits({
|
|
73
|
-
format:
|
|
74
|
-
from: tags[0] ||
|
|
73
|
+
format: '%B%n-hash-%n%H',
|
|
74
|
+
from: tags[0] || '',
|
|
75
75
|
path: options.path
|
|
76
76
|
})
|
|
77
77
|
.pipe(conventionalCommitsParser(parserOpts))
|
|
@@ -79,7 +79,7 @@ function conventionalRecommendedBump (optionsArgument, parserOptsArgument, cbArg
|
|
|
79
79
|
const commits = options.ignoreReverted ? conventionalCommitsFilter(data) : data
|
|
80
80
|
|
|
81
81
|
if (!commits || !commits.length) {
|
|
82
|
-
warn(
|
|
82
|
+
warn('No commits since last release')
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
let result = whatBump(commits, options)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conventional-recommended-bump",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.9",
|
|
4
4
|
"description": "Get a recommended version bump based on conventional commits",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=10"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"index.js",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"concat-stream": "^2.0.0",
|
|
35
|
-
"conventional-changelog-preset-loader": "^2.3.
|
|
36
|
-
"conventional-commits-filter": "^2.0.
|
|
37
|
-
"conventional-commits-parser": "^3.0
|
|
35
|
+
"conventional-changelog-preset-loader": "^2.3.4",
|
|
36
|
+
"conventional-commits-filter": "^2.0.6",
|
|
37
|
+
"conventional-commits-parser": "^3.1.0",
|
|
38
38
|
"git-raw-commits": "2.0.0",
|
|
39
|
-
"git-semver-tags": "^
|
|
40
|
-
"meow": "^
|
|
39
|
+
"git-semver-tags": "^4.0.0",
|
|
40
|
+
"meow": "^7.0.0",
|
|
41
41
|
"q": "^1.5.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"test-windows": "mocha --timeout 30000 ./test/preset-resolver.spec.js"
|
|
45
45
|
},
|
|
46
46
|
"bin": "cli.js",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "83643c5a0d2c4d7c9ba14cbf990ffbc577a51e8c"
|
|
48
48
|
}
|
package/preset-resolver.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const Q = require(
|
|
3
|
+
const Q = require('q')
|
|
4
4
|
|
|
5
5
|
module.exports = presetResolver
|
|
6
6
|
|
|
@@ -8,15 +8,15 @@ function presetResolver (presetPackage) {
|
|
|
8
8
|
// start the chain as a Q.Promise
|
|
9
9
|
return Q.resolve().then(() => {
|
|
10
10
|
// handle traditional node-style callbacks
|
|
11
|
-
if (typeof presetPackage ===
|
|
11
|
+
if (typeof presetPackage === 'function') {
|
|
12
12
|
return Q.nfcall(presetPackage)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// handle object literal or Promise instance
|
|
16
|
-
if (typeof presetPackage ===
|
|
16
|
+
if (typeof presetPackage === 'object') {
|
|
17
17
|
return Q(presetPackage)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
throw new Error(
|
|
20
|
+
throw new Error('preset package must be a promise, function, or object')
|
|
21
21
|
})
|
|
22
22
|
}
|