@releasekit/version 0.7.45 → 0.7.47
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/dist/{chunk-45DJUNXI.js → chunk-UBCKZYTO.js} +60 -738
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/dist-3B6ZXCEH.js +0 -431
- package/dist/dist-XFQOB6BJ.js +0 -102
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/dist/dist-3B6ZXCEH.js
DELETED
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/regex.js
|
|
2
|
-
var nomatchRegex = /(?!.*)/;
|
|
3
|
-
function join(parts, joiner) {
|
|
4
|
-
return parts.map((val) => val.trim()).filter(Boolean).join(joiner);
|
|
5
|
-
}
|
|
6
|
-
function getNotesRegex(noteKeywords, notesPattern) {
|
|
7
|
-
if (!noteKeywords) {
|
|
8
|
-
return nomatchRegex;
|
|
9
|
-
}
|
|
10
|
-
const noteKeywordsSelection = join(noteKeywords, "|");
|
|
11
|
-
if (!notesPattern) {
|
|
12
|
-
return new RegExp(`^[\\s|*]*(${noteKeywordsSelection})[:\\s]+(.*)`, "i");
|
|
13
|
-
}
|
|
14
|
-
return notesPattern(noteKeywordsSelection);
|
|
15
|
-
}
|
|
16
|
-
function getReferencePartsRegex(issuePrefixes, issuePrefixesCaseSensitive) {
|
|
17
|
-
if (!issuePrefixes) {
|
|
18
|
-
return nomatchRegex;
|
|
19
|
-
}
|
|
20
|
-
const flags = issuePrefixesCaseSensitive ? "g" : "gi";
|
|
21
|
-
return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${join(issuePrefixes, "|")})([\\w-]+)(?=\\s|$|[,;)\\]])`, flags);
|
|
22
|
-
}
|
|
23
|
-
function getReferencesRegex(referenceActions) {
|
|
24
|
-
if (!referenceActions) {
|
|
25
|
-
return /()(.+)/gi;
|
|
26
|
-
}
|
|
27
|
-
const joinedKeywords = join(referenceActions, "|");
|
|
28
|
-
return new RegExp(`(${joinedKeywords})(?:\\s+(.*?))(?=(?:${joinedKeywords})|$)`, "gi");
|
|
29
|
-
}
|
|
30
|
-
function getParserRegexes(options = {}) {
|
|
31
|
-
const notes = getNotesRegex(options.noteKeywords, options.notesPattern);
|
|
32
|
-
const referenceParts = getReferencePartsRegex(options.issuePrefixes, options.issuePrefixesCaseSensitive);
|
|
33
|
-
const references = getReferencesRegex(options.referenceActions);
|
|
34
|
-
return {
|
|
35
|
-
notes,
|
|
36
|
-
referenceParts,
|
|
37
|
-
references,
|
|
38
|
-
mentions: /@([\w-]+)/g,
|
|
39
|
-
url: /\b(?:https?):\/\/(?:www\.)?([-a-zA-Z0-9@:%_+.~#?&//=])+\b/
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/utils.js
|
|
44
|
-
var SCISSOR = "------------------------ >8 ------------------------";
|
|
45
|
-
function trimNewLines(input) {
|
|
46
|
-
const matches = input.match(/[^\r\n]/);
|
|
47
|
-
if (typeof matches?.index !== "number") {
|
|
48
|
-
return "";
|
|
49
|
-
}
|
|
50
|
-
const firstIndex = matches.index;
|
|
51
|
-
let lastIndex = input.length - 1;
|
|
52
|
-
while (input[lastIndex] === "\r" || input[lastIndex] === "\n") {
|
|
53
|
-
lastIndex--;
|
|
54
|
-
}
|
|
55
|
-
return input.substring(firstIndex, lastIndex + 1);
|
|
56
|
-
}
|
|
57
|
-
function appendLine(src, line) {
|
|
58
|
-
return src ? `${src}
|
|
59
|
-
${line || ""}` : line || "";
|
|
60
|
-
}
|
|
61
|
-
function getCommentFilter(char) {
|
|
62
|
-
return char ? (line) => !line.startsWith(char) : () => true;
|
|
63
|
-
}
|
|
64
|
-
function truncateToScissor(lines, commentChar) {
|
|
65
|
-
const scissorIndex = lines.indexOf(`${commentChar} ${SCISSOR}`);
|
|
66
|
-
if (scissorIndex === -1) {
|
|
67
|
-
return lines;
|
|
68
|
-
}
|
|
69
|
-
return lines.slice(0, scissorIndex);
|
|
70
|
-
}
|
|
71
|
-
function gpgFilter(line) {
|
|
72
|
-
return !line.match(/^\s*gpg:/);
|
|
73
|
-
}
|
|
74
|
-
function assignMatchedCorrespondence(target, matches, correspondence) {
|
|
75
|
-
const { groups } = matches;
|
|
76
|
-
for (let i = 0, len = correspondence.length, key; i < len; i++) {
|
|
77
|
-
key = correspondence[i];
|
|
78
|
-
target[key] = (groups ? groups[key] : matches[i + 1]) || null;
|
|
79
|
-
}
|
|
80
|
-
return target;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/options.js
|
|
84
|
-
var defaultOptions = {
|
|
85
|
-
noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
|
|
86
|
-
issuePrefixes: ["#"],
|
|
87
|
-
referenceActions: [
|
|
88
|
-
"close",
|
|
89
|
-
"closes",
|
|
90
|
-
"closed",
|
|
91
|
-
"fix",
|
|
92
|
-
"fixes",
|
|
93
|
-
"fixed",
|
|
94
|
-
"resolve",
|
|
95
|
-
"resolves",
|
|
96
|
-
"resolved"
|
|
97
|
-
],
|
|
98
|
-
headerPattern: /^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,
|
|
99
|
-
headerCorrespondence: [
|
|
100
|
-
"type",
|
|
101
|
-
"scope",
|
|
102
|
-
"subject"
|
|
103
|
-
],
|
|
104
|
-
revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./,
|
|
105
|
-
revertCorrespondence: ["header", "hash"],
|
|
106
|
-
fieldPattern: /^-(.*?)-$/
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/CommitParser.js
|
|
110
|
-
function createCommitObject(initialData = {}) {
|
|
111
|
-
return {
|
|
112
|
-
merge: null,
|
|
113
|
-
revert: null,
|
|
114
|
-
header: null,
|
|
115
|
-
body: null,
|
|
116
|
-
footer: null,
|
|
117
|
-
notes: [],
|
|
118
|
-
mentions: [],
|
|
119
|
-
references: [],
|
|
120
|
-
...initialData
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
var CommitParser = class {
|
|
124
|
-
options;
|
|
125
|
-
regexes;
|
|
126
|
-
lines = [];
|
|
127
|
-
lineIndex = 0;
|
|
128
|
-
commit = createCommitObject();
|
|
129
|
-
constructor(options = {}) {
|
|
130
|
-
this.options = {
|
|
131
|
-
...defaultOptions,
|
|
132
|
-
...options
|
|
133
|
-
};
|
|
134
|
-
this.regexes = getParserRegexes(this.options);
|
|
135
|
-
}
|
|
136
|
-
currentLine() {
|
|
137
|
-
return this.lines[this.lineIndex];
|
|
138
|
-
}
|
|
139
|
-
nextLine() {
|
|
140
|
-
return this.lines[this.lineIndex++];
|
|
141
|
-
}
|
|
142
|
-
isLineAvailable() {
|
|
143
|
-
return this.lineIndex < this.lines.length;
|
|
144
|
-
}
|
|
145
|
-
parseReference(input, action) {
|
|
146
|
-
const { regexes } = this;
|
|
147
|
-
if (regexes.url.test(input)) {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
const matches = regexes.referenceParts.exec(input);
|
|
151
|
-
if (!matches) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
let [raw, repository = null, prefix, issue] = matches;
|
|
155
|
-
let owner = null;
|
|
156
|
-
if (repository) {
|
|
157
|
-
const slashIndex = repository.indexOf("/");
|
|
158
|
-
if (slashIndex !== -1) {
|
|
159
|
-
owner = repository.slice(0, slashIndex);
|
|
160
|
-
repository = repository.slice(slashIndex + 1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
raw,
|
|
165
|
-
action,
|
|
166
|
-
owner,
|
|
167
|
-
repository,
|
|
168
|
-
prefix,
|
|
169
|
-
issue
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
parseReferences(input) {
|
|
173
|
-
const { regexes } = this;
|
|
174
|
-
const regex = input.match(regexes.references) ? regexes.references : /()(.+)/gi;
|
|
175
|
-
const references = [];
|
|
176
|
-
let matches;
|
|
177
|
-
let action;
|
|
178
|
-
let sentence;
|
|
179
|
-
let reference;
|
|
180
|
-
while (true) {
|
|
181
|
-
matches = regex.exec(input);
|
|
182
|
-
if (!matches) {
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
action = matches[1] || null;
|
|
186
|
-
sentence = matches[2] || "";
|
|
187
|
-
while (true) {
|
|
188
|
-
reference = this.parseReference(sentence, action);
|
|
189
|
-
if (!reference) {
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
references.push(reference);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return references;
|
|
196
|
-
}
|
|
197
|
-
skipEmptyLines() {
|
|
198
|
-
let line = this.currentLine();
|
|
199
|
-
while (line !== void 0 && !line.trim()) {
|
|
200
|
-
this.nextLine();
|
|
201
|
-
line = this.currentLine();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
parseMerge() {
|
|
205
|
-
const { commit, options } = this;
|
|
206
|
-
const correspondence = options.mergeCorrespondence || [];
|
|
207
|
-
const merge = this.currentLine();
|
|
208
|
-
const matches = merge && options.mergePattern ? merge.match(options.mergePattern) : null;
|
|
209
|
-
if (matches) {
|
|
210
|
-
this.nextLine();
|
|
211
|
-
commit.merge = matches[0] || null;
|
|
212
|
-
assignMatchedCorrespondence(commit, matches, correspondence);
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
parseHeader(isMergeCommit) {
|
|
218
|
-
if (isMergeCommit) {
|
|
219
|
-
this.skipEmptyLines();
|
|
220
|
-
}
|
|
221
|
-
const { commit, options } = this;
|
|
222
|
-
const correspondence = options.headerCorrespondence || [];
|
|
223
|
-
const header = commit.header ?? this.nextLine();
|
|
224
|
-
let matches = null;
|
|
225
|
-
if (header) {
|
|
226
|
-
if (options.breakingHeaderPattern) {
|
|
227
|
-
matches = header.match(options.breakingHeaderPattern);
|
|
228
|
-
}
|
|
229
|
-
if (!matches && options.headerPattern) {
|
|
230
|
-
matches = header.match(options.headerPattern);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (header) {
|
|
234
|
-
commit.header = header;
|
|
235
|
-
}
|
|
236
|
-
if (matches) {
|
|
237
|
-
assignMatchedCorrespondence(commit, matches, correspondence);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
parseMeta() {
|
|
241
|
-
const { options, commit } = this;
|
|
242
|
-
if (!options.fieldPattern || !this.isLineAvailable()) {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
let matches;
|
|
246
|
-
let field = null;
|
|
247
|
-
let parsed = false;
|
|
248
|
-
while (this.isLineAvailable()) {
|
|
249
|
-
matches = this.currentLine().match(options.fieldPattern);
|
|
250
|
-
if (matches) {
|
|
251
|
-
field = matches[1] || null;
|
|
252
|
-
this.nextLine();
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
if (field) {
|
|
256
|
-
parsed = true;
|
|
257
|
-
commit[field] = appendLine(commit[field], this.currentLine());
|
|
258
|
-
this.nextLine();
|
|
259
|
-
} else {
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return parsed;
|
|
264
|
-
}
|
|
265
|
-
parseNotes() {
|
|
266
|
-
const { regexes, commit } = this;
|
|
267
|
-
if (!this.isLineAvailable()) {
|
|
268
|
-
return false;
|
|
269
|
-
}
|
|
270
|
-
const matches = this.currentLine().match(regexes.notes);
|
|
271
|
-
let references = [];
|
|
272
|
-
if (matches) {
|
|
273
|
-
const note = {
|
|
274
|
-
title: matches[1],
|
|
275
|
-
text: matches[2]
|
|
276
|
-
};
|
|
277
|
-
commit.notes.push(note);
|
|
278
|
-
commit.footer = appendLine(commit.footer, this.currentLine());
|
|
279
|
-
this.nextLine();
|
|
280
|
-
while (this.isLineAvailable()) {
|
|
281
|
-
if (this.parseMeta()) {
|
|
282
|
-
return true;
|
|
283
|
-
}
|
|
284
|
-
if (this.parseNotes()) {
|
|
285
|
-
return true;
|
|
286
|
-
}
|
|
287
|
-
references = this.parseReferences(this.currentLine());
|
|
288
|
-
if (references.length) {
|
|
289
|
-
commit.references.push(...references);
|
|
290
|
-
} else {
|
|
291
|
-
note.text = appendLine(note.text, this.currentLine());
|
|
292
|
-
}
|
|
293
|
-
commit.footer = appendLine(commit.footer, this.currentLine());
|
|
294
|
-
this.nextLine();
|
|
295
|
-
if (references.length) {
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
parseBodyAndFooter(isBody) {
|
|
304
|
-
const { commit } = this;
|
|
305
|
-
if (!this.isLineAvailable()) {
|
|
306
|
-
return isBody;
|
|
307
|
-
}
|
|
308
|
-
const references = this.parseReferences(this.currentLine());
|
|
309
|
-
const isStillBody = !references.length && isBody;
|
|
310
|
-
if (isStillBody) {
|
|
311
|
-
commit.body = appendLine(commit.body, this.currentLine());
|
|
312
|
-
} else {
|
|
313
|
-
commit.references.push(...references);
|
|
314
|
-
commit.footer = appendLine(commit.footer, this.currentLine());
|
|
315
|
-
}
|
|
316
|
-
this.nextLine();
|
|
317
|
-
return isStillBody;
|
|
318
|
-
}
|
|
319
|
-
parseBreakingHeader() {
|
|
320
|
-
const { commit, options } = this;
|
|
321
|
-
if (!options.breakingHeaderPattern || commit.notes.length || !commit.header) {
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
const matches = commit.header.match(options.breakingHeaderPattern);
|
|
325
|
-
if (matches) {
|
|
326
|
-
commit.notes.push({
|
|
327
|
-
title: "BREAKING CHANGE",
|
|
328
|
-
text: matches[3]
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
parseMentions(input) {
|
|
333
|
-
const { commit, regexes } = this;
|
|
334
|
-
let matches;
|
|
335
|
-
for (; ; ) {
|
|
336
|
-
matches = regexes.mentions.exec(input);
|
|
337
|
-
if (!matches) {
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
340
|
-
commit.mentions.push(matches[1]);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
parseRevert(input) {
|
|
344
|
-
const { commit, options } = this;
|
|
345
|
-
const correspondence = options.revertCorrespondence || [];
|
|
346
|
-
const matches = options.revertPattern ? input.match(options.revertPattern) : null;
|
|
347
|
-
if (matches) {
|
|
348
|
-
commit.revert = assignMatchedCorrespondence({}, matches, correspondence);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
cleanupCommit() {
|
|
352
|
-
const { commit } = this;
|
|
353
|
-
if (commit.body) {
|
|
354
|
-
commit.body = trimNewLines(commit.body);
|
|
355
|
-
}
|
|
356
|
-
if (commit.footer) {
|
|
357
|
-
commit.footer = trimNewLines(commit.footer);
|
|
358
|
-
}
|
|
359
|
-
commit.notes.forEach((note) => {
|
|
360
|
-
note.text = trimNewLines(note.text);
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Parse commit message string into an object.
|
|
365
|
-
* @param input - Commit message string.
|
|
366
|
-
* @returns Commit object.
|
|
367
|
-
*/
|
|
368
|
-
parse(input) {
|
|
369
|
-
if (!input.trim()) {
|
|
370
|
-
throw new TypeError("Expected a raw commit");
|
|
371
|
-
}
|
|
372
|
-
const { commentChar } = this.options;
|
|
373
|
-
const commentFilter = getCommentFilter(commentChar);
|
|
374
|
-
const rawLines = trimNewLines(input).split(/\r?\n/);
|
|
375
|
-
const lines = commentChar ? truncateToScissor(rawLines, commentChar).filter((line) => commentFilter(line) && gpgFilter(line)) : rawLines.filter((line) => gpgFilter(line));
|
|
376
|
-
const commit = createCommitObject();
|
|
377
|
-
this.lines = lines;
|
|
378
|
-
this.lineIndex = 0;
|
|
379
|
-
this.commit = commit;
|
|
380
|
-
const isMergeCommit = this.parseMerge();
|
|
381
|
-
this.parseHeader(isMergeCommit);
|
|
382
|
-
if (commit.header) {
|
|
383
|
-
commit.references = this.parseReferences(commit.header);
|
|
384
|
-
}
|
|
385
|
-
let isBody = true;
|
|
386
|
-
while (this.isLineAvailable()) {
|
|
387
|
-
this.parseMeta();
|
|
388
|
-
if (this.parseNotes()) {
|
|
389
|
-
isBody = false;
|
|
390
|
-
}
|
|
391
|
-
if (!this.parseBodyAndFooter(isBody)) {
|
|
392
|
-
isBody = false;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
this.parseBreakingHeader();
|
|
396
|
-
this.parseMentions(input);
|
|
397
|
-
this.parseRevert(input);
|
|
398
|
-
this.cleanupCommit();
|
|
399
|
-
return commit;
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/stream.js
|
|
404
|
-
import { Transform } from "stream";
|
|
405
|
-
function parseCommits(options = {}) {
|
|
406
|
-
const warnOption = options.warn;
|
|
407
|
-
const warn = warnOption === true ? (err) => {
|
|
408
|
-
throw err;
|
|
409
|
-
} : warnOption ? (err) => warnOption(err.toString()) : () => {
|
|
410
|
-
};
|
|
411
|
-
return async function* parse(rawCommits) {
|
|
412
|
-
const parser = new CommitParser(options);
|
|
413
|
-
let rawCommit;
|
|
414
|
-
for await (rawCommit of rawCommits) {
|
|
415
|
-
try {
|
|
416
|
-
yield parser.parse(rawCommit.toString());
|
|
417
|
-
} catch (err) {
|
|
418
|
-
warn(err);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
function parseCommitsStream(options = {}) {
|
|
424
|
-
return Transform.from(parseCommits(options));
|
|
425
|
-
}
|
|
426
|
-
export {
|
|
427
|
-
CommitParser,
|
|
428
|
-
createCommitObject,
|
|
429
|
-
parseCommits,
|
|
430
|
-
parseCommitsStream
|
|
431
|
-
};
|
package/dist/dist-XFQOB6BJ.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/utils.js
|
|
2
|
-
function isMatch(object, source) {
|
|
3
|
-
let aValue;
|
|
4
|
-
let bValue;
|
|
5
|
-
for (const key in source) {
|
|
6
|
-
aValue = object[key];
|
|
7
|
-
bValue = source[key];
|
|
8
|
-
if (typeof aValue === "string") {
|
|
9
|
-
aValue = aValue.trim();
|
|
10
|
-
}
|
|
11
|
-
if (typeof bValue === "string") {
|
|
12
|
-
bValue = bValue.trim();
|
|
13
|
-
}
|
|
14
|
-
if (aValue !== bValue) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
function findRevertCommit(commit, reverts) {
|
|
21
|
-
if (!reverts.size) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
const rawCommit = commit.raw || commit;
|
|
25
|
-
for (const revertCommit of reverts) {
|
|
26
|
-
if (revertCommit.revert && isMatch(rawCommit, revertCommit.revert)) {
|
|
27
|
-
return revertCommit;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.js
|
|
34
|
-
var RevertedCommitsFilter = class {
|
|
35
|
-
hold = /* @__PURE__ */ new Set();
|
|
36
|
-
holdRevertsCount = 0;
|
|
37
|
-
/**
|
|
38
|
-
* Process commit to filter reverted commits
|
|
39
|
-
* @param commit
|
|
40
|
-
* @yields Commit
|
|
41
|
-
*/
|
|
42
|
-
*process(commit) {
|
|
43
|
-
const { hold } = this;
|
|
44
|
-
const revertCommit = findRevertCommit(commit, hold);
|
|
45
|
-
if (revertCommit) {
|
|
46
|
-
hold.delete(revertCommit);
|
|
47
|
-
this.holdRevertsCount--;
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (commit.revert) {
|
|
51
|
-
hold.add(commit);
|
|
52
|
-
this.holdRevertsCount++;
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (this.holdRevertsCount > 0) {
|
|
56
|
-
hold.add(commit);
|
|
57
|
-
} else {
|
|
58
|
-
if (hold.size) {
|
|
59
|
-
yield* hold;
|
|
60
|
-
hold.clear();
|
|
61
|
-
}
|
|
62
|
-
yield commit;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Flush all held commits
|
|
67
|
-
* @yields Held commits
|
|
68
|
-
*/
|
|
69
|
-
*flush() {
|
|
70
|
-
const { hold } = this;
|
|
71
|
-
if (hold.size) {
|
|
72
|
-
yield* hold;
|
|
73
|
-
hold.clear();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/filters.js
|
|
79
|
-
import { Transform } from "stream";
|
|
80
|
-
async function* filterRevertedCommits(commits) {
|
|
81
|
-
const filter = new RevertedCommitsFilter();
|
|
82
|
-
for await (const commit of commits) {
|
|
83
|
-
yield* filter.process(commit);
|
|
84
|
-
}
|
|
85
|
-
yield* filter.flush();
|
|
86
|
-
}
|
|
87
|
-
function* filterRevertedCommitsSync(commits) {
|
|
88
|
-
const filter = new RevertedCommitsFilter();
|
|
89
|
-
for (const commit of commits) {
|
|
90
|
-
yield* filter.process(commit);
|
|
91
|
-
}
|
|
92
|
-
yield* filter.flush();
|
|
93
|
-
}
|
|
94
|
-
function filterRevertedCommitsStream() {
|
|
95
|
-
return Transform.from(filterRevertedCommits);
|
|
96
|
-
}
|
|
97
|
-
export {
|
|
98
|
-
RevertedCommitsFilter,
|
|
99
|
-
filterRevertedCommits,
|
|
100
|
-
filterRevertedCommitsStream,
|
|
101
|
-
filterRevertedCommitsSync
|
|
102
|
-
};
|