@supertape/formatter-time 1.0.0 → 1.0.2
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/time.js +7 -2
- package/package.json +5 -5
package/lib/time.js
CHANGED
|
@@ -5,6 +5,7 @@ import fullstore from 'fullstore';
|
|
|
5
5
|
import {isCI} from 'ci-info';
|
|
6
6
|
import process from 'node:process';
|
|
7
7
|
import {Timer} from 'timer-node';
|
|
8
|
+
import once from 'once';
|
|
8
9
|
|
|
9
10
|
global._isCI = isCI;
|
|
10
11
|
|
|
@@ -18,6 +19,8 @@ const isStr = (a) => typeof a === 'string';
|
|
|
18
19
|
|
|
19
20
|
const {stderr} = process;
|
|
20
21
|
|
|
22
|
+
const createProgress = once(_createProgress);
|
|
23
|
+
|
|
21
24
|
let SUPERTAPE_TIME;
|
|
22
25
|
let SUPERTAPE_TIME_MIN = 100;
|
|
23
26
|
let SUPERTAPE_TIME_COLOR;
|
|
@@ -67,7 +70,7 @@ export const start = ({barStore, timerStore, out}) => ({total}) => {
|
|
|
67
70
|
out('TAP version 13');
|
|
68
71
|
|
|
69
72
|
const color = SUPERTAPE_TIME_COLOR || YELLOW;
|
|
70
|
-
const {bar, timer} =
|
|
73
|
+
const {bar, timer} = createProgress({
|
|
71
74
|
total,
|
|
72
75
|
color,
|
|
73
76
|
test: '',
|
|
@@ -168,7 +171,7 @@ function createOutput() {
|
|
|
168
171
|
};
|
|
169
172
|
}
|
|
170
173
|
|
|
171
|
-
const getColorFn = (color) => {
|
|
174
|
+
export const getColorFn = (color) => {
|
|
172
175
|
if (color.startsWith('#'))
|
|
173
176
|
return chalk.hex(color);
|
|
174
177
|
|
|
@@ -219,6 +222,8 @@ function _createProgress({total, color, test}) {
|
|
|
219
222
|
}),
|
|
220
223
|
});
|
|
221
224
|
|
|
225
|
+
timer.start();
|
|
226
|
+
|
|
222
227
|
return {
|
|
223
228
|
bar,
|
|
224
229
|
timer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supertape/formatter-time",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "📼 Supertape formatter progress bar",
|
|
6
6
|
"homepage": "http://github.com/coderaiser/supertape",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"wisdom": "madrun wisdom"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"chalk": "^
|
|
26
|
+
"chalk": "^5.3.0",
|
|
27
27
|
"ci-info": "^4.0.0",
|
|
28
28
|
"cli-progress": "^3.8.2",
|
|
29
29
|
"fullstore": "^3.0.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"supertape"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"c8": "^
|
|
39
|
+
"c8": "^9.0.0",
|
|
40
40
|
"eslint": "^8.0.0-beta.0",
|
|
41
41
|
"eslint-plugin-n": "^16.0.1",
|
|
42
42
|
"eslint-plugin-putout": "^22.0.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"montag": "^1.0.0",
|
|
45
45
|
"nodemon": "^3.0.1",
|
|
46
46
|
"pullout": "^4.0.0",
|
|
47
|
-
"putout": "^
|
|
48
|
-
"supertape": "^
|
|
47
|
+
"putout": "^35.0.0",
|
|
48
|
+
"supertape": "^10.0.0"
|
|
49
49
|
},
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"engines": {
|