@commitlint/read 18.4.0 → 18.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-edit-commit.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getEditCommit = void 0;
|
|
7
7
|
const top_level_1 = __importDefault(require("@commitlint/top-level"));
|
|
8
|
-
const
|
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
9
|
const get_edit_file_path_1 = require("./get-edit-file-path");
|
|
10
10
|
// Get recently edited commit message
|
|
11
11
|
async function getEditCommit(cwd, edit) {
|
|
@@ -14,7 +14,7 @@ async function getEditCommit(cwd, edit) {
|
|
|
14
14
|
throw new TypeError(`Could not find git root from ${cwd}`);
|
|
15
15
|
}
|
|
16
16
|
const editFilePath = await (0, get_edit_file_path_1.getEditFilePath)(top, edit);
|
|
17
|
-
const editFile = await
|
|
17
|
+
const editFile = await promises_1.default.readFile(editFilePath);
|
|
18
18
|
return [`${editFile.toString('utf-8')}\n`];
|
|
19
19
|
}
|
|
20
20
|
exports.getEditCommit = getEditCommit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-edit-commit.js","sourceRoot":"","sources":["../src/get-edit-commit.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"get-edit-commit.js","sourceRoot":"","sources":["../src/get-edit-commit.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAC7C,2DAA6B;AAC7B,6DAAqD;AAErD,qCAAqC;AAC9B,KAAK,UAAU,aAAa,CAClC,GAAY,EACZ,IAAuB;IAEvB,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,GAAG,CAAC,CAAC;IAEhC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAI,SAAS,CAAC,gCAAgC,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,IAAA,oCAAe,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAW,MAAM,kBAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEzD,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAdD,sCAcC"}
|
|
@@ -5,18 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getEditFilePath = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
9
|
// Get path to recently edited commit message file
|
|
10
10
|
async function getEditFilePath(top, edit) {
|
|
11
11
|
if (typeof edit === 'string') {
|
|
12
12
|
return path_1.default.resolve(top, edit);
|
|
13
13
|
}
|
|
14
14
|
const dotgitPath = path_1.default.join(top, '.git');
|
|
15
|
-
const dotgitStats = await
|
|
15
|
+
const dotgitStats = await promises_1.default.lstat(dotgitPath);
|
|
16
16
|
if (dotgitStats.isDirectory()) {
|
|
17
17
|
return path_1.default.join(top, '.git/COMMIT_EDITMSG');
|
|
18
18
|
}
|
|
19
|
-
const gitFile = await
|
|
19
|
+
const gitFile = await promises_1.default.readFile(dotgitPath, {
|
|
20
20
|
encoding: 'utf-8',
|
|
21
21
|
});
|
|
22
22
|
const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-edit-file-path.js","sourceRoot":"","sources":["../src/get-edit-file-path.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"get-edit-file-path.js","sourceRoot":"","sources":["../src/get-edit-file-path.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAA6B;AAE7B,kDAAkD;AAC3C,KAAK,UAAU,eAAe,CACpC,GAAW,EACX,IAAuB;IAEvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAU,MAAM,kBAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEtD,IAAI,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC;QAC/B,OAAO,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,OAAO,GAAW,MAAM,kBAAE,CAAC,QAAQ,CAAC,UAAU,EAAE;QACrD,QAAQ,EAAE,OAAO;KACjB,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1E,OAAO,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAC7D,CAAC;AApBD,0CAoBC"}
|
package/lib/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAEhC,+DAAwD;AACxD,uDAAgD;AAUhD,sBAAsB;AACP,KAAK,UAAU,iBAAiB,CAC9C,QAAiC;IAEjC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,QAAQ,CAAC;IAEnD,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAEhC,+DAAwD;AACxD,uDAAgD;AAUhD,sBAAsB;AACP,KAAK,UAAU,iBAAiB,CAC9C,QAAiC;IAEjC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,QAAQ,CAAC;IAEnD,IAAI,IAAI,EAAE,CAAC;QACV,OAAO,IAAA,+BAAa,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,UAAU,GAAe,EAAC,IAAI,EAAE,EAAE,EAAC,CAAC;IACxC,IAAI,UAAU,EAAE,CAAC;QAChB,UAAU,mCACN,IAAA,kBAAQ,EAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAClC,IAAI;YACJ,EAAE,GACF,CAAC;IACH,CAAC;IAED,OAAO,IAAA,uCAAiB,EAAC,UAAU,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;AAC7C,CAAC;AAnBD,oCAmBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/read",
|
|
3
|
-
"version": "18.4.
|
|
3
|
+
"version": "18.4.4",
|
|
4
4
|
"description": "Read commit messages from a specified range or last edit",
|
|
5
5
|
"main": "lib/read.js",
|
|
6
6
|
"types": "lib/read.d.ts",
|
|
@@ -36,18 +36,16 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@commitlint/test": "^18.0.0",
|
|
39
|
-
"@commitlint/utils": "^18.4.
|
|
40
|
-
"@types/fs-extra": "^11.0.3",
|
|
39
|
+
"@commitlint/utils": "^18.4.4",
|
|
41
40
|
"@types/git-raw-commits": "^2.0.3",
|
|
42
41
|
"@types/minimist": "^1.2.4",
|
|
43
42
|
"execa": "^5.0.0"
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
|
-
"@commitlint/top-level": "^18.4.
|
|
47
|
-
"@commitlint/types": "^18.4.
|
|
48
|
-
"fs-extra": "^11.0.0",
|
|
45
|
+
"@commitlint/top-level": "^18.4.4",
|
|
46
|
+
"@commitlint/types": "^18.4.4",
|
|
49
47
|
"git-raw-commits": "^2.0.11",
|
|
50
48
|
"minimist": "^1.2.6"
|
|
51
49
|
},
|
|
52
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ad2637f3cf23c5579e600950594e4d8d47d79864"
|
|
53
51
|
}
|