@commitlint/read 20.4.3 → 20.4.4
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/lib/get-history-commits.d.ts +2 -2
- package/lib/get-history-commits.d.ts.map +1 -1
- package/lib/get-history-commits.js +21 -3
- package/lib/get-history-commits.js.map +1 -1
- package/package.json +5 -5
- package/lib/stream-to-promise.d.ts +0 -3
- package/lib/stream-to-promise.d.ts.map +0 -1
- package/lib/stream-to-promise.js +0 -8
- package/lib/stream-to-promise.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function getHistoryCommits(options:
|
|
1
|
+
import type { GitOptions } from "git-raw-commits";
|
|
2
|
+
export declare function getHistoryCommits(options: GitOptions, opts?: {
|
|
3
3
|
cwd?: string;
|
|
4
4
|
}): Promise<string[]>;
|
|
5
5
|
//# sourceMappingURL=get-history-commits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-history-commits.d.ts","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"get-history-commits.d.ts","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,UAAU,EACnB,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAyBnB"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { streamToPromise } from "./stream-to-promise.js";
|
|
1
|
+
import { getRawCommits } from "git-raw-commits";
|
|
3
2
|
// Get commit messages from history
|
|
4
3
|
export async function getHistoryCommits(options, opts = {}) {
|
|
5
|
-
|
|
4
|
+
// Note: git-raw-commits v5 drops support for arbitrary git log arguments.
|
|
5
|
+
// We extract and handle 'skip' manually here to preserve backward compatibility.
|
|
6
|
+
// Other arbitrary arguments passed via gitLogArgs may be silently ignored by v5.
|
|
7
|
+
const { skip: skipRaw, ...gitOptions } = options;
|
|
8
|
+
let skipNum = 0;
|
|
9
|
+
if (skipRaw !== undefined) {
|
|
10
|
+
skipNum = Number(skipRaw);
|
|
11
|
+
if (!Number.isInteger(skipNum) || skipNum < 0) {
|
|
12
|
+
throw new TypeError(`Invalid skip value: ${skipRaw}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const data = [];
|
|
16
|
+
for await (const commit of getRawCommits({ ...gitOptions, cwd: opts.cwd })) {
|
|
17
|
+
if (skipNum > 0) {
|
|
18
|
+
skipNum--;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
data.push(commit);
|
|
22
|
+
}
|
|
23
|
+
return data;
|
|
6
24
|
}
|
|
7
25
|
//# sourceMappingURL=get-history-commits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-history-commits.js","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-history-commits.js","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,mCAAmC;AACnC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,OAAmB,EACnB,OAAyB,EAAE;IAE3B,0EAA0E;IAC1E,iFAAiF;IACjF,iFAAiF;IACjF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAExC,CAAC;IAEF,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,SAAS,CAAC,uBAAuB,OAAO,EAAE,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;IAED,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,aAAa,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;QAC5E,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,SAAS;QACV,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/read",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "20.4.
|
|
4
|
+
"version": "20.4.4",
|
|
5
5
|
"description": "Read commit messages from a specified range or last edit",
|
|
6
6
|
"main": "lib/read.js",
|
|
7
7
|
"types": "lib/read.d.ts",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@commitlint/test": "^20.4.3",
|
|
40
40
|
"@commitlint/utils": "^20.0.0",
|
|
41
|
-
"@types/git-raw-commits": "^
|
|
41
|
+
"@types/git-raw-commits": "^5.0.0",
|
|
42
42
|
"@types/minimist": "^1.2.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@commitlint/top-level": "^20.4.3",
|
|
46
|
-
"@commitlint/types": "^20.4.
|
|
47
|
-
"git-raw-commits": "^
|
|
46
|
+
"@commitlint/types": "^20.4.4",
|
|
47
|
+
"git-raw-commits": "^5.0.0",
|
|
48
48
|
"minimist": "^1.2.8",
|
|
49
49
|
"tinyexec": "^1.0.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "02d7245e9b204ed07a68298e4d73c8d82a4b7f81"
|
|
52
52
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream-to-promise.d.ts","sourceRoot":"","sources":["../src/stream-to-promise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnE"}
|
package/lib/stream-to-promise.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function streamToPromise(stream) {
|
|
2
|
-
const data = [];
|
|
3
|
-
return new Promise((resolve, reject) => stream
|
|
4
|
-
.on("data", (chunk) => data.push(chunk.toString("utf-8")))
|
|
5
|
-
.on("error", reject)
|
|
6
|
-
.on("end", () => resolve(data)));
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=stream-to-promise.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream-to-promise.js","sourceRoot":"","sources":["../src/stream-to-promise.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,MAAgB;IAC/C,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CACtC,MAAM;SACJ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;SACzD,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;SACnB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAChC,CAAC;AACH,CAAC"}
|