@kud/ai-conventional-commit-cli 0.2.1 → 0.3.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/index.cjs +36 -7
- package/dist/index.js +36 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -570,6 +570,32 @@ var formatCommitTitle = (raw, opts) => {
|
|
|
570
570
|
var import_node_fs = require("fs");
|
|
571
571
|
var import_node_path2 = require("path");
|
|
572
572
|
var import_inquirer = __toESM(require("inquirer"), 1);
|
|
573
|
+
async function animateHeader() {
|
|
574
|
+
const text = "ai-conventional-commit";
|
|
575
|
+
if (!process.stdout.isTTY || process.env.AICC_NO_ANIMATION) {
|
|
576
|
+
console.log("\n\u250C " + import_chalk.default.bold(text));
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const palette = [
|
|
580
|
+
"#3a0d6d",
|
|
581
|
+
"#5a1ea3",
|
|
582
|
+
"#7a32d6",
|
|
583
|
+
"#9a4dff",
|
|
584
|
+
"#b267ff",
|
|
585
|
+
"#c37dff",
|
|
586
|
+
"#b267ff",
|
|
587
|
+
"#9a4dff",
|
|
588
|
+
"#7a32d6",
|
|
589
|
+
"#5a1ea3"
|
|
590
|
+
];
|
|
591
|
+
process.stdout.write("\n");
|
|
592
|
+
for (const color of palette) {
|
|
593
|
+
const frame = import_chalk.default.bold.hex(color)(text);
|
|
594
|
+
process.stdout.write("\r\u250C " + frame);
|
|
595
|
+
await new Promise((r) => setTimeout(r, 60));
|
|
596
|
+
}
|
|
597
|
+
process.stdout.write("\n");
|
|
598
|
+
}
|
|
573
599
|
async function runGenerate(config) {
|
|
574
600
|
if (!await ensureStagedChanges()) {
|
|
575
601
|
console.log("No staged changes.");
|
|
@@ -580,10 +606,12 @@ async function runGenerate(config) {
|
|
|
580
606
|
console.log("No diff content detected after staging. Aborting.");
|
|
581
607
|
return;
|
|
582
608
|
}
|
|
583
|
-
|
|
609
|
+
await animateHeader();
|
|
584
610
|
console.log("\u2502");
|
|
585
|
-
console.log(
|
|
586
|
-
|
|
611
|
+
console.log(
|
|
612
|
+
`\u25C6 ${import_chalk.default.bold(`Detected ${files.length} staged ${files.length === 1 ? "file" : "files"}:`)}`
|
|
613
|
+
);
|
|
614
|
+
for (const f of files) console.log(" \u2022 " + f.file);
|
|
587
615
|
console.log("\u2502");
|
|
588
616
|
const spinner = (0, import_ora.default)({ text: " Starting", spinner: "dots" }).start();
|
|
589
617
|
function setPhase(label) {
|
|
@@ -633,12 +661,13 @@ async function runGenerate(config) {
|
|
|
633
661
|
})
|
|
634
662
|
}));
|
|
635
663
|
const chosen = candidates[0];
|
|
636
|
-
console.log(" " + import_chalk.default.
|
|
664
|
+
console.log(" " + import_chalk.default.white(chosen.title));
|
|
637
665
|
if (chosen.body) {
|
|
638
666
|
const indent = " ";
|
|
667
|
+
console.log(indent);
|
|
639
668
|
chosen.body.split("\n").forEach((line) => {
|
|
640
669
|
if (line.trim().length === 0) console.log(indent);
|
|
641
|
-
else console.log(indent + import_chalk.default.
|
|
670
|
+
else console.log(indent + import_chalk.default.white(line));
|
|
642
671
|
});
|
|
643
672
|
}
|
|
644
673
|
console.log("\u2502");
|
|
@@ -674,8 +703,8 @@ async function selectYesNo() {
|
|
|
674
703
|
name: "choice",
|
|
675
704
|
message: " Use this commit message?",
|
|
676
705
|
choices: [
|
|
677
|
-
{ name: "
|
|
678
|
-
{ name: "
|
|
706
|
+
{ name: "Yes", value: true },
|
|
707
|
+
{ name: "No", value: false }
|
|
679
708
|
],
|
|
680
709
|
default: 0
|
|
681
710
|
}
|
package/dist/index.js
CHANGED
|
@@ -547,6 +547,32 @@ var formatCommitTitle = (raw, opts) => {
|
|
|
547
547
|
import { writeFileSync, mkdirSync, existsSync } from "fs";
|
|
548
548
|
import { join } from "path";
|
|
549
549
|
import inquirer from "inquirer";
|
|
550
|
+
async function animateHeader() {
|
|
551
|
+
const text = "ai-conventional-commit";
|
|
552
|
+
if (!process.stdout.isTTY || process.env.AICC_NO_ANIMATION) {
|
|
553
|
+
console.log("\n\u250C " + chalk.bold(text));
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
const palette = [
|
|
557
|
+
"#3a0d6d",
|
|
558
|
+
"#5a1ea3",
|
|
559
|
+
"#7a32d6",
|
|
560
|
+
"#9a4dff",
|
|
561
|
+
"#b267ff",
|
|
562
|
+
"#c37dff",
|
|
563
|
+
"#b267ff",
|
|
564
|
+
"#9a4dff",
|
|
565
|
+
"#7a32d6",
|
|
566
|
+
"#5a1ea3"
|
|
567
|
+
];
|
|
568
|
+
process.stdout.write("\n");
|
|
569
|
+
for (const color of palette) {
|
|
570
|
+
const frame = chalk.bold.hex(color)(text);
|
|
571
|
+
process.stdout.write("\r\u250C " + frame);
|
|
572
|
+
await new Promise((r) => setTimeout(r, 60));
|
|
573
|
+
}
|
|
574
|
+
process.stdout.write("\n");
|
|
575
|
+
}
|
|
550
576
|
async function runGenerate(config) {
|
|
551
577
|
if (!await ensureStagedChanges()) {
|
|
552
578
|
console.log("No staged changes.");
|
|
@@ -557,10 +583,12 @@ async function runGenerate(config) {
|
|
|
557
583
|
console.log("No diff content detected after staging. Aborting.");
|
|
558
584
|
return;
|
|
559
585
|
}
|
|
560
|
-
|
|
586
|
+
await animateHeader();
|
|
561
587
|
console.log("\u2502");
|
|
562
|
-
console.log(
|
|
563
|
-
|
|
588
|
+
console.log(
|
|
589
|
+
`\u25C6 ${chalk.bold(`Detected ${files.length} staged ${files.length === 1 ? "file" : "files"}:`)}`
|
|
590
|
+
);
|
|
591
|
+
for (const f of files) console.log(" \u2022 " + f.file);
|
|
564
592
|
console.log("\u2502");
|
|
565
593
|
const spinner = ora({ text: " Starting", spinner: "dots" }).start();
|
|
566
594
|
function setPhase(label) {
|
|
@@ -610,12 +638,13 @@ async function runGenerate(config) {
|
|
|
610
638
|
})
|
|
611
639
|
}));
|
|
612
640
|
const chosen = candidates[0];
|
|
613
|
-
console.log(" " + chalk.
|
|
641
|
+
console.log(" " + chalk.white(chosen.title));
|
|
614
642
|
if (chosen.body) {
|
|
615
643
|
const indent = " ";
|
|
644
|
+
console.log(indent);
|
|
616
645
|
chosen.body.split("\n").forEach((line) => {
|
|
617
646
|
if (line.trim().length === 0) console.log(indent);
|
|
618
|
-
else console.log(indent + chalk.
|
|
647
|
+
else console.log(indent + chalk.white(line));
|
|
619
648
|
});
|
|
620
649
|
}
|
|
621
650
|
console.log("\u2502");
|
|
@@ -651,8 +680,8 @@ async function selectYesNo() {
|
|
|
651
680
|
name: "choice",
|
|
652
681
|
message: " Use this commit message?",
|
|
653
682
|
choices: [
|
|
654
|
-
{ name: "
|
|
655
|
-
{ name: "
|
|
683
|
+
{ name: "Yes", value: true },
|
|
684
|
+
{ name: "No", value: false }
|
|
656
685
|
],
|
|
657
686
|
default: 0
|
|
658
687
|
}
|
package/package.json
CHANGED