@commitlint/read
Advanced tools
@@ -1,5 +0,5 @@ | ||
| import gitRawCommits from "git-raw-commits"; | ||
| export declare function getHistoryCommits(options: gitRawCommits.GitOptions, opts?: { | ||
| import type { GitOptions } from "git-raw-commits"; | ||
| export declare function getHistoryCommits(options: GitOptions, opts?: { | ||
| cwd?: string; | ||
| }): Promise<string[]>; | ||
| //# sourceMappingURL=get-history-commits.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-history-commits.d.ts","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,aAAa,CAAC,UAAU,EACjC,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB"} | ||
| {"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 +0,25 @@ | ||
| import gitRawCommits from "git-raw-commits"; | ||
| import { streamToPromise } from "./stream-to-promise.js"; | ||
| import { getRawCommits } from "git-raw-commits"; | ||
| // Get commit messages from history | ||
| export async function getHistoryCommits(options, opts = {}) { | ||
| return streamToPromise(gitRawCommits(options, { cwd: opts.cwd })); | ||
| // Note: git-raw-commits v5 drops support for arbitrary git log arguments. | ||
| // We extract and handle 'skip' manually here to preserve backward compatibility. | ||
| // Other arbitrary arguments passed via gitLogArgs may be silently ignored by v5. | ||
| const { skip: skipRaw, ...gitOptions } = options; | ||
| let skipNum = 0; | ||
| if (skipRaw !== undefined) { | ||
| skipNum = Number(skipRaw); | ||
| if (!Number.isInteger(skipNum) || skipNum < 0) { | ||
| throw new TypeError(`Invalid skip value: ${skipRaw}`); | ||
| } | ||
| } | ||
| const data = []; | ||
| for await (const commit of getRawCommits({ ...gitOptions, cwd: opts.cwd })) { | ||
| if (skipNum > 0) { | ||
| skipNum--; | ||
| continue; | ||
| } | ||
| data.push(commit); | ||
| } | ||
| return data; | ||
| } | ||
| //# sourceMappingURL=get-history-commits.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-history-commits.js","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,mCAAmC;AACnC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,OAAiC,EACjC,OAAyB,EAAE;IAE3B,OAAO,eAAe,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC"} | ||
| {"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"} |
+5
-5
| { | ||
| "name": "@commitlint/read", | ||
| "type": "module", | ||
| "version": "20.4.3", | ||
| "version": "20.4.4", | ||
| "description": "Read commit messages from a specified range or last edit", | ||
@@ -41,3 +41,3 @@ "main": "lib/read.js", | ||
| "@commitlint/utils": "^20.0.0", | ||
| "@types/git-raw-commits": "^2.0.3", | ||
| "@types/git-raw-commits": "^5.0.0", | ||
| "@types/minimist": "^1.2.4" | ||
@@ -47,8 +47,8 @@ }, | ||
| "@commitlint/top-level": "^20.4.3", | ||
| "@commitlint/types": "^20.4.3", | ||
| "git-raw-commits": "^4.0.0", | ||
| "@commitlint/types": "^20.4.4", | ||
| "git-raw-commits": "^5.0.0", | ||
| "minimist": "^1.2.8", | ||
| "tinyexec": "^1.0.0" | ||
| }, | ||
| "gitHead": "a7469817974796a6e89f55911bb66b7bffa44099" | ||
| "gitHead": "02d7245e9b204ed07a68298e4d73c8d82a4b7f81" | ||
| } |
| import { Readable } from "node:stream"; | ||
| export declare function streamToPromise(stream: Readable): Promise<string[]>; | ||
| //# sourceMappingURL=stream-to-promise.d.ts.map |
| {"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"} |
| export function streamToPromise(stream) { | ||
| const data = []; | ||
| return new Promise((resolve, reject) => stream | ||
| .on("data", (chunk) => data.push(chunk.toString("utf-8"))) | ||
| .on("error", reject) | ||
| .on("end", () => resolve(data))); | ||
| } | ||
| //# sourceMappingURL=stream-to-promise.js.map |
| {"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"} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
124
7.83%13131
-0.17%19
-17.39%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated