@snapcommit/cli 3.8.8 → 3.8.10
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/cursor-style.js +26 -8
- package/dist/repl/index.js +15 -0
- package/package.json +1 -1
|
@@ -321,20 +321,38 @@ async function executeCommitWithAI(intent) {
|
|
|
321
321
|
// Try to auto-resolve conflicts
|
|
322
322
|
const resolved = await tryAdvancedConflictResolution();
|
|
323
323
|
if (resolved) {
|
|
324
|
-
console.log(chalk_1.default.green('✓ Conflicts resolved'));
|
|
324
|
+
console.log(chalk_1.default.green('✓ Conflicts resolved automatically!\n'));
|
|
325
325
|
}
|
|
326
326
|
else {
|
|
327
|
-
|
|
328
|
-
console.log(chalk_1.default.
|
|
327
|
+
// Better messaging for manual resolution
|
|
328
|
+
console.log(chalk_1.default.yellow('\n⚠️ AI could not auto-resolve these conflicts\n'));
|
|
329
|
+
console.log(chalk_1.default.white('Why? These conflicts require human judgment:'));
|
|
330
|
+
console.log(chalk_1.default.gray(' • Business logic decisions (which approach is correct?)'));
|
|
331
|
+
console.log(chalk_1.default.gray(' • Architectural changes (incompatible design choices)'));
|
|
332
|
+
console.log(chalk_1.default.gray(' • Semantic conflicts (both valid, but different intent)\n'));
|
|
333
|
+
console.log(chalk_1.default.white('Conflicted files:'));
|
|
329
334
|
const conflicts = (0, child_process_1.execSync)('git diff --name-only --diff-filter=U', { encoding: 'utf-8' });
|
|
330
335
|
conflicts.split('\n').filter(f => f.trim()).forEach(file => {
|
|
331
336
|
console.log(chalk_1.default.red(` ✗ ${file}`));
|
|
332
337
|
});
|
|
333
|
-
console.log(chalk_1.default.cyan('\
|
|
334
|
-
console.log(chalk_1.default.
|
|
335
|
-
console.log(chalk_1.default.gray('
|
|
336
|
-
console.log(chalk_1.default.gray('
|
|
337
|
-
console.log(chalk_1.default.gray('
|
|
338
|
+
console.log(chalk_1.default.cyan('\n📖 How to resolve manually:\n'));
|
|
339
|
+
console.log(chalk_1.default.white(' 1. Open each file above in your editor'));
|
|
340
|
+
console.log(chalk_1.default.gray(' Look for conflict markers: ') + chalk_1.default.yellow('<<<<<<< HEAD'));
|
|
341
|
+
console.log(chalk_1.default.gray(' ') + chalk_1.default.yellow('======='));
|
|
342
|
+
console.log(chalk_1.default.gray(' ') + chalk_1.default.yellow('>>>>>>> branch'));
|
|
343
|
+
console.log('');
|
|
344
|
+
console.log(chalk_1.default.white(' 2. Choose which code to keep (or merge both)'));
|
|
345
|
+
console.log(chalk_1.default.gray(' Remove the conflict markers when done'));
|
|
346
|
+
console.log('');
|
|
347
|
+
console.log(chalk_1.default.white(' 3. After fixing, stage the resolved files:'));
|
|
348
|
+
console.log(chalk_1.default.cyan(' git add <files>'));
|
|
349
|
+
console.log('');
|
|
350
|
+
console.log(chalk_1.default.white(' 4. Continue the rebase:'));
|
|
351
|
+
console.log(chalk_1.default.cyan(' git rebase --continue'));
|
|
352
|
+
console.log('');
|
|
353
|
+
console.log(chalk_1.default.white(' 5. Then push your changes:'));
|
|
354
|
+
console.log(chalk_1.default.cyan(' snap') + chalk_1.default.gray(' and type ') + chalk_1.default.cyan('push changes\n'));
|
|
355
|
+
console.log(chalk_1.default.gray('💡 Tip: Most conflicts are simple! Just pick the better code.\n'));
|
|
338
356
|
return;
|
|
339
357
|
}
|
|
340
358
|
}
|
package/dist/repl/index.js
CHANGED
|
@@ -103,6 +103,21 @@ async function startREPL() {
|
|
|
103
103
|
rl.prompt();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
+
// Update command
|
|
107
|
+
if (trimmed === 'update' || trimmed === 'upgrade') {
|
|
108
|
+
console.log(chalk_1.default.cyan('\n📦 Updating SnapCommit...\n'));
|
|
109
|
+
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
110
|
+
try {
|
|
111
|
+
execSync('npm install -g @snapcommit/cli@latest', { stdio: 'inherit' });
|
|
112
|
+
console.log(chalk_1.default.green('\n✅ Updated successfully!'));
|
|
113
|
+
console.log(chalk_1.default.yellow('⚠️ Please exit and restart snap to use the new version.\n'));
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.log(chalk_1.default.red('\n❌ Update failed. Try manually: npm install -g @snapcommit/cli@latest\n'));
|
|
117
|
+
}
|
|
118
|
+
rl.prompt();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
106
121
|
// Multi-repo commands
|
|
107
122
|
if (trimmed === 'repos' || trimmed === 'list repos' || trimmed === 'show repos') {
|
|
108
123
|
multiRepo.listRepos();
|