claude-issue-solver 1.6.0 → 1.6.2
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/clean.js +26 -5
- package/dist/utils/helpers.js +8 -3
- package/package.json +1 -1
package/dist/commands/clean.js
CHANGED
|
@@ -48,7 +48,7 @@ const child_process_1 = require("child_process");
|
|
|
48
48
|
const github_1 = require("../utils/github");
|
|
49
49
|
const git_1 = require("../utils/git");
|
|
50
50
|
const helpers_1 = require("../utils/helpers");
|
|
51
|
-
function
|
|
51
|
+
function closeWindowsWithPath(folderPath) {
|
|
52
52
|
if (os.platform() !== 'darwin')
|
|
53
53
|
return;
|
|
54
54
|
const folderName = path.basename(folderPath);
|
|
@@ -87,6 +87,27 @@ function closeTerminalWithPath(folderPath) {
|
|
|
87
87
|
catch {
|
|
88
88
|
// Terminal not running or no matching windows
|
|
89
89
|
}
|
|
90
|
+
// Try to close VS Code windows with this path
|
|
91
|
+
try {
|
|
92
|
+
(0, child_process_1.execSync)(`osascript -e '
|
|
93
|
+
tell application "System Events"
|
|
94
|
+
if exists process "Code" then
|
|
95
|
+
tell process "Code"
|
|
96
|
+
set windowList to every window
|
|
97
|
+
repeat with w in windowList
|
|
98
|
+
set windowName to name of w
|
|
99
|
+
if windowName contains "${folderName}" then
|
|
100
|
+
perform action "AXPress" of (first button of w whose subrole is "AXCloseButton")
|
|
101
|
+
end if
|
|
102
|
+
end repeat
|
|
103
|
+
end tell
|
|
104
|
+
end if
|
|
105
|
+
end tell
|
|
106
|
+
'`, { stdio: 'pipe' });
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// VS Code not running or no matching windows
|
|
110
|
+
}
|
|
90
111
|
}
|
|
91
112
|
function getIssueWorktrees() {
|
|
92
113
|
const projectRoot = (0, git_1.getProjectRoot)();
|
|
@@ -148,8 +169,8 @@ async function cleanAllCommand() {
|
|
|
148
169
|
for (const wt of worktrees) {
|
|
149
170
|
const spinner = (0, ora_1.default)(`Cleaning issue #${wt.issueNumber}...`).start();
|
|
150
171
|
try {
|
|
151
|
-
// Close terminal windows for this worktree
|
|
152
|
-
|
|
172
|
+
// Close terminal and VS Code windows for this worktree
|
|
173
|
+
closeWindowsWithPath(wt.path);
|
|
153
174
|
// Remove worktree
|
|
154
175
|
if (fs.existsSync(wt.path)) {
|
|
155
176
|
(0, child_process_1.execSync)(`git worktree remove "${wt.path}" --force`, {
|
|
@@ -208,8 +229,8 @@ async function cleanCommand(issueNumber) {
|
|
|
208
229
|
console.log(chalk_1.default.dim('Cancelled.'));
|
|
209
230
|
return;
|
|
210
231
|
}
|
|
211
|
-
// Close terminal windows for this worktree
|
|
212
|
-
|
|
232
|
+
// Close terminal and VS Code windows for this worktree
|
|
233
|
+
closeWindowsWithPath(worktreePath);
|
|
213
234
|
// Remove worktree
|
|
214
235
|
if (fs.existsSync(worktreePath)) {
|
|
215
236
|
const worktreeSpinner = (0, ora_1.default)('Removing worktree...').start();
|
package/dist/utils/helpers.js
CHANGED
|
@@ -43,12 +43,17 @@ const fs = __importStar(require("fs"));
|
|
|
43
43
|
const path = __importStar(require("path"));
|
|
44
44
|
const os = __importStar(require("os"));
|
|
45
45
|
function slugify(text) {
|
|
46
|
-
|
|
46
|
+
// Remove common prefixes in brackets like [FAQ], [Bug], etc.
|
|
47
|
+
const withoutBrackets = text.replace(/^\[.*?\]\s*/, '');
|
|
48
|
+
const slug = withoutBrackets
|
|
47
49
|
.toLowerCase()
|
|
48
50
|
.replace(/[^a-z0-9]/g, '-')
|
|
49
51
|
.replace(/-+/g, '-')
|
|
50
|
-
.replace(/^-|-$/g, '')
|
|
51
|
-
|
|
52
|
+
.replace(/^-|-$/g, '');
|
|
53
|
+
// Remove duplicate consecutive words (e.g., "faq-faq" -> "faq")
|
|
54
|
+
const words = slug.split('-');
|
|
55
|
+
const deduped = words.filter((word, i) => word !== words[i - 1]);
|
|
56
|
+
return deduped.join('-').slice(0, 30);
|
|
52
57
|
}
|
|
53
58
|
function checkRequirements() {
|
|
54
59
|
const missing = [];
|