git-raw-commits 2.0.10 → 3.0.0

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.
Files changed (4) hide show
  1. package/README.md +3 -3
  2. package/index.js +36 -26
  3. package/package.json +8 -10
  4. package/CHANGELOG.md +0 -175
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [![NPM version][npm-image]][npm-url] [![Build Status: Linux][travis-image]][travis-url] [![Build Status: Windows][appveyor-image]][appveyor-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
1
+ # [![NPM version][npm-image]][npm-url] [![Build Status: Linux][travis-image]][travis-url] [![Build Status: Windows][appveyor-image]][appveyor-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coverage-image]][coverage-url]
2
2
 
3
3
  > Get raw git commits out of your repository using git-log(1)
4
4
 
@@ -97,5 +97,5 @@ MIT © [Steve Mao](https://github.com/stevemao)
97
97
  [appveyor-url]: https://ci.appveyor.com/project/stevemao/git-raw-commits/branch/master
98
98
  [daviddm-image]: https://david-dm.org/conventional-changelog/git-raw-commits.svg?theme=shields.io
99
99
  [daviddm-url]: https://david-dm.org/conventional-changelog/git-raw-commits
100
- [coveralls-image]: https://coveralls.io/repos/conventional-changelog/git-raw-commits/badge.svg
101
- [coveralls-url]: https://coveralls.io/r/conventional-changelog/git-raw-commits
100
+ [coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
101
+ [coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
package/index.js CHANGED
@@ -3,9 +3,7 @@
3
3
  const dargs = require('dargs')
4
4
  const execFile = require('child_process').execFile
5
5
  const split = require('split2')
6
- const stream = require('stream')
7
- const template = require('lodash/template')
8
- const through = require('through2')
6
+ const { Readable, Transform } = require('stream')
9
7
 
10
8
  const DELIMITER = '------------------------ >8 ------------------------'
11
9
 
@@ -24,10 +22,13 @@ function normalizeGitOpts (gitOpts) {
24
22
  }
25
23
 
26
24
  function getGitArgs (gitOpts) {
27
- const gitFormat = template('--format=<%= format %>%n' + DELIMITER)(gitOpts)
25
+ const gitFormat = `--format=${gitOpts.format || ''}%n${DELIMITER}`
28
26
  const gitFromTo = [gitOpts.from, gitOpts.to].filter(Boolean).join('..')
29
27
 
30
28
  const gitArgs = ['log', gitFormat, gitFromTo]
29
+ .concat(dargs(gitOpts, {
30
+ excludes: ['debug', 'from', 'to', 'format', 'path']
31
+ }))
31
32
 
32
33
  // allow commits to focus on a single directory
33
34
  // this is useful for monorepos.
@@ -35,13 +36,11 @@ function getGitArgs (gitOpts) {
35
36
  gitArgs.push('--', gitOpts.path)
36
37
  }
37
38
 
38
- return gitArgs.concat(dargs(gitOpts, {
39
- excludes: ['debug', 'from', 'to', 'format', 'path']
40
- }))
39
+ return gitArgs
41
40
  }
42
41
 
43
42
  function gitRawCommits (rawGitOpts, rawExecOpts) {
44
- const readable = new stream.Readable()
43
+ const readable = new Readable()
45
44
  readable._read = function () {}
46
45
 
47
46
  const gitOpts = normalizeGitOpts(rawGitOpts)
@@ -61,28 +60,39 @@ function gitRawCommits (rawGitOpts, rawExecOpts) {
61
60
 
62
61
  child.stdout
63
62
  .pipe(split(DELIMITER + '\n'))
64
- .pipe(through(function (chunk, enc, cb) {
65
- readable.push(chunk)
66
- isError = false
67
-
68
- cb()
69
- }, function (cb) {
70
- setImmediate(function () {
71
- if (!isError) {
72
- readable.push(null)
73
- readable.emit('close')
63
+ .pipe(
64
+ new Transform({
65
+ transform (chunk, enc, cb) {
66
+ readable.push(chunk)
67
+ isError = false
68
+
69
+ cb()
70
+ },
71
+ flush (cb) {
72
+ setImmediate(function () {
73
+ if (!isError) {
74
+ readable.push(null)
75
+ readable.emit('close')
76
+ }
77
+
78
+ cb()
79
+ })
74
80
  }
75
-
76
- cb()
77
81
  })
78
- }))
82
+ )
79
83
 
80
84
  child.stderr
81
- .pipe(through.obj(function (chunk) {
82
- isError = true
83
- readable.emit('error', new Error(chunk))
84
- readable.emit('close')
85
- }))
85
+ .pipe(
86
+ new Transform({
87
+ objectMode: true,
88
+ highWaterMark: 16,
89
+ transform (chunk) {
90
+ isError = true
91
+ readable.emit('error', new Error(chunk))
92
+ readable.emit('close')
93
+ }
94
+ })
95
+ )
86
96
 
87
97
  return readable
88
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-raw-commits",
3
- "version": "2.0.10",
3
+ "version": "3.0.0",
4
4
  "description": "Get raw git commits out of your repository using git-log(1)",
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": ">=10"
20
+ "node": ">=14"
21
21
  },
22
22
  "files": [
23
23
  "index.js",
@@ -34,15 +34,13 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "dargs": "^7.0.0",
37
- "lodash": "^4.17.15",
38
- "meow": "^8.0.0",
39
- "split2": "^3.0.0",
40
- "through2": "^4.0.0"
41
- },
42
- "scripts": {
43
- "test-windows": "mocha --timeout 30000"
37
+ "meow": "^8.1.2",
38
+ "split2": "^3.2.2"
44
39
  },
45
40
  "bin": {
46
41
  "git-raw-commits": "cli.js"
42
+ },
43
+ "scripts": {
44
+ "test-windows": "mocha --timeout 30000"
47
45
  }
48
- }
46
+ }
package/CHANGELOG.md DELETED
@@ -1,175 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ### [2.0.10](https://www.github.com/conventional-changelog/conventional-changelog/compare/v2.0.9...v2.0.10) (2021-01-27)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * align lodash dependency across packages ([#737](https://www.github.com/conventional-changelog/conventional-changelog/issues/737)) ([d9feeb6](https://www.github.com/conventional-changelog/conventional-changelog/commit/d9feeb605de28c00ef55b5c8e229efd1289dd6e8))
12
- * revert normalize git show signature option to false ([c4d9042](https://www.github.com/conventional-changelog/conventional-changelog/commit/c4d9042ae83aa2c823dca181dd72e5a8b3163c1e))
13
-
14
- ### [2.0.9](https://www.github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.8...v2.0.9) (2020-12-29)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * normalize git show signature option to false ([#671](https://www.github.com/conventional-changelog/conventional-changelog/issues/671)) ([a0b348c](https://www.github.com/conventional-changelog/conventional-changelog/commit/a0b348c7a74ba49bb07053ed1d25c2053a7c3b1a)), closes [conventional-changelog/commitlint#2118](https://www.github.com/conventional-changelog/commitlint/issues/2118)
20
-
21
- ## [2.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.7...git-raw-commits@2.0.8) (2020-11-05)
22
-
23
-
24
- ### Bug Fixes
25
-
26
- * **deps:** update dependency through2 to v4 ([#657](https://github.com/conventional-changelog/conventional-changelog/issues/657)) ([7ae618c](https://github.com/conventional-changelog/conventional-changelog/commit/7ae618c81491841e5b1d796d3933aac0c54bc312))
27
-
28
-
29
-
30
-
31
-
32
- ## [2.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.3...git-raw-commits@2.0.7) (2020-05-08)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * **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))
38
-
39
-
40
-
41
-
42
-
43
- ## [2.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.2...git-raw-commits@2.0.3) (2019-11-14)
44
-
45
- **Note:** Version bump only for package git-raw-commits
46
-
47
-
48
-
49
-
50
-
51
- ## [2.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.1...git-raw-commits@2.0.2) (2019-04-10)
52
-
53
-
54
- ### Bug Fixes
55
-
56
- * **deps:** update dependency through2 to v3 ([#392](https://github.com/conventional-changelog/conventional-changelog/issues/392)) ([26fe91f](https://github.com/conventional-changelog/conventional-changelog/commit/26fe91f))
57
-
58
-
59
-
60
-
61
-
62
- ## [2.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.0...git-raw-commits@2.0.1) (2018-11-01)
63
-
64
-
65
- ### Bug Fixes
66
-
67
- * Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
68
-
69
-
70
-
71
-
72
-
73
- <a name="2.0.0"></a>
74
- # [2.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.6...git-raw-commits@2.0.0) (2018-05-29)
75
-
76
-
77
- ### Chores
78
-
79
- * **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
80
-
81
-
82
- ### BREAKING CHANGES
83
-
84
- * **package:** Set the package's minimum required Node version to be the oldest LTS
85
- currently supported by the Node Release working group. At this time,
86
- that is Node 6 (which is in its Maintenance LTS phase).
87
-
88
-
89
-
90
-
91
- <a name="1.3.6"></a>
92
- ## [1.3.6](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.5...git-raw-commits@1.3.6) (2018-03-27)
93
-
94
-
95
-
96
-
97
- **Note:** Version bump only for package git-raw-commits
98
-
99
- <a name="1.3.5"></a>
100
- ## [1.3.5](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.4...git-raw-commits@1.3.5) (2018-03-22)
101
-
102
-
103
-
104
-
105
- **Note:** Version bump only for package git-raw-commits
106
-
107
- <a name="1.3.4"></a>
108
- ## [1.3.4](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.3...git-raw-commits@1.3.4) (2018-02-24)
109
-
110
-
111
-
112
-
113
- **Note:** Version bump only for package git-raw-commits
114
-
115
- <a name="1.3.3"></a>
116
- ## [1.3.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.2...git-raw-commits@1.3.3) (2018-02-20)
117
-
118
-
119
-
120
-
121
- **Note:** Version bump only for package git-raw-commits
122
-
123
- <a name="1.3.2"></a>
124
- ## [1.3.2](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.3.1...git-raw-commits@1.3.2) (2018-02-13)
125
-
126
-
127
-
128
-
129
- **Note:** Version bump only for package git-raw-commits
130
-
131
- <a name="1.3.1"></a>
132
- ## [1.3.1](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.3.0...git-raw-commits@1.3.1) (2018-02-13)
133
-
134
-
135
-
136
-
137
- **Note:** Version bump only for package git-raw-commits
138
-
139
- <a name="1.3.0"></a>
140
- # [1.3.0](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.2.0...git-raw-commits@1.3.0) (2017-11-13)
141
-
142
-
143
- ### Features
144
-
145
- * **git-raw-commits:** add execOpts.cwd ([2631213](https://github.com/conventional-changelog/git-raw-commits/commit/2631213))
146
-
147
-
148
-
149
-
150
- <a name="1.2.0"></a>
151
- # [1.2.0](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.1.2...v1.2.0) (2017-03-10)
152
-
153
-
154
- ### Features
155
-
156
- * allow raw commits to be filtered by path ([#172](https://github.com/conventional-changelog/conventional-changelog/issues/172)) ([ec0a25d](https://github.com/conventional-changelog/conventional-changelog/commit/ec0a25d))
157
- * migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-changelog/commit/793e823))
158
-
159
- <a name="1.1.2"></a>
160
- ## [1.1.2](https://github.com/conventional-changelog/git-raw-commits/compare/v1.1.1...v1.1.2) (2016-06-27)
161
-
162
-
163
- ### Bug Fixes
164
-
165
- * **windows:** use execFile for executing git ([9ae06df](https://github.com/conventional-changelog/git-raw-commits/commit/9ae06df)), closes [#11](https://github.com/conventional-changelog/git-raw-commits/issues/11)
166
-
167
-
168
-
169
- <a name="1.1.1"></a>
170
- ## [1.1.1](https://github.com/conventional-changelog/git-raw-commits/compare/v1.1.0...v1.1.1) (2016-06-26)
171
-
172
-
173
- ### Bug Fixes
174
-
175
- * **windows:** escape command percent signs ([005b559](https://github.com/conventional-changelog/git-raw-commits/commit/005b559)), closes [#10](https://github.com/conventional-changelog/git-raw-commits/issues/10)