@t0.labs/daxta 0.2.5 → 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.
- package/dist/cli/test.js +1 -1
- package/dist/cli/ui.d.ts +1 -0
- package/dist/cli/ui.js +7 -6
- package/package.json +1 -1
package/dist/cli/test.js
CHANGED
|
@@ -269,7 +269,7 @@ async function runDaxtaTest(options = {}) {
|
|
|
269
269
|
if (result.error)
|
|
270
270
|
throw result.error;
|
|
271
271
|
return testStatus === 0 ? 'passed' : `exit ${testStatus}`;
|
|
272
|
-
}, { paceMs: 400 });
|
|
272
|
+
}, { paceMs: 400, spinner: false });
|
|
273
273
|
try {
|
|
274
274
|
(0, fs_1.unlinkSync)(siblingTmp);
|
|
275
275
|
}
|
package/dist/cli/ui.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type StepResult = string | {
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function step(label: string, work: () => StepResult | Promise<StepResult>, options?: {
|
|
20
20
|
paceMs?: number;
|
|
21
|
+
spinner?: boolean;
|
|
21
22
|
}): Promise<void>;
|
|
22
23
|
export declare function box(title: string, lines: string[]): void;
|
|
23
24
|
export declare function nextSteps(lines: Array<{
|
package/dist/cli/ui.js
CHANGED
|
@@ -45,10 +45,11 @@ function banner(title, subtitle) {
|
|
|
45
45
|
*/
|
|
46
46
|
async function step(label, work, options = {}) {
|
|
47
47
|
const paceMs = options.paceMs ?? 0;
|
|
48
|
+
const useSpinner = options.spinner !== false && isTTY;
|
|
48
49
|
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
49
50
|
let i = 0;
|
|
50
51
|
let timer;
|
|
51
|
-
if (
|
|
52
|
+
if (useSpinner) {
|
|
52
53
|
process.stdout.write(` ${exports.c.cyan(frames[0])} ${label}`);
|
|
53
54
|
timer = setInterval(() => {
|
|
54
55
|
i = (i + 1) % frames.length;
|
|
@@ -56,7 +57,7 @@ async function step(label, work, options = {}) {
|
|
|
56
57
|
}, 80);
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
console.log(`
|
|
60
|
+
console.log(` ${exports.c.cyan('▶')} ${label}`);
|
|
60
61
|
}
|
|
61
62
|
try {
|
|
62
63
|
const result = await work();
|
|
@@ -71,10 +72,10 @@ async function step(label, work, options = {}) {
|
|
|
71
72
|
details = result.details ?? [];
|
|
72
73
|
}
|
|
73
74
|
const line = summary ? `${label} ${exports.c.dim(summary)}` : label;
|
|
74
|
-
if (
|
|
75
|
+
if (useSpinner)
|
|
75
76
|
process.stdout.write(`\r ${exports.c.green('✔')} ${line}${' '.repeat(12)}\n`);
|
|
76
77
|
else
|
|
77
|
-
console.log(` ✔ ${line}`);
|
|
78
|
+
console.log(` ${exports.c.green('✔')} ${line}`);
|
|
78
79
|
for (const d of details) {
|
|
79
80
|
console.log(` ${exports.c.dim('→')} ${d}`);
|
|
80
81
|
}
|
|
@@ -85,10 +86,10 @@ async function step(label, work, options = {}) {
|
|
|
85
86
|
if (timer)
|
|
86
87
|
clearInterval(timer);
|
|
87
88
|
const msg = error instanceof Error ? error.message : String(error);
|
|
88
|
-
if (
|
|
89
|
+
if (useSpinner)
|
|
89
90
|
process.stdout.write(`\r ${exports.c.red('✖')} ${label} ${exports.c.red(msg)}${' '.repeat(8)}\n`);
|
|
90
91
|
else
|
|
91
|
-
console.log(` ✖ ${label} ${msg}`);
|
|
92
|
+
console.log(` ${exports.c.red('✖')} ${label} ${msg}`);
|
|
92
93
|
throw error;
|
|
93
94
|
}
|
|
94
95
|
}
|