ticketlens 0.1.19 → 0.1.20
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/package.json
CHANGED
|
@@ -25,18 +25,28 @@ export function groupCommitsByTicket(logLines) {
|
|
|
25
25
|
function assemblePrBody(groups, ticketMap) {
|
|
26
26
|
const lines = ['## What changed', ''];
|
|
27
27
|
const keyedGroups = [...groups.entries()].filter(([k]) => k !== '__no_key__');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
if (keyedGroups.length === 0) {
|
|
29
|
+
lines.push('_No ticket references found in commits._');
|
|
30
|
+
} else {
|
|
31
|
+
for (const [key] of keyedGroups) {
|
|
32
|
+
const ticket = ticketMap.get(key);
|
|
33
|
+
const summary = ticket?.fields?.summary ?? ticket?.summary ?? null;
|
|
34
|
+
lines.push(summary ? `- **${key}** — ${summary}` : `- **${key}**`);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
|
-
lines.push('', '## Commits', '');
|
|
34
37
|
const seen = new Set();
|
|
38
|
+
const allCommits = [];
|
|
35
39
|
for (const commits of groups.values()) {
|
|
36
40
|
for (const c of commits) {
|
|
37
|
-
if (!seen.has(c)) { seen.add(c);
|
|
41
|
+
if (!seen.has(c)) { seen.add(c); allCommits.push(c); }
|
|
38
42
|
}
|
|
39
43
|
}
|
|
44
|
+
lines.push('', `## Commits (${allCommits.length})`, '');
|
|
45
|
+
for (const c of allCommits) {
|
|
46
|
+
const trimmed = c.trim();
|
|
47
|
+
const shaM = trimmed.match(/^([0-9a-f]{6,})\s(.+)$/);
|
|
48
|
+
lines.push(shaM ? `- \`${shaM[1]}\` ${shaM[2]}` : `- ${trimmed}`);
|
|
49
|
+
}
|
|
40
50
|
return lines.join('\n');
|
|
41
51
|
}
|
|
42
52
|
|
|
@@ -97,6 +107,12 @@ export function styleStandupMd(md, s) {
|
|
|
97
107
|
if (line.startsWith('## Standup')) {
|
|
98
108
|
return `\n ${s.brand(s.bold('◆ ' + line.slice(3)))}`;
|
|
99
109
|
}
|
|
110
|
+
if (line.startsWith('## What changed')) {
|
|
111
|
+
return `\n ${s.brand(s.bold('◆ What changed'))}`;
|
|
112
|
+
}
|
|
113
|
+
if (line.match(/^## Commits \(\d+\)/)) {
|
|
114
|
+
return `\n ${s.bold(line.slice(3))}`;
|
|
115
|
+
}
|
|
100
116
|
if (line.startsWith('### ')) {
|
|
101
117
|
return `\n ${s.bold(line.slice(4))}`;
|
|
102
118
|
}
|