@kud/ai-conventional-commit-cli 0.12.11 → 0.12.12

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -240,13 +240,16 @@ async function runGenerate(config) {
240
240
  totalAdd += add;
241
241
  totalDel += del;
242
242
  const delta = add + del;
243
- const barLen = Math.max(1, Math.round(delta / maxDelta * BAR_WIDTH));
244
- const addPortion = Math.min(barLen, Math.round(barLen * (add / (delta || 1))));
245
- const delPortion = barLen - addPortion;
246
- const bar = chalk.green("+".repeat(addPortion)) + chalk.red("-".repeat(delPortion));
247
243
  const counts = chalk.green("+" + add) + " " + chalk.red("-" + del);
248
- let name = f.file.length > maxName ? f.file.slice(0, maxName - 1) + "\u2026" : f.file;
249
- let line = name.padEnd(maxName) + " | " + counts.padEnd(12) + " " + bar;
244
+ const name = f.file.length > maxName ? f.file.slice(0, maxName - 1) + "\u2026" : f.file;
245
+ let line = name.padEnd(maxName) + " | " + counts.padEnd(12);
246
+ if (delta > 0) {
247
+ const barLen = Math.max(1, Math.round(delta / maxDelta * BAR_WIDTH));
248
+ const addPortion = Math.min(barLen, Math.round(barLen * (add / (delta || 1))));
249
+ const delPortion = barLen - addPortion;
250
+ const bar = chalk.green("+".repeat(addPortion)) + chalk.red("-".repeat(delPortion));
251
+ line += " " + bar;
252
+ }
250
253
  if (f.deleted) {
251
254
  line += " " + chalk.red("[deleted]");
252
255
  }
@@ -423,13 +426,16 @@ async function runSplit(config, desired) {
423
426
  totalAdd += add;
424
427
  totalDel += del;
425
428
  const delta = add + del;
426
- const barLen = Math.max(1, Math.round(delta / maxDelta * BAR_WIDTH));
427
- const addPortion = Math.min(barLen, Math.round(barLen * (add / (delta || 1))));
428
- const delPortion = barLen - addPortion;
429
- const bar = chalk2.green("+".repeat(addPortion)) + chalk2.red("-".repeat(delPortion));
430
429
  const counts = chalk2.green("+" + add) + " " + chalk2.red("-" + del);
431
430
  let name = f.file.length > maxName ? f.file.slice(0, maxName - 1) + "\u2026" : f.file;
432
- let line = name.padEnd(maxName) + " | " + counts.padEnd(12) + " " + bar;
431
+ let line = name.padEnd(maxName) + " | " + counts.padEnd(12);
432
+ if (delta > 0) {
433
+ const barLen = Math.max(1, Math.round(delta / maxDelta * BAR_WIDTH));
434
+ const addPortion = Math.min(barLen, Math.round(barLen * (add / (delta || 1))));
435
+ const delPortion = barLen - addPortion;
436
+ const bar = chalk2.green("+".repeat(addPortion)) + chalk2.red("-".repeat(delPortion));
437
+ line += " " + bar;
438
+ }
433
439
  if (f.deleted) {
434
440
  line += " " + chalk2.red("[deleted]");
435
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/ai-conventional-commit-cli",
3
- "version": "0.12.11",
3
+ "version": "0.12.12",
4
4
  "type": "module",
5
5
  "description": "Opinionated, style-aware AI assistant for crafting and splitting git commits (opencode-based, provider-agnostic).",
6
6
  "bin": {