claude-issue-solver 1.19.3 → 1.19.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/dist/commands/list.js +43 -41
- package/package.json +1 -1
package/dist/commands/list.js
CHANGED
|
@@ -7,49 +7,55 @@ exports.listCommand = listCommand;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const github_1 = require("../utils/github");
|
|
9
9
|
const git_1 = require("../utils/git");
|
|
10
|
-
function
|
|
10
|
+
function formatBody(body, indent, termWidth) {
|
|
11
11
|
if (!body)
|
|
12
|
-
return
|
|
12
|
+
return [];
|
|
13
13
|
const lines = body.split('\n');
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const output = [];
|
|
15
|
+
const textWidth = termWidth - indent.length - 2;
|
|
16
16
|
for (const line of lines) {
|
|
17
17
|
const trimmed = line.trim();
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (!trimmed) {
|
|
19
|
+
// Preserve blank lines
|
|
20
|
+
output.push('');
|
|
20
21
|
continue;
|
|
21
22
|
}
|
|
22
|
-
//
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
started = true;
|
|
28
|
-
paragraphLines.push(trimmed);
|
|
23
|
+
// Handle markdown headers - make them stand out
|
|
24
|
+
if (trimmed.startsWith('#')) {
|
|
25
|
+
const headerText = trimmed.replace(/^#+\s*/, '');
|
|
26
|
+
output.push(indent + headerText);
|
|
27
|
+
continue;
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const words = text.split(/\s+/);
|
|
35
|
-
const lines = [];
|
|
36
|
-
let currentLine = '';
|
|
37
|
-
for (const word of words) {
|
|
38
|
-
if (!currentLine) {
|
|
39
|
-
currentLine = word;
|
|
29
|
+
// Handle list items
|
|
30
|
+
if (trimmed.match(/^[-*]\s/) || trimmed.match(/^\d+\.\s/)) {
|
|
31
|
+
output.push(indent + ' ' + trimmed);
|
|
32
|
+
continue;
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
// Word wrap regular text
|
|
35
|
+
if (trimmed.length <= textWidth) {
|
|
36
|
+
output.push(indent + trimmed);
|
|
43
37
|
}
|
|
44
38
|
else {
|
|
45
|
-
|
|
46
|
-
currentLine =
|
|
39
|
+
const words = trimmed.split(/\s+/);
|
|
40
|
+
let currentLine = '';
|
|
41
|
+
for (const word of words) {
|
|
42
|
+
if (!currentLine) {
|
|
43
|
+
currentLine = word;
|
|
44
|
+
}
|
|
45
|
+
else if (currentLine.length + 1 + word.length <= textWidth) {
|
|
46
|
+
currentLine += ' ' + word;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
output.push(indent + currentLine);
|
|
50
|
+
currentLine = word;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (currentLine) {
|
|
54
|
+
output.push(indent + currentLine);
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
|
-
|
|
50
|
-
lines.push(indent + currentLine);
|
|
51
|
-
}
|
|
52
|
-
return lines;
|
|
58
|
+
return output;
|
|
53
59
|
}
|
|
54
60
|
async function listCommand(options = {}) {
|
|
55
61
|
const projectName = (0, git_1.getProjectName)();
|
|
@@ -67,17 +73,13 @@ async function listCommand(options = {}) {
|
|
|
67
73
|
: '';
|
|
68
74
|
console.log(` ${chalk_1.default.cyan(`#${issue.number}`)}\t${issue.title}${prTag}${labels}`);
|
|
69
75
|
if (options.verbose && issue.body) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const wrappedLines = wrapText(paragraph, textWidth, indent);
|
|
76
|
-
for (const line of wrappedLines) {
|
|
77
|
-
console.log(chalk_1.default.dim(line));
|
|
78
|
-
}
|
|
79
|
-
console.log(); // blank line between issues
|
|
76
|
+
const termWidth = process.stdout.columns || 80;
|
|
77
|
+
const indent = ' ';
|
|
78
|
+
const formattedLines = formatBody(issue.body, indent, termWidth);
|
|
79
|
+
for (const line of formattedLines) {
|
|
80
|
+
console.log(chalk_1.default.dim(line));
|
|
80
81
|
}
|
|
82
|
+
console.log(); // blank line between issues
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
console.log();
|