cskit-cli 1.0.31 → 1.0.34
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/package.json +1 -1
- package/src/commands/init.js +49 -22
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -107,9 +107,9 @@ class Timeline {
|
|
|
107
107
|
this.lastLineCount = 0;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// Resume after prompt - no separator needed, step headers are enough
|
|
111
111
|
resume() {
|
|
112
|
-
console.log(
|
|
112
|
+
console.log('');
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
buildStatusLine(stepIndex) {
|
|
@@ -551,27 +551,46 @@ async function initCommand(options) {
|
|
|
551
551
|
// Step 5: Confirm changes
|
|
552
552
|
timeline.start(4);
|
|
553
553
|
|
|
554
|
+
// Tree connector symbols
|
|
555
|
+
const pipe = chalk.dim('│');
|
|
556
|
+
const branch = chalk.dim('├──');
|
|
557
|
+
const corner = chalk.dim('└──');
|
|
558
|
+
|
|
554
559
|
// Show files that will be changed
|
|
555
560
|
if (changes.update.length > 0) {
|
|
556
|
-
console.log(
|
|
557
|
-
|
|
558
|
-
|
|
561
|
+
console.log(`\n ${pipe}`);
|
|
562
|
+
console.log(` ${branch} ${chalk.yellow('Files to be updated (will overwrite):')}`);
|
|
563
|
+
|
|
564
|
+
const showFiles = changes.update.slice(0, 15);
|
|
565
|
+
const hasMore = changes.update.length > 15;
|
|
566
|
+
|
|
567
|
+
for (let i = 0; i < showFiles.length; i++) {
|
|
568
|
+
const isLast = i === showFiles.length - 1 && !hasMore;
|
|
569
|
+
const prefix = isLast ? corner : branch;
|
|
570
|
+
console.log(` ${pipe} ${prefix} ${chalk.yellow('!')} ${showFiles[i].target}`);
|
|
559
571
|
}
|
|
560
|
-
if (
|
|
561
|
-
console.log(chalk.dim(
|
|
572
|
+
if (hasMore) {
|
|
573
|
+
console.log(` ${pipe} ${corner} ${chalk.dim(`... and ${changes.update.length - 15} more`)}`);
|
|
562
574
|
}
|
|
563
|
-
console.log(
|
|
575
|
+
console.log(` ${pipe}`);
|
|
564
576
|
}
|
|
565
577
|
|
|
566
578
|
if (changes.new.length > 0) {
|
|
567
|
-
console.log(
|
|
568
|
-
|
|
569
|
-
|
|
579
|
+
console.log(`\n ${pipe}`);
|
|
580
|
+
console.log(` ${branch} ${chalk.green('New files to be created:')}`);
|
|
581
|
+
|
|
582
|
+
const showFiles = changes.new.slice(0, 10);
|
|
583
|
+
const hasMore = changes.new.length > 10;
|
|
584
|
+
|
|
585
|
+
for (let i = 0; i < showFiles.length; i++) {
|
|
586
|
+
const isLast = i === showFiles.length - 1 && !hasMore;
|
|
587
|
+
const prefix = isLast ? corner : branch;
|
|
588
|
+
console.log(` ${pipe} ${prefix} ${chalk.green('+')} ${showFiles[i].target}`);
|
|
570
589
|
}
|
|
571
|
-
if (
|
|
572
|
-
console.log(chalk.dim(
|
|
590
|
+
if (hasMore) {
|
|
591
|
+
console.log(` ${pipe} ${corner} ${chalk.dim(`... and ${changes.new.length - 10} more`)}`);
|
|
573
592
|
}
|
|
574
|
-
console.log(
|
|
593
|
+
console.log(` ${pipe}`);
|
|
575
594
|
}
|
|
576
595
|
|
|
577
596
|
// Confirm
|
|
@@ -694,19 +713,27 @@ async function initCommand(options) {
|
|
|
694
713
|
return;
|
|
695
714
|
}
|
|
696
715
|
|
|
697
|
-
// Show what needs to be installed/updated
|
|
698
|
-
console.log(
|
|
699
|
-
|
|
716
|
+
// Show what needs to be installed/updated with tree connector
|
|
717
|
+
console.log(`\n ${pipe}`);
|
|
718
|
+
console.log(` ${branch} ${chalk.cyan('Packages to install/update:')}`);
|
|
719
|
+
|
|
720
|
+
const showPkgs = allToInstall.slice(0, 10);
|
|
721
|
+
const hasMore = allToInstall.length > 10;
|
|
722
|
+
|
|
723
|
+
for (let i = 0; i < showPkgs.length; i++) {
|
|
724
|
+
const pkg = showPkgs[i];
|
|
725
|
+
const isLast = i === showPkgs.length - 1 && !hasMore;
|
|
726
|
+
const prefix = isLast ? corner : branch;
|
|
700
727
|
if (pkg.current) {
|
|
701
|
-
console.log(`
|
|
728
|
+
console.log(` ${pipe} ${prefix} ${chalk.blue('~')} ${pkg.name}: ${pkg.current} → ${pkg.required}`);
|
|
702
729
|
} else {
|
|
703
|
-
console.log(`
|
|
730
|
+
console.log(` ${pipe} ${prefix} ${chalk.green('+')} ${pkg.name}: ${pkg.required || 'latest'}`);
|
|
704
731
|
}
|
|
705
732
|
}
|
|
706
|
-
if (
|
|
707
|
-
console.log(chalk.dim(
|
|
733
|
+
if (hasMore) {
|
|
734
|
+
console.log(` ${pipe} ${corner} ${chalk.dim(`... and ${allToInstall.length - 10} more`)}`);
|
|
708
735
|
}
|
|
709
|
-
console.log(
|
|
736
|
+
console.log(` ${pipe}`);
|
|
710
737
|
|
|
711
738
|
timeline.pause();
|
|
712
739
|
const { confirmPkgs } = await inquirer.prompt([{
|