git-raw-commits 5.0.0 → 5.0.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/README.md +1 -1
- package/package.json +4 -3
- package/src/index.js +14 -14
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
[node-url]: https://nodejs.org
|
|
19
19
|
|
|
20
20
|
[deps]: https://img.shields.io/librariesio/release/npm/git-raw-commits
|
|
21
|
-
[deps-url]: https://libraries.io/npm/git-raw-commits
|
|
21
|
+
[deps-url]: https://libraries.io/npm/git-raw-commits
|
|
22
22
|
|
|
23
23
|
[size]: https://packagephobia.com/badge?p=git-raw-commits
|
|
24
24
|
[size-url]: https://packagephobia.com/result?p=git-raw-commits
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-raw-commits",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.1",
|
|
5
5
|
"description": "Get raw git commits out of your repository using git-log(1).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Steve Mao",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"commits",
|
|
26
26
|
"git",
|
|
27
27
|
"log",
|
|
28
|
-
"git-log"
|
|
28
|
+
"git-log",
|
|
29
|
+
"deprecated"
|
|
29
30
|
],
|
|
30
31
|
"engines": {
|
|
31
32
|
"node": ">=18"
|
|
@@ -39,6 +40,6 @@
|
|
|
39
40
|
],
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"meow": "^13.0.0",
|
|
42
|
-
"@conventional-changelog/git-client": "^
|
|
43
|
+
"@conventional-changelog/git-client": "^2.6.0"
|
|
43
44
|
}
|
|
44
45
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'stream'
|
|
2
2
|
import { GitClient } from '@conventional-changelog/git-client'
|
|
3
3
|
|
|
4
|
-
function getFinalOptions
|
|
4
|
+
function getFinalOptions(options = {}) {
|
|
5
5
|
const finalOptions = {
|
|
6
6
|
cwd: process.cwd(),
|
|
7
7
|
...options
|
|
@@ -9,7 +9,7 @@ function getFinalOptions (options = {}) {
|
|
|
9
9
|
|
|
10
10
|
if (options.debug) {
|
|
11
11
|
finalOptions.debug = (args) => {
|
|
12
|
-
options.debug(
|
|
12
|
+
options.debug(`Your git-log command is:\ngit ${args.join(' ')}`)
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -19,16 +19,16 @@ function getFinalOptions (options = {}) {
|
|
|
19
19
|
/**
|
|
20
20
|
* Get raw commits from git-log.
|
|
21
21
|
* @param {*} options
|
|
22
|
-
* @param {string} [options.cwd
|
|
23
|
-
* @param {false | ((log: string) => void)} [options.debug
|
|
22
|
+
* @param {string} [options.cwd] - Current working directory to run git.
|
|
23
|
+
* @param {false | ((log: string) => void)} [options.debug] - A function to get debug information.
|
|
24
24
|
* @param {string | RegExp} [options.ignore] - Ignore commits that match provided string or RegExp.
|
|
25
25
|
* @param {string | string[]} [options.path] - Only commits that are modifying this path.
|
|
26
|
-
* @param {string} [options.from
|
|
27
|
-
* @param {string} [options.to
|
|
28
|
-
* @param {string} [options.format
|
|
26
|
+
* @param {string} [options.from] - Starting commit reference or hash.
|
|
27
|
+
* @param {string} [options.to] - Ending commit reference or hash.
|
|
28
|
+
* @param {string} [options.format] - Format of the commit.
|
|
29
29
|
* @yields {string} - Raw commit.
|
|
30
30
|
*/
|
|
31
|
-
export async function
|
|
31
|
+
export async function* getRawCommits(options) {
|
|
32
32
|
const { cwd, debug, ...finalOptions } = getFinalOptions(options)
|
|
33
33
|
const client = new GitClient(cwd, debug)
|
|
34
34
|
let commit
|
|
@@ -45,15 +45,15 @@ export async function * getRawCommits (options) {
|
|
|
45
45
|
/**
|
|
46
46
|
* Get raw commits stream from git-log.
|
|
47
47
|
* @param {*} options
|
|
48
|
-
* @param {string} [options.cwd
|
|
49
|
-
* @param {false | ((log: string) => void)} [options.debug
|
|
48
|
+
* @param {string} [options.cwd] - Current working directory to run git.
|
|
49
|
+
* @param {false | ((log: string) => void)} [options.debug] - A function to get debug information.
|
|
50
50
|
* @param {string | RegExp} [options.ignore] - Ignore commits that match provided string or RegExp.
|
|
51
51
|
* @param {string | string[]} [options.path] - Only commits that are modifying this path.
|
|
52
|
-
* @param {string} [options.from
|
|
53
|
-
* @param {string} [options.to
|
|
54
|
-
* @param {string} [options.format
|
|
52
|
+
* @param {string} [options.from] - Starting commit reference or hash.
|
|
53
|
+
* @param {string} [options.to] - Ending commit reference or hash.
|
|
54
|
+
* @param {string} [options.format] - Format of the commit.
|
|
55
55
|
* @returns {Readable} - Raw commits stream.
|
|
56
56
|
*/
|
|
57
|
-
export function getRawCommitsStream
|
|
57
|
+
export function getRawCommitsStream(options) {
|
|
58
58
|
return Readable.from(getRawCommits(options))
|
|
59
59
|
}
|