@oclif/multi-stage-output 0.5.6 → 0.5.9
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/lib/components/stages.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getLogger } from '@oclif/core/logger';
|
|
2
|
-
import { capitalCase } from 'change-case';
|
|
3
2
|
import { Box, Text, useStdout } from 'ink';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import wrapAnsi from 'wrap-ansi';
|
|
@@ -65,19 +64,19 @@ function CompactStage({ design, direction = 'row', error, stage, stageSpecificBl
|
|
|
65
64
|
if (status !== 'current')
|
|
66
65
|
return false;
|
|
67
66
|
return (React.createElement(Box, { flexDirection: direction },
|
|
68
|
-
React.createElement(SpinnerOrError, { error: error, label: `[${stageTracker.indexOf(stage) + 1}/${stageTracker.size}] ${
|
|
67
|
+
React.createElement(SpinnerOrError, { error: error, label: `[${stageTracker.indexOf(stage) + 1}/${stageTracker.size}] ${stage}`, type: design.spinners.stage, design: design }),
|
|
69
68
|
stageSpecificBlock && stageSpecificBlock.length > 0 && (React.createElement(Box, { flexDirection: "column" },
|
|
70
69
|
React.createElement(StageInfos, { design: design, error: error, keyValuePairs: stageSpecificBlock, stage: stage })))));
|
|
71
70
|
}
|
|
72
71
|
function Stage({ design, error, stage, status, }) {
|
|
73
72
|
return (React.createElement(Box, { flexWrap: "wrap" },
|
|
74
|
-
(status === 'current' || status === 'failed') && (React.createElement(SpinnerOrError, { error: error, label:
|
|
73
|
+
(status === 'current' || status === 'failed') && (React.createElement(SpinnerOrError, { error: error, label: stage, type: design.spinners.stage, design: design })),
|
|
75
74
|
status === 'skipped' && (React.createElement(Icon, { icon: design.icons.skipped },
|
|
76
75
|
React.createElement(Text, { color: "dim" },
|
|
77
|
-
|
|
76
|
+
stage,
|
|
78
77
|
" - Skipped"))),
|
|
79
78
|
status !== 'skipped' && status !== 'failed' && status !== 'current' && (React.createElement(Icon, { icon: design.icons[status] },
|
|
80
|
-
React.createElement(Text, null,
|
|
79
|
+
React.createElement(Text, null, stage)))));
|
|
81
80
|
}
|
|
82
81
|
function StageEntries({ compactionLevel, design, error, hasStageTime, stageSpecificBlock, stageTracker, timerUnit, }) {
|
|
83
82
|
return (React.createElement(React.Fragment, null, [...stageTracker.entries()].map(([stage, status]) => (React.createElement(Box, { key: stage, flexDirection: "column" },
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ux } from '@oclif/core/ux';
|
|
2
|
-
import { capitalCase } from 'change-case';
|
|
3
2
|
import { render } from 'ink';
|
|
4
3
|
import { env } from 'node:process';
|
|
5
4
|
import React from 'react';
|
|
@@ -63,7 +62,7 @@ class CIMultiStageOutput {
|
|
|
63
62
|
ux.stdout(`───── ${title} ─────`);
|
|
64
63
|
ux.stdout('Stages:');
|
|
65
64
|
for (const stage of this.stages) {
|
|
66
|
-
ux.stdout(`${this.stages.indexOf(stage) + 1}. ${
|
|
65
|
+
ux.stdout(`${this.stages.indexOf(stage) + 1}. ${stage}`);
|
|
67
66
|
}
|
|
68
67
|
ux.stdout();
|
|
69
68
|
if (this.hasElapsedTime) {
|
|
@@ -99,7 +98,7 @@ class CIMultiStageOutput {
|
|
|
99
98
|
this.lastUpdateTime = Date.now();
|
|
100
99
|
if (!this.startTimes.has(stage))
|
|
101
100
|
this.startTimes.set(stage, Date.now());
|
|
102
|
-
ux.stdout(`${this.design.icons.current.figure} ${
|
|
101
|
+
ux.stdout(`${this.design.icons.current.figure} ${stage}…`);
|
|
103
102
|
this.printInfo(this.preStagesBlock, 3);
|
|
104
103
|
this.printInfo(this.stageSpecificBlock?.filter((info) => info.stage === stage), 3);
|
|
105
104
|
this.printInfo(this.postStagesBlock, 3);
|
|
@@ -113,16 +112,16 @@ class CIMultiStageOutput {
|
|
|
113
112
|
const startTime = this.startTimes.get(stage);
|
|
114
113
|
const elapsedTime = startTime ? Date.now() - startTime : 0;
|
|
115
114
|
const displayTime = readableTime(elapsedTime, this.timerUnit);
|
|
116
|
-
ux.stdout(`${this.design.icons[status].figure} ${
|
|
115
|
+
ux.stdout(`${this.design.icons[status].figure} ${stage} (${displayTime})`);
|
|
117
116
|
this.printInfo(this.preStagesBlock, 3);
|
|
118
117
|
this.printInfo(this.stageSpecificBlock?.filter((info) => info.stage === stage), 3);
|
|
119
118
|
this.printInfo(this.postStagesBlock, 3);
|
|
120
119
|
}
|
|
121
120
|
else if (status === 'skipped') {
|
|
122
|
-
ux.stdout(`${this.design.icons[status].figure} ${
|
|
121
|
+
ux.stdout(`${this.design.icons[status].figure} ${stage} - Skipped`);
|
|
123
122
|
}
|
|
124
123
|
else {
|
|
125
|
-
ux.stdout(`${this.design.icons[status].figure} ${
|
|
124
|
+
ux.stdout(`${this.design.icons[status].figure} ${stage}`);
|
|
126
125
|
this.printInfo(this.preStagesBlock, 3);
|
|
127
126
|
this.printInfo(this.stageSpecificBlock?.filter((info) => info.stage === stage), 3);
|
|
128
127
|
this.printInfo(this.postStagesBlock, 3);
|
package/package.json
CHANGED
|
@@ -1,13 +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.5.
|
|
4
|
+
"version": "0.5.9",
|
|
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.
|
|
10
|
-
"change-case": "^5.4.4",
|
|
9
|
+
"@types/react": "^18.3.8",
|
|
11
10
|
"cli-spinners": "^2",
|
|
12
11
|
"figures": "^6.1.0",
|
|
13
12
|
"ink": "^5.0.1",
|
|
@@ -18,20 +17,20 @@
|
|
|
18
17
|
"@commitlint/config-conventional": "^19",
|
|
19
18
|
"@oclif/prettier-config": "^0.2.1",
|
|
20
19
|
"@types/chai": "^4.3.16",
|
|
21
|
-
"@types/mocha": "^10.0.
|
|
20
|
+
"@types/mocha": "^10.0.8",
|
|
22
21
|
"@types/node": "^18",
|
|
23
22
|
"@types/sinon": "^17.0.3",
|
|
24
23
|
"chai": "^4.5.0",
|
|
25
24
|
"commitlint": "^19",
|
|
26
|
-
"eslint": "^8.57.
|
|
25
|
+
"eslint": "^8.57.1",
|
|
27
26
|
"eslint-config-oclif": "^5.2.0",
|
|
28
|
-
"eslint-config-oclif-typescript": "^3.1.
|
|
27
|
+
"eslint-config-oclif-typescript": "^3.1.11",
|
|
29
28
|
"eslint-config-prettier": "^9.1.0",
|
|
30
29
|
"eslint-config-xo": "^0.45.0",
|
|
31
30
|
"eslint-config-xo-react": "^0.27.0",
|
|
32
|
-
"eslint-plugin-react": "^7.
|
|
31
|
+
"eslint-plugin-react": "^7.36.1",
|
|
33
32
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
34
|
-
"husky": "^9.1.
|
|
33
|
+
"husky": "^9.1.6",
|
|
35
34
|
"ink-testing-library": "^4.0.0",
|
|
36
35
|
"lint-staged": "^15",
|
|
37
36
|
"mocha": "^10.7.3",
|