cskit-cli 1.0.29 → 1.0.30

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.29",
3
+ "version": "1.0.30",
4
4
  "description": "Content Suite Kit CLI - Download and manage CSK skills from private repository",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -66,8 +66,7 @@ class Timeline {
66
66
  this.steps = [];
67
67
  this.currentStep = -1;
68
68
  this.lastLineCount = 0;
69
- this.isFirstRender = true;
70
- this.isPaused = false;
69
+ this.inPlaceEnabled = true; // Disable after any prompt
71
70
  }
72
71
 
73
72
  addStep(name) {
@@ -102,44 +101,39 @@ class Timeline {
102
101
  this.steps[stepIndex].children.push({ text, type });
103
102
  }
104
103
 
105
- // Call before any external output (prompts, logs, etc.)
104
+ // Call before any prompt - disables in-place updates for rest of session
106
105
  pause() {
107
- // Don't update in-place after external output - just continue below
106
+ this.inPlaceEnabled = false;
108
107
  this.lastLineCount = 0;
109
- this.isPaused = true;
110
108
  }
111
109
 
112
- // Re-render timeline after external output
110
+ // Re-render after prompt (just prints fresh, no in-place)
113
111
  resume() {
114
- if (this.isPaused) {
115
- // Print separator and continue fresh (no in-place update)
116
- console.log(chalk.dim(' ─'.repeat(20)));
117
- this.isPaused = false;
118
- }
119
- this.isFirstRender = true;
120
- this.render();
112
+ console.log(chalk.dim('\n ─'.repeat(20) + '\n'));
113
+ this.renderFresh();
121
114
  }
122
115
 
123
- // Print final summary (no in-place update)
124
- printSummary() {
125
- this.lastLineCount = 0; // Disable in-place update
126
- this.render();
116
+ // Print without in-place update
117
+ renderFresh() {
118
+ const lines = this.buildLines();
119
+ console.log('');
120
+ for (const line of lines) {
121
+ console.log(line);
122
+ }
123
+ console.log('');
127
124
  }
128
125
 
129
- render() {
130
- // Build output lines
126
+ buildLines() {
131
127
  const lines = [];
132
-
133
128
  for (let i = 0; i < this.steps.length; i++) {
134
129
  const step = this.steps[i];
135
130
  const symbol = SYMBOLS[step.status];
136
131
  const num = chalk.dim(`${i + 1}.`);
137
132
  const name = step.status === 'active' ? chalk.cyan(step.name) : step.name;
138
133
  const msg = step.message ? chalk.dim(` (${step.message})`) : '';
139
-
140
134
  lines.push(` ${symbol} ${num} ${name}${msg}`);
141
135
 
142
- // Show children only for active or done steps (not pending)
136
+ // Children for non-pending steps
143
137
  if (step.status !== 'pending') {
144
138
  for (let j = 0; j < step.children.length; j++) {
145
139
  const child = step.children[j];
@@ -149,35 +143,37 @@ class Timeline {
149
143
  child.type === 'update' ? chalk.blue('~') :
150
144
  child.type === 'skip' ? chalk.yellow('!') :
151
145
  child.type === 'delete' ? chalk.red('-') :
146
+ child.type === 'info' ? chalk.cyan('i') :
152
147
  chalk.dim('•');
153
148
  lines.push(` ${SYMBOLS.indent}${branch} ${prefix} ${child.text}`);
154
149
  }
155
150
  }
156
151
  }
152
+ return lines;
153
+ }
157
154
 
158
- // Clear previous output (move cursor up and clear lines)
159
- // Only do in-place update when not paused and have previous output
160
- if (!this.isFirstRender && this.lastLineCount > 0 && !this.isPaused) {
161
- // Move cursor up and clear each line
155
+ render() {
156
+ const lines = this.buildLines();
157
+
158
+ // In-place update only if enabled and have previous output
159
+ if (this.inPlaceEnabled && this.lastLineCount > 0) {
162
160
  process.stdout.write(`\x1b[${this.lastLineCount}A`);
163
161
  for (let i = 0; i < this.lastLineCount; i++) {
164
- process.stdout.write('\x1b[2K\n'); // Clear line
162
+ process.stdout.write('\x1b[2K\n');
165
163
  }
166
- process.stdout.write(`\x1b[${this.lastLineCount}A`); // Move back up
167
- }
168
-
169
- // Print new output
170
- if (this.isFirstRender) {
171
- console.log(''); // Initial blank line
172
- this.isFirstRender = false;
164
+ process.stdout.write(`\x1b[${this.lastLineCount}A`);
165
+ } else if (this.lastLineCount === 0) {
166
+ // First render
167
+ console.log('');
173
168
  }
174
169
 
170
+ // If in-place disabled, just print below (no cursor movement)
175
171
  for (const line of lines) {
176
172
  console.log(line);
177
173
  }
178
- console.log(''); // Trailing blank line
174
+ console.log('');
179
175
 
180
- this.lastLineCount = lines.length + 1; // +1 for trailing blank
176
+ this.lastLineCount = this.inPlaceEnabled ? lines.length + 1 : 0;
181
177
  }
182
178
  }
183
179