@oclif/multi-stage-output 0.1.2 → 0.1.3
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.
|
@@ -90,10 +90,6 @@ type MultiStageOutputOptions<T extends Record<string, unknown>> = {
|
|
|
90
90
|
* Pass in this.jsonEnabled() from the command class to determine if JSON output is enabled.
|
|
91
91
|
*/
|
|
92
92
|
readonly jsonEnabled: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Whether to override the CI detection and force the component to render as if it's in a CI environment.
|
|
95
|
-
*/
|
|
96
|
-
readonly isInCiOverride?: boolean;
|
|
97
93
|
};
|
|
98
94
|
type StagesProps = {
|
|
99
95
|
readonly error?: Error | undefined;
|
|
@@ -114,7 +110,6 @@ export declare class MultiStageOutput<T extends Record<string, unknown>> impleme
|
|
|
114
110
|
private readonly hasElapsedTime?;
|
|
115
111
|
private readonly hasStageTime?;
|
|
116
112
|
private inkInstance;
|
|
117
|
-
private readonly isInCi;
|
|
118
113
|
private readonly postStagesBlock?;
|
|
119
114
|
private readonly preStagesBlock?;
|
|
120
115
|
private readonly stages;
|
|
@@ -123,7 +118,7 @@ export declare class MultiStageOutput<T extends Record<string, unknown>> impleme
|
|
|
123
118
|
private stopped;
|
|
124
119
|
private readonly timerUnit?;
|
|
125
120
|
private readonly title;
|
|
126
|
-
constructor({ data,
|
|
121
|
+
constructor({ data, jsonEnabled, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }: MultiStageOutputOptions<T>);
|
|
127
122
|
goto(stage: string, data?: Partial<T>): void;
|
|
128
123
|
next(data?: Partial<T>): void;
|
|
129
124
|
stop(error?: Error): void;
|
|
@@ -200,7 +200,6 @@ export class MultiStageOutput {
|
|
|
200
200
|
hasElapsedTime;
|
|
201
201
|
hasStageTime;
|
|
202
202
|
inkInstance;
|
|
203
|
-
isInCi;
|
|
204
203
|
postStagesBlock;
|
|
205
204
|
preStagesBlock;
|
|
206
205
|
stages;
|
|
@@ -209,7 +208,7 @@ export class MultiStageOutput {
|
|
|
209
208
|
stopped = false;
|
|
210
209
|
timerUnit;
|
|
211
210
|
title;
|
|
212
|
-
constructor({ data,
|
|
211
|
+
constructor({ data, jsonEnabled, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }) {
|
|
213
212
|
this.data = data;
|
|
214
213
|
this.stages = stages;
|
|
215
214
|
this.title = title;
|
|
@@ -220,10 +219,9 @@ export class MultiStageOutput {
|
|
|
220
219
|
this.timerUnit = timerUnit ?? 'ms';
|
|
221
220
|
this.stageTracker = new StageTracker(stages);
|
|
222
221
|
this.stageSpecificBlock = stageSpecificBlock;
|
|
223
|
-
this.isInCi = isInCiOverride ?? isInCi;
|
|
224
222
|
if (jsonEnabled)
|
|
225
223
|
return;
|
|
226
|
-
if (
|
|
224
|
+
if (isInCi) {
|
|
227
225
|
this.ciInstance = new CIMultiStageOutput({
|
|
228
226
|
data,
|
|
229
227
|
jsonEnabled,
|
|
@@ -265,7 +263,7 @@ export class MultiStageOutput {
|
|
|
265
263
|
return;
|
|
266
264
|
this.stopped = true;
|
|
267
265
|
this.stageTracker.refresh(this.stageTracker.current ?? this.stages[0], { hasError: Boolean(error), isStopping: true });
|
|
268
|
-
if (
|
|
266
|
+
if (isInCi) {
|
|
269
267
|
this.ciInstance?.stop(this.stageTracker);
|
|
270
268
|
return;
|
|
271
269
|
}
|
|
@@ -302,7 +300,7 @@ export class MultiStageOutput {
|
|
|
302
300
|
update(stage, data) {
|
|
303
301
|
this.data = { ...this.data, ...data };
|
|
304
302
|
this.stageTracker.refresh(stage);
|
|
305
|
-
if (
|
|
303
|
+
if (isInCi) {
|
|
306
304
|
this.ciInstance?.update(this.stageTracker, this.data);
|
|
307
305
|
}
|
|
308
306
|
else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/multi-stage-output",
|
|
3
3
|
"description": "Terminal output for oclif commands with multiple stages",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/multi-stage-output/issues",
|
|
7
7
|
"dependencies": {
|