cskit-cli 1.0.30 → 1.0.33

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.30",
3
+ "version": "1.0.33",
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,7 +66,7 @@ class Timeline {
66
66
  this.steps = [];
67
67
  this.currentStep = -1;
68
68
  this.lastLineCount = 0;
69
- this.inPlaceEnabled = true; // Disable after any prompt
69
+ this.paused = false; // After prompt, stop full re-renders
70
70
  }
71
71
 
72
72
  addStep(name) {
@@ -101,38 +101,38 @@ class Timeline {
101
101
  this.steps[stepIndex].children.push({ text, type });
102
102
  }
103
103
 
104
- // Call before any prompt - disables in-place updates for rest of session
104
+ // Call before any prompt - stops full re-renders
105
105
  pause() {
106
- this.inPlaceEnabled = false;
106
+ this.paused = true;
107
107
  this.lastLineCount = 0;
108
108
  }
109
109
 
110
- // Re-render after prompt (just prints fresh, no in-place)
110
+ // Resume after prompt - no separator needed, step headers are enough
111
111
  resume() {
112
- console.log(chalk.dim('\n ─'.repeat(20) + '\n'));
113
- this.renderFresh();
112
+ console.log('');
114
113
  }
115
114
 
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('');
115
+ buildStatusLine(stepIndex) {
116
+ const step = this.steps[stepIndex];
117
+ const symbol = SYMBOLS[step.status];
118
+ const num = chalk.dim(`${stepIndex + 1}.`);
119
+ const name = step.status === 'active' ? chalk.cyan(step.name) : step.name;
120
+ const msg = step.message ? chalk.dim(` (${step.message})`) : '';
121
+ return ` ${symbol} ${num} ${name}${msg}`;
124
122
  }
125
123
 
126
- buildLines() {
124
+ render() {
125
+ // After pause, only print current step status (no full timeline)
126
+ if (this.paused) {
127
+ console.log(this.buildStatusLine(this.currentStep));
128
+ return;
129
+ }
130
+
127
131
  const lines = [];
128
132
  for (let i = 0; i < this.steps.length; i++) {
129
- const step = this.steps[i];
130
- const symbol = SYMBOLS[step.status];
131
- const num = chalk.dim(`${i + 1}.`);
132
- const name = step.status === 'active' ? chalk.cyan(step.name) : step.name;
133
- const msg = step.message ? chalk.dim(` (${step.message})`) : '';
134
- lines.push(` ${symbol} ${num} ${name}${msg}`);
133
+ lines.push(this.buildStatusLine(i));
135
134
 
135
+ const step = this.steps[i];
136
136
  // Children for non-pending steps
137
137
  if (step.status !== 'pending') {
138
138
  for (let j = 0; j < step.children.length; j++) {
@@ -149,31 +149,24 @@ class Timeline {
149
149
  }
150
150
  }
151
151
  }
152
- return lines;
153
- }
154
-
155
- render() {
156
- const lines = this.buildLines();
157
152
 
158
- // In-place update only if enabled and have previous output
159
- if (this.inPlaceEnabled && this.lastLineCount > 0) {
153
+ // In-place update if have previous output
154
+ if (this.lastLineCount > 0) {
160
155
  process.stdout.write(`\x1b[${this.lastLineCount}A`);
161
156
  for (let i = 0; i < this.lastLineCount; i++) {
162
157
  process.stdout.write('\x1b[2K\n');
163
158
  }
164
159
  process.stdout.write(`\x1b[${this.lastLineCount}A`);
165
- } else if (this.lastLineCount === 0) {
166
- // First render
160
+ } else {
167
161
  console.log('');
168
162
  }
169
163
 
170
- // If in-place disabled, just print below (no cursor movement)
171
164
  for (const line of lines) {
172
165
  console.log(line);
173
166
  }
174
167
  console.log('');
175
168
 
176
- this.lastLineCount = this.inPlaceEnabled ? lines.length + 1 : 0;
169
+ this.lastLineCount = lines.length + 1;
177
170
  }
178
171
  }
179
172