cskit-cli 1.0.34 → 1.0.36

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cskit-cli",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Content Suite Kit CLI - Download and manage CSK skills from private repository",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -457,15 +457,14 @@ async function initCommand(options) {
457
457
  process.exit(1);
458
458
  }
459
459
 
460
- timeline.complete(0, 'OK');
461
-
462
460
  // Check existing installation
463
461
  const manifest = loadManifest(projectDir);
464
462
  const isUpdate = manifest.version !== null;
465
463
 
466
464
  if (isUpdate) {
467
- console.log(chalk.dim(` Current: ${manifest.version} (${formatDate(manifest.installedAt)})\n`));
465
+ timeline.addChild(0, `Current: ${manifest.version}`, 'info');
468
466
  }
467
+ timeline.complete(0, 'OK');
469
468
 
470
469
  // Get available versions
471
470
  const releases = await getAllReleases(token);
@@ -483,6 +482,7 @@ async function initCommand(options) {
483
482
  choices.push({ name: chalk.dim('main branch (dev)'), value: 'main' });
484
483
 
485
484
  timeline.pause(); // Pause before prompt
485
+ console.log(''); // One blank line before prompt
486
486
  const answer = await inquirer.prompt([{
487
487
  type: 'list',
488
488
  name: 'version',
@@ -496,7 +496,7 @@ async function initCommand(options) {
496
496
  selectedVersion = latest.tag;
497
497
  }
498
498
 
499
- console.log(chalk.dim(` Installing: ${selectedVersion}\n`));
499
+ console.log(` ${chalk.dim('Installing:')} ${selectedVersion}\n`);
500
500
 
501
501
  // Step 2: Download zip
502
502
  timeline.start(1);
@@ -26,6 +26,16 @@ function compareVersions(a, b) {
26
26
  return 0;
27
27
  }
28
28
 
29
+ /**
30
+ * Pad text to fixed width (ignoring ANSI codes)
31
+ */
32
+ function padText(text, width) {
33
+ // Strip ANSI codes to get visible length
34
+ const visible = text.replace(/\x1b\[[0-9;]*m/g, '');
35
+ const padding = Math.max(0, width - visible.length);
36
+ return text + ' '.repeat(padding);
37
+ }
38
+
29
39
  /**
30
40
  * Main update command handler
31
41
  */
@@ -33,10 +43,12 @@ async function updateCommand() {
33
43
  console.log(chalk.cyan('\n CSK CLI - Update\n'));
34
44
 
35
45
  const currentVersion = pkg.version;
46
+ const boxWidth = 37; // Inner width between │ and │
36
47
 
37
48
  // Show version info box
38
- console.log(chalk.dim(' ┌─────────────────────────────────────┐'));
39
- console.log(chalk.dim(' │') + ` Current version: ${chalk.yellow('v' + currentVersion)}`.padEnd(46) + chalk.dim('│'));
49
+ console.log(chalk.dim(' ' + '─'.repeat(boxWidth) + '┐'));
50
+ const currentLine = ` Current: ${chalk.yellow('v' + currentVersion)}`;
51
+ console.log(chalk.dim(' │') + padText(currentLine, boxWidth) + chalk.dim('│'));
40
52
 
41
53
  const spinner = ora({ text: 'Checking npm registry...', indent: 2 }).start();
42
54
 
@@ -48,8 +60,9 @@ async function updateCommand() {
48
60
  }).trim();
49
61
 
50
62
  spinner.stop();
51
- console.log(chalk.dim(' │') + ` Latest version: ${chalk.green('v' + latestVersion)}`.padEnd(46) + chalk.dim('│'));
52
- console.log(chalk.dim(' └─────────────────────────────────────┘\n'));
63
+ const latestLine = ` Latest: ${chalk.green('v' + latestVersion)}`;
64
+ console.log(chalk.dim(' ') + padText(latestLine, boxWidth) + chalk.dim('│'));
65
+ console.log(chalk.dim(' └' + '─'.repeat(boxWidth) + '┘\n'));
53
66
 
54
67
  const comparison = compareVersions(currentVersion, latestVersion);
55
68
 
@@ -77,15 +90,17 @@ async function updateCommand() {
77
90
 
78
91
  // Show summary
79
92
  console.log('');
80
- console.log(chalk.dim(' ┌─────────────────────────────────────┐'));
81
- console.log(chalk.dim(' │') + ` ${chalk.red('v' + currentVersion)} → ${chalk.green('v' + latestVersion)}`.padEnd(55) + chalk.dim('│'));
82
- console.log(chalk.dim(' └─────────────────────────────────────┘'));
93
+ console.log(chalk.dim(' ' + '─'.repeat(boxWidth) + '┐'));
94
+ const summaryLine = ` ${chalk.red('v' + currentVersion)} → ${chalk.green('v' + latestVersion)}`;
95
+ console.log(chalk.dim(' ') + padText(summaryLine, boxWidth) + chalk.dim('│'));
96
+ console.log(chalk.dim(' └' + '─'.repeat(boxWidth) + '┘'));
83
97
  console.log(chalk.dim('\n Run `cskit init` to update project files.\n'));
84
98
 
85
99
  } catch (error) {
86
100
  spinner.stop();
87
- console.log(chalk.dim(' │') + ` Latest version: ${chalk.red('(unavailable)')}`.padEnd(46) + chalk.dim('│'));
88
- console.log(chalk.dim(' └─────────────────────────────────────┘\n'));
101
+ const errorLine = ` Latest: ${chalk.red('(unavailable)')}`;
102
+ console.log(chalk.dim(' ') + padText(errorLine, boxWidth) + chalk.dim('│'));
103
+ console.log(chalk.dim(' └' + '─'.repeat(boxWidth) + '┘\n'));
89
104
 
90
105
  if (error.message.includes('npm view') || error.message.includes('404')) {
91
106
  console.log(chalk.red(' ✗ Could not check for updates'));