@oclif/multi-stage-output 0.2.1 → 0.3.0
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.
|
@@ -45,6 +45,10 @@ export type MultiStageOutputOptions<T extends Record<string, unknown>> = {
|
|
|
45
45
|
* Design options to customize the output.
|
|
46
46
|
*/
|
|
47
47
|
readonly design?: Design;
|
|
48
|
+
/**
|
|
49
|
+
* Set to true when --json flag is passed to the command. This will prevent any output to the console. Defaults to false
|
|
50
|
+
*/
|
|
51
|
+
readonly jsonEnabled: boolean;
|
|
48
52
|
};
|
|
49
53
|
export declare class MultiStageOutput<T extends Record<string, unknown>> implements Disposable {
|
|
50
54
|
private ciInstance;
|
|
@@ -61,7 +65,7 @@ export declare class MultiStageOutput<T extends Record<string, unknown>> impleme
|
|
|
61
65
|
private stopped;
|
|
62
66
|
private readonly timerUnit?;
|
|
63
67
|
private readonly title?;
|
|
64
|
-
constructor({ data, design, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }: MultiStageOutputOptions<T>);
|
|
68
|
+
constructor({ data, design, jsonEnabled, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }: MultiStageOutputOptions<T>);
|
|
65
69
|
goto(stage: string, data?: Partial<T>): void;
|
|
66
70
|
next(data?: Partial<T>): void;
|
|
67
71
|
stop(error?: Error): void;
|
|
@@ -144,7 +144,7 @@ export class MultiStageOutput {
|
|
|
144
144
|
stopped = false;
|
|
145
145
|
timerUnit;
|
|
146
146
|
title;
|
|
147
|
-
constructor({ data, design, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }) {
|
|
147
|
+
constructor({ data, design, jsonEnabled = false, postStagesBlock, preStagesBlock, showElapsedTime, showStageTime, stageSpecificBlock, stages, timerUnit, title, }) {
|
|
148
148
|
this.data = data;
|
|
149
149
|
this.design = constructDesignParams(design);
|
|
150
150
|
this.stages = stages;
|
|
@@ -156,10 +156,13 @@ export class MultiStageOutput {
|
|
|
156
156
|
this.timerUnit = timerUnit ?? 'ms';
|
|
157
157
|
this.stageTracker = new StageTracker(stages);
|
|
158
158
|
this.stageSpecificBlock = stageSpecificBlock;
|
|
159
|
+
if (jsonEnabled)
|
|
160
|
+
return;
|
|
159
161
|
if (isInCi) {
|
|
160
162
|
this.ciInstance = new CIMultiStageOutput({
|
|
161
163
|
data,
|
|
162
164
|
design,
|
|
165
|
+
jsonEnabled,
|
|
163
166
|
postStagesBlock,
|
|
164
167
|
preStagesBlock,
|
|
165
168
|
showElapsedTime,
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/multi-stage-output",
|
|
3
3
|
"description": "Terminal output for oclif commands with multiple stages",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/multi-stage-output/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/core": "^4",
|
|
9
|
+
"@types/react": "^18.3.3",
|
|
9
10
|
"change-case": "^5.4.4",
|
|
10
11
|
"cli-spinners": "^2",
|
|
11
12
|
"figures": "^6.1.0",
|
|
@@ -18,7 +19,6 @@
|
|
|
18
19
|
"@types/chai": "^4.3.16",
|
|
19
20
|
"@types/mocha": "^10.0.7",
|
|
20
21
|
"@types/node": "^18",
|
|
21
|
-
"@types/react": "^18.3.3",
|
|
22
22
|
"@types/sinon": "^17.0.3",
|
|
23
23
|
"chai": "^4.5.0",
|
|
24
24
|
"commitlint": "^19",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"husky": "^9.1.3",
|
|
34
34
|
"ink-testing-library": "^4.0.0",
|
|
35
35
|
"lint-staged": "^15",
|
|
36
|
-
"mocha": "^10.7.
|
|
36
|
+
"mocha": "^10.7.3",
|
|
37
37
|
"prettier": "^3.3.3",
|
|
38
38
|
"shx": "^0.3.4",
|
|
39
39
|
"sinon": "^18",
|