conventional-recommended-bump 6.0.4 → 6.0.11

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 CHANGED
@@ -3,6 +3,41 @@
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.11](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-recommended-bump@6.0.10...conventional-recommended-bump@6.0.11) (2020-11-05)
7
+
8
+ **Note:** Version bump only for package conventional-recommended-bump
9
+
10
+
11
+
12
+
13
+
14
+ ## [6.0.10](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-recommended-bump@6.0.9...conventional-recommended-bump@6.0.10) (2020-08-12)
15
+
16
+ **Note:** Version bump only for package conventional-recommended-bump
17
+
18
+
19
+
20
+
21
+
22
+ ## [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)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **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))
28
+
29
+
30
+
31
+
32
+
33
+ ## [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)
34
+
35
+ **Note:** Version bump only for package conventional-recommended-bump
36
+
37
+
38
+
39
+
40
+
6
41
  ## [6.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-recommended-bump@6.0.3...conventional-recommended-bump@6.0.4) (2019-11-07)
7
42
 
8
43
 
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(`meow`)
6
- const conventionalRecommendedBump = require(`./`)
7
- const path = require(`path`)
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
- 'preset': {
32
- alias: `p`
31
+ preset: {
32
+ alias: 'p'
33
33
  },
34
- 'config': {
35
- alias: `g`
34
+ config: {
35
+ alias: 'g'
36
36
  },
37
37
  'header-pattern': {
38
- alias: `h`
38
+ alias: 'h'
39
39
  },
40
40
  'header-correspondence': {
41
- alias: `c`
41
+ alias: 'c'
42
42
  },
43
43
  'reference-actions': {
44
- alias: `r`
44
+ alias: 'r'
45
45
  },
46
46
  'issue-prefixes': {
47
- alias: `i`
47
+ alias: 'i'
48
48
  },
49
49
  'note-keywords': {
50
- alias: `n`
50
+ alias: 'n'
51
51
  },
52
52
  'field-pattern': {
53
- alias: `f`
53
+ alias: 'f'
54
54
  },
55
- 'verbose': {
56
- alias: `v`
55
+ verbose: {
56
+ alias: 'v'
57
57
  },
58
58
  'lerna-package': {
59
- alias: `l`
59
+ alias: 'l'
60
60
  },
61
61
  'tag-prefix': {
62
- alias: `t`
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(`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`)
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 = [`major`, `minor`, `patch`]
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 !== `object`) {
16
- throw new Error(`The 'options' argument must be an object.`)
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 === `function` ? parserOptsArgument : cbArgument
21
+ const cb = typeof parserOptsArgument === 'function' ? parserOptsArgument : cbArgument
22
22
 
23
- if (typeof cb !== `function`) {
24
- throw new Error(`You must provide a callback function.`)
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 !== `function`) {
48
- throw Error(`whatBump must be a function`)
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 === `function` ? parserOpts.warn : noop
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: `%B%n-hash-%n%H`,
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(`No commits since last release`)
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.4",
3
+ "version": "6.0.11",
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": ">=6.9.0"
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.0",
36
- "conventional-commits-filter": "^2.0.2",
37
- "conventional-commits-parser": "^3.0.7",
35
+ "conventional-changelog-preset-loader": "^2.3.4",
36
+ "conventional-commits-filter": "^2.0.7",
37
+ "conventional-commits-parser": "^3.2.0",
38
38
  "git-raw-commits": "2.0.0",
39
- "git-semver-tags": "^3.0.0",
40
- "meow": "^4.0.0",
39
+ "git-semver-tags": "^4.1.1",
40
+ "meow": "^8.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": "741e90744cdb58e82e71feb36018047d7baca768"
47
+ "gitHead": "cc567b98facf71315f4b1620d81ce01d155efaca"
48
48
  }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const Q = require(`q`)
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 === `function`) {
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 === `object`) {
16
+ if (typeof presetPackage === 'object') {
17
17
  return Q(presetPackage)
18
18
  }
19
19
 
20
- throw new Error(`preset package must be a promise, function, or object`)
20
+ throw new Error('preset package must be a promise, function, or object')
21
21
  })
22
22
  }