@commitlint/read 19.0.3 → 19.2.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.
- package/lib/read.d.ts +1 -0
- package/lib/read.d.ts.map +1 -1
- package/lib/read.js +15 -3
- package/lib/read.js.map +1 -1
- package/package.json +4 -4
package/lib/read.d.ts
CHANGED
package/lib/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAQA,UAAU,uBAAuB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAA8B,iBAAiB,CAC9C,QAAQ,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB"}
|
package/lib/read.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import minimist from 'minimist';
|
|
2
2
|
import { getHistoryCommits } from './get-history-commits.js';
|
|
3
3
|
import { getEditCommit } from './get-edit-commit.js';
|
|
4
|
+
import { execa } from 'execa';
|
|
4
5
|
// Get commit messages
|
|
5
6
|
export default async function getCommitMessages(settings) {
|
|
6
|
-
const { cwd, from, to, edit, gitLogArgs } = settings;
|
|
7
|
+
const { cwd, from, to, last, edit, gitLogArgs } = settings;
|
|
7
8
|
if (edit) {
|
|
8
9
|
return getEditCommit(cwd, edit);
|
|
9
10
|
}
|
|
11
|
+
if (last) {
|
|
12
|
+
const executeGitCommand = await execa('git', [
|
|
13
|
+
'log',
|
|
14
|
+
'-1',
|
|
15
|
+
'--pretty=format:"%B"',
|
|
16
|
+
]);
|
|
17
|
+
return [executeGitCommand.stdout];
|
|
18
|
+
}
|
|
10
19
|
let gitOptions = { from, to };
|
|
11
20
|
if (gitLogArgs) {
|
|
12
|
-
gitOptions =
|
|
13
|
-
|
|
21
|
+
gitOptions = {
|
|
22
|
+
...minimist(gitLogArgs.split(' ')),
|
|
23
|
+
from,
|
|
24
|
+
to,
|
|
25
|
+
};
|
|
14
26
|
}
|
|
15
27
|
return getHistoryCommits(gitOptions, { cwd });
|
|
16
28
|
}
|
package/lib/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAW5B,sBAAsB;AACtB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,iBAAiB,CAC9C,QAAiC;IAEjC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,QAAQ,CAAC;IAEzD,IAAI,IAAI,EAAE,CAAC;QACV,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACV,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE;YAC5C,KAAK;YACL,IAAI;YACJ,sBAAsB;SACtB,CAAC,CAAC;QACH,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,UAAU,GAAe,EAAC,IAAI,EAAE,EAAE,EAAC,CAAC;IACxC,IAAI,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG;YACZ,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI;YACJ,EAAE;SACF,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,CAAC,UAAU,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/read",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "19.0
|
|
4
|
+
"version": "19.2.0",
|
|
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",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@commitlint/test": "^19.0.0",
|
|
40
40
|
"@commitlint/utils": "^19.0.0",
|
|
41
41
|
"@types/git-raw-commits": "^2.0.3",
|
|
42
|
-
"@types/minimist": "^1.2.4"
|
|
43
|
-
"execa": "^8.0.1"
|
|
42
|
+
"@types/minimist": "^1.2.4"
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
45
|
"@commitlint/top-level": "^19.0.0",
|
|
47
46
|
"@commitlint/types": "^19.0.3",
|
|
47
|
+
"execa": "^8.0.1",
|
|
48
48
|
"git-raw-commits": "^4.0.0",
|
|
49
49
|
"minimist": "^1.2.8"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a64b417b58b3b1e89f07ff529a29a4af223e9369"
|
|
52
52
|
}
|