@techninja/clearstack 0.4.14 → 0.4.16
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/watch-runner.js +6 -1
- package/lib/watch.js +10 -1
- package/package.json +1 -1
package/lib/watch-runner.js
CHANGED
|
@@ -33,7 +33,12 @@ export function runKeys(specRows, keys, ctx) {
|
|
|
33
33
|
row.detail = '';
|
|
34
34
|
render(rows, lastCheck.value, watchDirs, currentViolations.value);
|
|
35
35
|
const t0 = Date.now();
|
|
36
|
-
const
|
|
36
|
+
const onProgress = (line) => {
|
|
37
|
+
row.detail = line.slice(0, 60);
|
|
38
|
+
render(rows, lastCheck.value, watchDirs, currentViolations.value);
|
|
39
|
+
};
|
|
40
|
+
const raw = await row.run({ quiet: true, onProgress });
|
|
41
|
+
if (raw?.pass === null) { setImmediate(next); return; } // cancelled — leave row as-is
|
|
37
42
|
const elapsed = ((Date.now() - t0) / 1000).toFixed(1) + 's';
|
|
38
43
|
row.result = typeof raw === 'boolean' ? { pass: raw } : raw;
|
|
39
44
|
row.pass = row.result.pass;
|
package/lib/watch.js
CHANGED
|
@@ -52,7 +52,16 @@ export async function startWatch(projectDir) {
|
|
|
52
52
|
const extra = keyBound.map(({ keyBinding, name }) => ` ${keyBinding} ${name.replace(/\s*\(.*\)/, '')}`).join(' ');
|
|
53
53
|
outer.setLabel(` {blue-fg}\u2665{/blue-fg} Clearstack Spec Watch q quit \u2191\u2193 scroll c copy f fix${extra} `);
|
|
54
54
|
for (const row of keyBound) {
|
|
55
|
-
screen.key([row.keyBinding], () =>
|
|
55
|
+
screen.key([row.keyBinding], () => {
|
|
56
|
+
if (row.pass === null && row.cancel) {
|
|
57
|
+
row.cancel();
|
|
58
|
+
row.pass = false;
|
|
59
|
+
row.detail = 'cancelled';
|
|
60
|
+
render(rows, lastCheck.value, watchDirs, currentViolations.value);
|
|
61
|
+
} else {
|
|
62
|
+
run(new Set([row.key]));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
|
package/package.json
CHANGED