@kud/ai-conventional-commit-cli 0.12.10 → 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 +21 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -240,16 +240,20 @@ 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;
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
+ }
249
253
  if (f.deleted) {
250
- name += " " + chalk.red("[deleted]");
254
+ line += " " + chalk.red("[deleted]");
251
255
  }
252
- borderLine(name.padEnd(maxName) + " | " + counts.padEnd(12) + " " + bar);
256
+ borderLine(line);
253
257
  });
254
258
  borderLine(
255
259
  chalk.dim(
@@ -422,16 +426,20 @@ async function runSplit(config, desired) {
422
426
  totalAdd += add;
423
427
  totalDel += del;
424
428
  const delta = add + del;
425
- const barLen = Math.max(1, Math.round(delta / maxDelta * BAR_WIDTH));
426
- const addPortion = Math.min(barLen, Math.round(barLen * (add / (delta || 1))));
427
- const delPortion = barLen - addPortion;
428
- const bar = chalk2.green("+".repeat(addPortion)) + chalk2.red("-".repeat(delPortion));
429
429
  const counts = chalk2.green("+" + add) + " " + chalk2.red("-" + del);
430
430
  let name = f.file.length > maxName ? f.file.slice(0, maxName - 1) + "\u2026" : f.file;
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
+ }
431
439
  if (f.deleted) {
432
- name += " " + chalk2.red("[deleted]");
440
+ line += " " + chalk2.red("[deleted]");
433
441
  }
434
- borderLine(name.padEnd(maxName) + " | " + counts.padEnd(12) + " " + bar);
442
+ borderLine(line);
435
443
  });
436
444
  borderLine(
437
445
  chalk2.dim(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/ai-conventional-commit-cli",
3
- "version": "0.12.10",
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": {