@commitlint/read 13.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/CHANGELOG.md +257 -0
- package/README.md +25 -0
- package/lib/get-edit-commit.d.ts +2 -0
- package/lib/get-edit-commit.d.ts.map +1 -0
- package/lib/get-edit-commit.js +21 -0
- package/lib/get-edit-commit.js.map +1 -0
- package/lib/get-edit-file-path.d.ts +2 -0
- package/lib/get-edit-file-path.d.ts.map +1 -0
- package/lib/get-edit-file-path.js +26 -0
- package/lib/get-edit-file-path.js.map +1 -0
- package/lib/get-history-commits.d.ts +7 -0
- package/lib/get-history-commits.d.ts.map +1 -0
- package/lib/get-history-commits.js +14 -0
- package/lib/get-history-commits.js.map +1 -0
- package/lib/read.d.ts +9 -0
- package/lib/read.d.ts.map +1 -0
- package/lib/read.js +14 -0
- package/lib/read.js.map +1 -0
- package/lib/stream-to-promise.d.ts +4 -0
- package/lib/stream-to-promise.d.ts.map +1 -0
- package/lib/stream-to-promise.js +12 -0
- package/lib/stream-to-promise.js.map +1 -0
- package/license.md +21 -0
- package/package.json +50 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [13.2.0](https://github.com/conventional-changelog/commitlint/compare/v13.1.0...v13.2.0) (2021-09-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @commitlint/read
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [13.1.0](https://github.com/conventional-changelog/commitlint/compare/v13.0.0...v13.1.0) (2021-07-24)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @commitlint/read
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [13.0.0](https://github.com/conventional-changelog/commitlint/compare/v12.1.4...v13.0.0) (2021-05-24)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
* chore!: remove node 10 support (#2596) ([4db4ba1](https://github.com/conventional-changelog/commitlint/commit/4db4ba1b0b312410a0f62100a93a80c246a6c410)), closes [#2596](https://github.com/conventional-changelog/commitlint/issues/2596)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### BREAKING CHANGES
|
|
29
|
+
|
|
30
|
+
* minimum node version is 12
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [12.1.3](https://github.com/conventional-changelog/commitlint/compare/v12.1.2...v12.1.3) (2021-05-12)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* update dependency fs-extra to v10 ([#2575](https://github.com/conventional-changelog/commitlint/issues/2575)) ([d47d2b5](https://github.com/conventional-changelog/commitlint/commit/d47d2b595b980adadd4fb8ff198c1914caeff18f))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [12.1.2](https://github.com/conventional-changelog/commitlint/compare/v12.1.1...v12.1.2) (2021-04-29)
|
|
48
|
+
|
|
49
|
+
**Note:** Version bump only for package @commitlint/read
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [12.1.1](https://github.com/conventional-changelog/commitlint/compare/v12.1.0...v12.1.1) (2021-04-02)
|
|
56
|
+
|
|
57
|
+
**Note:** Version bump only for package @commitlint/read
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# [12.1.0](https://github.com/conventional-changelog/commitlint/compare/v12.0.1...v12.1.0) (2021-03-06)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @commitlint/read
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [12.0.1](https://github.com/conventional-changelog/commitlint/compare/v12.0.0...v12.0.1) (2021-02-23)
|
|
72
|
+
|
|
73
|
+
**Note:** Version bump only for package @commitlint/read
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# [12.0.0](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.0) (2021-01-18)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @commitlint/read
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# [11.0.0](https://github.com/conventional-changelog/commitlint/compare/v10.0.0...v11.0.0) (2020-09-05)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* update dependency @types/fs-extra to ^9.0.1 ([#2088](https://github.com/conventional-changelog/commitlint/issues/2088)) ([cb1028e](https://github.com/conventional-changelog/commitlint/commit/cb1028ef2700d86991c69a1e2ad391bc1bdc9d90))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# [10.0.0](https://github.com/conventional-changelog/commitlint/compare/v9.1.2...v10.0.0) (2020-08-16)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Bug Fixes
|
|
102
|
+
|
|
103
|
+
* update dependency fs-extra to v9 ([#1018](https://github.com/conventional-changelog/commitlint/issues/1018)) ([2df49fa](https://github.com/conventional-changelog/commitlint/commit/2df49fac907993ae78199a1012e918b0e2ff5621))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
* refactor!: drop support for node 8 (#1999) ([751f39f](https://github.com/conventional-changelog/commitlint/commit/751f39f284ef232574a176c3c11b1982ee544166)), closes [#1999](https://github.com/conventional-changelog/commitlint/issues/1999)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### BREAKING CHANGES
|
|
110
|
+
|
|
111
|
+
* remove node 8 from circle-ci checks
|
|
112
|
+
|
|
113
|
+
also remove node 13 because we do not support experimental versions
|
|
114
|
+
|
|
115
|
+
* docs: update node v10 to latest LTS 10 version
|
|
116
|
+
|
|
117
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
118
|
+
|
|
119
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
|
|
126
|
+
|
|
127
|
+
**Note:** Version bump only for package @commitlint/read
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## [9.1.1](https://github.com/conventional-changelog/commitlint/compare/v9.1.0...v9.1.1) (2020-06-30)
|
|
134
|
+
|
|
135
|
+
**Note:** Version bump only for package @commitlint/read
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# [9.1.0](https://github.com/conventional-changelog/commitlint/compare/v9.0.1...v9.1.0) (2020-06-21)
|
|
142
|
+
|
|
143
|
+
**Note:** Version bump only for package @commitlint/read
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## [9.0.1](https://github.com/conventional-changelog/commitlint/compare/v9.0.0...v9.0.1) (2020-05-26)
|
|
150
|
+
|
|
151
|
+
**Note:** Version bump only for package @commitlint/read
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
# [9.0.0](https://github.com/conventional-changelog/commitlint/compare/v8.3.5...v9.0.0) (2020-05-21)
|
|
158
|
+
|
|
159
|
+
**Note:** Version bump only for package @commitlint/read
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## [8.3.4](https://github.com/conventional-changelog/commitlint/compare/v8.3.3...v8.3.4) (2020-01-03)
|
|
166
|
+
|
|
167
|
+
**Note:** Version bump only for package @commitlint/read
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# [8.3.0](https://github.com/conventional-changelog/commitlint/compare/v8.2.0...v8.3.0) (2019-10-16)
|
|
174
|
+
|
|
175
|
+
**Note:** Version bump only for package @commitlint/read
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
# [8.2.0](https://github.com/conventional-changelog/commitlint/compare/v8.1.0...v8.2.0) (2019-09-16)
|
|
182
|
+
|
|
183
|
+
**Note:** Version bump only for package @commitlint/read
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
# [8.1.0](https://github.com/conventional-changelog/commitlint/compare/v8.0.0...v8.1.0) (2019-07-15)
|
|
190
|
+
|
|
191
|
+
**Note:** Version bump only for package @commitlint/read
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
### Bug Fixes
|
|
201
|
+
|
|
202
|
+
* use sander.readFile correctly ([#448](https://github.com/conventional-changelog/commitlint/issues/448)) ([#630](https://github.com/conventional-changelog/commitlint/issues/630)) ([8e47985](https://github.com/conventional-changelog/commitlint/commit/8e47985))
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<a name="7.5.0"></a>
|
|
209
|
+
# [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
### Bug Fixes
|
|
213
|
+
|
|
214
|
+
* all broken website references ([#564](https://github.com/conventional-changelog/commitlint/issues/564)) ([82eeb5a](https://github.com/conventional-changelog/commitlint/commit/82eeb5a))
|
|
215
|
+
* replace all repository references with conventional changelog ([#561](https://github.com/conventional-changelog/commitlint/issues/561)) ([6c3afcd](https://github.com/conventional-changelog/commitlint/commit/6c3afcd))
|
|
216
|
+
* replace all website references with conventional changelog ([#563](https://github.com/conventional-changelog/commitlint/issues/563)) ([6b86fb1](https://github.com/conventional-changelog/commitlint/commit/6b86fb1))
|
|
217
|
+
* resolve path to commit message for git submodules ([83b1a47](https://github.com/conventional-changelog/commitlint/commit/83b1a47))
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### Features
|
|
221
|
+
|
|
222
|
+
* add support for git submodules ([cc575fa](https://github.com/conventional-changelog/commitlint/commit/cc575fa))
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<a name="7.3.1"></a>
|
|
228
|
+
## [7.3.1](https://github.com/conventional-changelog/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
**Note:** Version bump only for package @commitlint/read
|
|
234
|
+
|
|
235
|
+
<a name="7.3.0"></a>
|
|
236
|
+
# [7.3.0](https://github.com/conventional-changelog/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
**Note:** Version bump only for package @commitlint/read
|
|
242
|
+
|
|
243
|
+
<a name="7.1.2"></a>
|
|
244
|
+
## [7.1.2](https://github.com/conventional-changelog/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
**Note:** Version bump only for package @commitlint/read
|
|
250
|
+
|
|
251
|
+
<a name="6.1.1"></a>
|
|
252
|
+
## [6.1.1](https://github.com/conventional-changelog/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
**Note:** Version bump only for package @commitlint/read
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
> Read commit messages from a specified range or last edit
|
|
2
|
+
|
|
3
|
+
# @commitlint/read
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install --save @commitlint/read
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
const read = require('@commitlint/read').default;
|
|
15
|
+
|
|
16
|
+
// Read last edited commit message
|
|
17
|
+
read({edit: true}).then((messages) => console.log(messages));
|
|
18
|
+
// => ['I did something\n\n']
|
|
19
|
+
|
|
20
|
+
// Read from the third to second commit message from HEAD
|
|
21
|
+
read({from: 'HEAD~2', to: 'HEAD~1'}).then((messages) => console.log(messages));
|
|
22
|
+
// => ['Initial commit\n\n']
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Consult [docs/api](https://conventional-changelog.github.io/commitlint/#/reference-api) for comprehensive documentation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-edit-commit.d.ts","sourceRoot":"","sources":["../src/get-edit-commit.ts"],"names":[],"mappings":"AAKA,wBAAsB,aAAa,CAClC,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GACrB,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getEditCommit = void 0;
|
|
7
|
+
const top_level_1 = __importDefault(require("@commitlint/top-level"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const get_edit_file_path_1 = require("./get-edit-file-path");
|
|
10
|
+
// Get recently edited commit message
|
|
11
|
+
async function getEditCommit(cwd, edit) {
|
|
12
|
+
const top = await (0, top_level_1.default)(cwd);
|
|
13
|
+
if (typeof top !== 'string') {
|
|
14
|
+
throw new TypeError(`Could not find git root from ${cwd}`);
|
|
15
|
+
}
|
|
16
|
+
const editFilePath = await (0, get_edit_file_path_1.getEditFilePath)(top, edit);
|
|
17
|
+
const editFile = await fs_extra_1.default.readFile(editFilePath);
|
|
18
|
+
return [`${editFile.toString('utf-8')}\n`];
|
|
19
|
+
}
|
|
20
|
+
exports.getEditCommit = getEditCommit;
|
|
21
|
+
//# sourceMappingURL=get-edit-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-edit-commit.js","sourceRoot":"","sources":["../src/get-edit-commit.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAC7C,wDAA0B;AAC1B,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;QAC5B,MAAM,IAAI,SAAS,CAAC,gCAAgC,GAAG,EAAE,CAAC,CAAC;KAC3D;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-edit-file-path.d.ts","sourceRoot":"","sources":["../src/get-edit-file-path.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getEditFilePath = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
// Get path to recently edited commit message file
|
|
10
|
+
async function getEditFilePath(top, edit) {
|
|
11
|
+
if (typeof edit === 'string') {
|
|
12
|
+
return path_1.default.resolve(top, edit);
|
|
13
|
+
}
|
|
14
|
+
const dotgitPath = path_1.default.join(top, '.git');
|
|
15
|
+
const dotgitStats = await fs_extra_1.default.lstat(dotgitPath);
|
|
16
|
+
if (dotgitStats.isDirectory()) {
|
|
17
|
+
return path_1.default.join(top, '.git/COMMIT_EDITMSG');
|
|
18
|
+
}
|
|
19
|
+
const gitFile = await fs_extra_1.default.readFile(dotgitPath, {
|
|
20
|
+
encoding: 'utf-8',
|
|
21
|
+
});
|
|
22
|
+
const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', '');
|
|
23
|
+
return path_1.default.resolve(top, relativeGitPath, 'COMMIT_EDITMSG');
|
|
24
|
+
}
|
|
25
|
+
exports.getEditFilePath = getEditFilePath;
|
|
26
|
+
//# sourceMappingURL=get-edit-file-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-edit-file-path.js","sourceRoot":"","sources":["../src/get-edit-file-path.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAE1B,kDAAkD;AAC3C,KAAK,UAAU,eAAe,CACpC,GAAW,EACX,IAAuB;IAEvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,OAAO,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KAC/B;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;QAC9B,OAAO,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;KAC7C;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-history-commits.d.ts","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":"AAIA,wBAAsB,iBAAiB,CACtC,OAAO,EAAE;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,EACrC,IAAI,GAAE;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAM,GACvB,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getHistoryCommits = void 0;
|
|
7
|
+
const git_raw_commits_1 = __importDefault(require("git-raw-commits"));
|
|
8
|
+
const stream_to_promise_1 = require("./stream-to-promise");
|
|
9
|
+
// Get commit messages from history
|
|
10
|
+
async function getHistoryCommits(options, opts = {}) {
|
|
11
|
+
return (0, stream_to_promise_1.streamToPromise)((0, git_raw_commits_1.default)(options, { cwd: opts.cwd }));
|
|
12
|
+
}
|
|
13
|
+
exports.getHistoryCommits = getHistoryCommits;
|
|
14
|
+
//# sourceMappingURL=get-history-commits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-history-commits.js","sourceRoot":"","sources":["../src/get-history-commits.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA4C;AAC5C,2DAAoD;AAEpD,mCAAmC;AAC5B,KAAK,UAAU,iBAAiB,CACtC,OAAqC,EACrC,OAAuB,EAAE;IAEzB,OAAO,IAAA,mCAAe,EAAC,IAAA,yBAAa,EAAC,OAAO,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AALD,8CAKC"}
|
package/lib/read.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAGA,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,GAAG,MAAM,CAAC;CACxB;AAGD,wBAA8B,iBAAiB,CAC9C,QAAQ,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB"}
|
package/lib/read.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_history_commits_1 = require("./get-history-commits");
|
|
4
|
+
const get_edit_commit_1 = require("./get-edit-commit");
|
|
5
|
+
// Get commit messages
|
|
6
|
+
async function getCommitMessages(settings) {
|
|
7
|
+
const { cwd, from, to, edit } = settings;
|
|
8
|
+
if (edit) {
|
|
9
|
+
return (0, get_edit_commit_1.getEditCommit)(cwd, edit);
|
|
10
|
+
}
|
|
11
|
+
return (0, get_history_commits_1.getHistoryCommits)({ from, to }, { cwd });
|
|
12
|
+
}
|
|
13
|
+
exports.default = getCommitMessages;
|
|
14
|
+
//# sourceMappingURL=read.js.map
|
package/lib/read.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;AAAA,+DAAwD;AACxD,uDAAgD;AAShD,sBAAsB;AACP,KAAK,UAAU,iBAAiB,CAC9C,QAAiC;IAEjC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAC,GAAG,QAAQ,CAAC;IAEvC,IAAI,IAAI,EAAE;QACT,OAAO,IAAA,+BAAa,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KAChC;IAED,OAAO,IAAA,uCAAiB,EAAC,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;AAC7C,CAAC;AAVD,oCAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-to-promise.d.ts","sourceRoot":"","sources":["../src/stream-to-promise.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.streamToPromise = void 0;
|
|
4
|
+
function streamToPromise(stream) {
|
|
5
|
+
const data = [];
|
|
6
|
+
return new Promise((resolve, reject) => stream
|
|
7
|
+
.on('data', (chunk) => data.push(chunk.toString('utf-8')))
|
|
8
|
+
.on('error', reject)
|
|
9
|
+
.on('end', () => resolve(data)));
|
|
10
|
+
}
|
|
11
|
+
exports.streamToPromise = streamToPromise;
|
|
12
|
+
//# sourceMappingURL=stream-to-promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-to-promise.js","sourceRoot":"","sources":["../src/stream-to-promise.ts"],"names":[],"mappings":";;;AAEA,SAAgB,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;AARD,0CAQC"}
|
package/license.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 - present Mario Nebl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commitlint/read",
|
|
3
|
+
"version": "13.2.0",
|
|
4
|
+
"description": "Read commit messages from a specified range or last edit",
|
|
5
|
+
"main": "lib/read.js",
|
|
6
|
+
"types": "lib/read.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"deps": "dep-check",
|
|
12
|
+
"pkg": "pkg-check --skip-import"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=v12"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/conventional-changelog/commitlint.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/conventional-changelog/commitlint/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/conventional-changelog/commitlint#readme",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"conventional-changelog",
|
|
27
|
+
"commitlint",
|
|
28
|
+
"library",
|
|
29
|
+
"core"
|
|
30
|
+
],
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "Mario Nebl",
|
|
33
|
+
"email": "hello@herebecode.com"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@commitlint/test": "^13.2.0",
|
|
38
|
+
"@commitlint/utils": "^13.2.0",
|
|
39
|
+
"@types/fs-extra": "^9.0.1",
|
|
40
|
+
"@types/git-raw-commits": "^2.0.0",
|
|
41
|
+
"execa": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@commitlint/top-level": "^13.2.0",
|
|
45
|
+
"@commitlint/types": "^13.2.0",
|
|
46
|
+
"fs-extra": "^10.0.0",
|
|
47
|
+
"git-raw-commits": "^2.0.0"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "65e45339c79e46d01e35ec067edf14d225a3528a"
|
|
50
|
+
}
|