claude-issue-solver 1.31.0 ā 1.32.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/dist/commands/review.d.ts +6 -2
- package/dist/commands/review.js +32 -46
- package/dist/index.js +4 -3
- package/package.json +1 -1
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export declare function reviewCommand(issueNumber: number
|
|
2
|
-
|
|
1
|
+
export declare function reviewCommand(issueNumber: number, options?: {
|
|
2
|
+
merge?: boolean;
|
|
3
|
+
}): Promise<void>;
|
|
4
|
+
export declare function selectReviewCommand(options?: {
|
|
5
|
+
merge?: boolean;
|
|
6
|
+
}): Promise<void>;
|
package/dist/commands/review.js
CHANGED
|
@@ -48,7 +48,7 @@ const github_1 = require("../utils/github");
|
|
|
48
48
|
const git_1 = require("../utils/git");
|
|
49
49
|
const helpers_1 = require("../utils/helpers");
|
|
50
50
|
const config_1 = require("./config");
|
|
51
|
-
async function reviewCommand(issueNumber) {
|
|
51
|
+
async function reviewCommand(issueNumber, options = {}) {
|
|
52
52
|
const spinner = (0, ora_1.default)(`Fetching issue #${issueNumber}...`).start();
|
|
53
53
|
const issue = (0, github_1.getIssue)(issueNumber);
|
|
54
54
|
if (!issue) {
|
|
@@ -275,6 +275,7 @@ echo "${botNote}"
|
|
|
275
275
|
echo ""
|
|
276
276
|
echo "Claude will review the PR and post suggestions."
|
|
277
277
|
echo "You can commit suggestions directly on GitHub."
|
|
278
|
+
${options.merge ? 'echo "\\nš Auto-merge enabled: will merge if approved."' : ''}
|
|
278
279
|
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
|
|
279
280
|
echo ""
|
|
280
281
|
|
|
@@ -295,30 +296,22 @@ REVIEW_STATUS=$(gh pr view ${prNumber} --json reviewDecision --jq '.reviewDecisi
|
|
|
295
296
|
if [ "$REVIEW_STATUS" = "APPROVED" ]; then
|
|
296
297
|
echo "ā
PR #${prNumber} is approved!"
|
|
297
298
|
echo ""
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
${options.merge ? ` echo "š¤ Auto-merging PR #${prNumber}..."
|
|
300
|
+
if gh pr merge ${prNumber} --squash --delete-branch; then
|
|
301
|
+
echo ""
|
|
302
|
+
echo "ā
PR merged successfully!"
|
|
301
303
|
echo ""
|
|
302
|
-
echo "
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
cd "${projectRoot}"
|
|
309
|
-
git worktree remove "${worktreePath}" --force 2>/dev/null || rm -rf "${worktreePath}"
|
|
310
|
-
git worktree prune 2>/dev/null
|
|
311
|
-
git branch -D "${branchName}" 2>/dev/null
|
|
312
|
-
echo "ā
Cleanup complete!"
|
|
313
|
-
else
|
|
314
|
-
echo ""
|
|
315
|
-
echo "ā ļø Merge failed. You can try manually: gh pr merge ${prNumber} --squash"
|
|
316
|
-
fi
|
|
304
|
+
echo "Cleaning up worktree..."
|
|
305
|
+
cd "${projectRoot}"
|
|
306
|
+
git worktree remove "${worktreePath}" --force 2>/dev/null || rm -rf "${worktreePath}"
|
|
307
|
+
git worktree prune 2>/dev/null
|
|
308
|
+
git branch -D "${branchName}" 2>/dev/null
|
|
309
|
+
echo "ā
Cleanup complete!"
|
|
317
310
|
else
|
|
318
311
|
echo ""
|
|
319
|
-
echo "
|
|
320
|
-
|
|
321
|
-
|
|
312
|
+
echo "ā ļø Merge failed. You can try manually: gh pr merge ${prNumber} --squash"
|
|
313
|
+
fi` : ` echo "View PR: gh pr view ${prNumber} --web"
|
|
314
|
+
echo "To merge: cis merge"`}
|
|
322
315
|
else
|
|
323
316
|
echo "View PR: gh pr view ${prNumber} --web"
|
|
324
317
|
fi
|
|
@@ -374,7 +367,7 @@ function getOpenPRs(projectRoot) {
|
|
|
374
367
|
return [];
|
|
375
368
|
}
|
|
376
369
|
}
|
|
377
|
-
async function selectReviewCommand() {
|
|
370
|
+
async function selectReviewCommand(options = {}) {
|
|
378
371
|
const projectRoot = (0, git_1.getProjectRoot)();
|
|
379
372
|
const projectName = (0, git_1.getProjectName)();
|
|
380
373
|
console.log(chalk_1.default.bold(`\nOpen PRs for ${projectName}:\n`));
|
|
@@ -425,13 +418,13 @@ async function selectReviewCommand() {
|
|
|
425
418
|
console.log();
|
|
426
419
|
// Launch reviews in parallel
|
|
427
420
|
for (const pr of selected) {
|
|
428
|
-
await launchReviewForPR(pr, projectRoot, projectName);
|
|
421
|
+
await launchReviewForPR(pr, projectRoot, projectName, options);
|
|
429
422
|
}
|
|
430
423
|
console.log();
|
|
431
424
|
console.log(chalk_1.default.green(`ā
Started ${selected.length} review session(s)!`));
|
|
432
425
|
console.log(chalk_1.default.dim(' Each review is running in its own terminal window.'));
|
|
433
426
|
}
|
|
434
|
-
async function launchReviewForPR(pr, projectRoot, projectName) {
|
|
427
|
+
async function launchReviewForPR(pr, projectRoot, projectName, options = {}) {
|
|
435
428
|
const baseBranch = (0, git_1.getDefaultBranch)();
|
|
436
429
|
const branchName = pr.headRefName;
|
|
437
430
|
const worktreePath = path.join(path.dirname(projectRoot), `${projectName}-${branchName}`);
|
|
@@ -615,6 +608,7 @@ echo "${botNote}"
|
|
|
615
608
|
echo ""
|
|
616
609
|
echo "Claude will review the PR and post suggestions."
|
|
617
610
|
echo "You can commit suggestions directly on GitHub."
|
|
611
|
+
${options.merge ? 'echo "\\nš Auto-merge enabled: will merge if approved."' : ''}
|
|
618
612
|
echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
|
|
619
613
|
echo ""
|
|
620
614
|
|
|
@@ -635,30 +629,22 @@ REVIEW_STATUS=$(gh pr view ${pr.number} --json reviewDecision --jq '.reviewDecis
|
|
|
635
629
|
if [ "$REVIEW_STATUS" = "APPROVED" ]; then
|
|
636
630
|
echo "ā
PR #${pr.number} is approved!"
|
|
637
631
|
echo ""
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
632
|
+
${options.merge ? ` echo "š¤ Auto-merging PR #${pr.number}..."
|
|
633
|
+
if gh pr merge ${pr.number} --squash --delete-branch; then
|
|
634
|
+
echo ""
|
|
635
|
+
echo "ā
PR merged successfully!"
|
|
641
636
|
echo ""
|
|
642
|
-
echo "
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
cd "${projectRoot}"
|
|
649
|
-
git worktree remove "${worktreePath}" --force 2>/dev/null || rm -rf "${worktreePath}"
|
|
650
|
-
git worktree prune 2>/dev/null
|
|
651
|
-
git branch -D "${branchName}" 2>/dev/null
|
|
652
|
-
echo "ā
Cleanup complete!"
|
|
653
|
-
else
|
|
654
|
-
echo ""
|
|
655
|
-
echo "ā ļø Merge failed. You can try manually: gh pr merge ${pr.number} --squash"
|
|
656
|
-
fi
|
|
637
|
+
echo "Cleaning up worktree..."
|
|
638
|
+
cd "${projectRoot}"
|
|
639
|
+
git worktree remove "${worktreePath}" --force 2>/dev/null || rm -rf "${worktreePath}"
|
|
640
|
+
git worktree prune 2>/dev/null
|
|
641
|
+
git branch -D "${branchName}" 2>/dev/null
|
|
642
|
+
echo "ā
Cleanup complete!"
|
|
657
643
|
else
|
|
658
644
|
echo ""
|
|
659
|
-
echo "
|
|
660
|
-
|
|
661
|
-
|
|
645
|
+
echo "ā ļø Merge failed. You can try manually: gh pr merge ${pr.number} --squash"
|
|
646
|
+
fi` : ` echo "View PR: gh pr view ${pr.number} --web"
|
|
647
|
+
echo "To merge: cis merge"`}
|
|
662
648
|
else
|
|
663
649
|
echo "View PR: gh pr view ${pr.number} --web"
|
|
664
650
|
fi
|
package/dist/index.js
CHANGED
|
@@ -157,17 +157,18 @@ program
|
|
|
157
157
|
program
|
|
158
158
|
.command('review [issue]')
|
|
159
159
|
.description('Review PRs with Claude and post suggestions')
|
|
160
|
-
.
|
|
160
|
+
.option('-m, --merge', 'Automatically merge PR if approved')
|
|
161
|
+
.action(async (issue, options) => {
|
|
161
162
|
if (issue) {
|
|
162
163
|
const issueNumber = parseInt(issue, 10);
|
|
163
164
|
if (isNaN(issueNumber)) {
|
|
164
165
|
console.log(chalk_1.default.red(`ā Invalid issue number: ${issue}`));
|
|
165
166
|
process.exit(1);
|
|
166
167
|
}
|
|
167
|
-
await (0, review_1.reviewCommand)(issueNumber);
|
|
168
|
+
await (0, review_1.reviewCommand)(issueNumber, { merge: options.merge });
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
170
|
-
await (0, review_1.selectReviewCommand)();
|
|
171
|
+
await (0, review_1.selectReviewCommand)({ merge: options.merge });
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
// Config command - manage settings
|