tasktui 1.0.6 → 1.0.7
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/app.d.ts +1 -1
- package/dist/app.js +18 -7
- package/dist/cli.js +2 -3
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +7 -1
- package/dist/renderer.d.ts +4 -3
- package/dist/renderer.js +16 -3
- package/dist/state.d.ts +0 -1
- package/dist/state.js +0 -1
- package/dist/tasks.js +1 -2
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +32 -2
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
package/dist/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render, showError } from './renderer.js';
|
|
1
|
+
import { render, showError, toggleKeybindsMenu } from './renderer.js';
|
|
2
2
|
import { createState, getAllTasksInOrder } from './state.js';
|
|
3
3
|
import { cleanup, ensureDependencies, spawnTask } from './tasks.js';
|
|
4
4
|
import { createUI } from './ui.js';
|
|
@@ -14,10 +14,10 @@ function handleMove(steps) {
|
|
|
14
14
|
const newTask = allTasks[newIndex];
|
|
15
15
|
if (newTask) {
|
|
16
16
|
state.selectedTask = newTask;
|
|
17
|
-
render(
|
|
17
|
+
render(state);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function loadAndProcessConfig(configPath) {
|
|
21
21
|
try {
|
|
22
22
|
const config = loadConfig(configPath);
|
|
23
23
|
state.config = config;
|
|
@@ -44,13 +44,13 @@ export function loadAndProcessConfig(configPath) {
|
|
|
44
44
|
});
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
spawnTask(name, task, state, () => render(
|
|
47
|
+
spawnTask(name, task, state, () => render(state));
|
|
48
48
|
}
|
|
49
|
-
render(
|
|
49
|
+
render(state);
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
52
|
const error = ensureError(e);
|
|
53
|
-
showError(error.message
|
|
53
|
+
showError(error.message);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
// Key bindings
|
|
@@ -64,8 +64,19 @@ ui.screen.key(['C-c', 'q'], () => {
|
|
|
64
64
|
cleanup(state);
|
|
65
65
|
process.exit(0);
|
|
66
66
|
});
|
|
67
|
+
ui.screen.key('m', () => {
|
|
68
|
+
toggleKeybindsMenu();
|
|
69
|
+
});
|
|
70
|
+
ui.screen.key('escape', () => {
|
|
71
|
+
if (!ui.keybindsBox.hidden)
|
|
72
|
+
toggleKeybindsMenu();
|
|
73
|
+
});
|
|
67
74
|
// Handle resize
|
|
68
75
|
ui.screen.on('resize', () => {
|
|
69
|
-
render(
|
|
76
|
+
render(state);
|
|
70
77
|
});
|
|
71
78
|
export default ui;
|
|
79
|
+
export function initialize(configPath) {
|
|
80
|
+
loadAndProcessConfig(configPath);
|
|
81
|
+
ui.screen.render();
|
|
82
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import meow from 'meow';
|
|
3
|
-
import
|
|
3
|
+
import { initialize } from './app.js';
|
|
4
4
|
const cli = meow(`
|
|
5
5
|
Usage
|
|
6
6
|
$ tasktui [--config <PATH> | --help]
|
|
@@ -16,5 +16,4 @@ const cli = meow(`
|
|
|
16
16
|
help: {},
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
ui.screen.render();
|
|
19
|
+
initialize(cli.flags.config);
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/renderer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AppState } from './state.js';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
2
|
+
export declare function showError(message: string): void;
|
|
3
|
+
export declare function toggleKeybindsMenu(): void;
|
|
4
|
+
export declare function hideKeybinds(): void;
|
|
5
|
+
export declare function render(state: AppState): void;
|
package/dist/renderer.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
import ui from './app.js';
|
|
1
2
|
import { getOrderedTasks } from './state.js';
|
|
2
|
-
export function showError(message
|
|
3
|
-
state.error = message;
|
|
3
|
+
export function showError(message) {
|
|
4
4
|
ui.errorBox.setContent(`{red-fg}Error: ${message}{/}`);
|
|
5
5
|
ui.errorBox.show();
|
|
6
6
|
ui.screen.render();
|
|
7
7
|
}
|
|
8
|
-
export function
|
|
8
|
+
export function toggleKeybindsMenu() {
|
|
9
|
+
if (ui.keybindsBox.hidden) {
|
|
10
|
+
ui.keybindsBox.show();
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
ui.keybindsBox.hide();
|
|
14
|
+
}
|
|
15
|
+
ui.screen.render();
|
|
16
|
+
}
|
|
17
|
+
export function hideKeybinds() {
|
|
18
|
+
ui.errorBox.hide();
|
|
19
|
+
ui.screen.render();
|
|
20
|
+
}
|
|
21
|
+
export function render(state) {
|
|
9
22
|
const { running, queued, completed } = getOrderedTasks(state);
|
|
10
23
|
const lines = [];
|
|
11
24
|
// Running section
|
package/dist/state.d.ts
CHANGED
package/dist/state.js
CHANGED
package/dist/tasks.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import childProcess from 'node:child_process';
|
|
2
|
-
import ui from './app.js';
|
|
3
2
|
import { showError } from './renderer.js';
|
|
4
3
|
import { ensureError } from './utils.js';
|
|
5
4
|
export function ensureDependencies(task, deps, state) {
|
|
@@ -64,7 +63,7 @@ export function spawnTask(name, task, state, onUpdate) {
|
|
|
64
63
|
});
|
|
65
64
|
subProcess.on('error', (e) => {
|
|
66
65
|
const error = ensureError(e);
|
|
67
|
-
showError(error.message
|
|
66
|
+
showError(error.message);
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
69
|
function checkQueue(state, onUpdate) {
|
package/dist/ui.d.ts
CHANGED
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import blessed from 'blessed';
|
|
2
|
+
import { KEYBINDS } from './constants.js';
|
|
2
3
|
export function createUI() {
|
|
3
4
|
// Create screen
|
|
4
5
|
const screen = blessed.screen({
|
|
@@ -45,8 +46,8 @@ export function createUI() {
|
|
|
45
46
|
parent: sidebar,
|
|
46
47
|
bottom: 0,
|
|
47
48
|
width: '100%',
|
|
48
|
-
height:
|
|
49
|
-
content: '{gray-fg}↑↓ - Navigate{/}',
|
|
49
|
+
height: 2,
|
|
50
|
+
content: '{gray-fg}↑↓ - Navigate\nm - More binds{/}',
|
|
50
51
|
tags: true,
|
|
51
52
|
});
|
|
52
53
|
// Output pane container
|
|
@@ -107,6 +108,34 @@ export function createUI() {
|
|
|
107
108
|
tags: true,
|
|
108
109
|
hidden: true,
|
|
109
110
|
});
|
|
111
|
+
// Keybinds display
|
|
112
|
+
const keybindsBox = blessed.box({
|
|
113
|
+
parent: screen,
|
|
114
|
+
top: 'center',
|
|
115
|
+
left: 'center',
|
|
116
|
+
width: '80%',
|
|
117
|
+
height: 'shrink',
|
|
118
|
+
border: {
|
|
119
|
+
type: 'line',
|
|
120
|
+
},
|
|
121
|
+
tags: true,
|
|
122
|
+
hidden: true,
|
|
123
|
+
});
|
|
124
|
+
// Keybinds title
|
|
125
|
+
blessed.box({
|
|
126
|
+
parent: keybindsBox,
|
|
127
|
+
top: -1,
|
|
128
|
+
left: 1,
|
|
129
|
+
width: 'shrink',
|
|
130
|
+
content: ' Keybinds ',
|
|
131
|
+
});
|
|
132
|
+
// Keybinds list
|
|
133
|
+
blessed.box({
|
|
134
|
+
parent: keybindsBox,
|
|
135
|
+
top: 1,
|
|
136
|
+
left: 2,
|
|
137
|
+
content: KEYBINDS.join('\n'),
|
|
138
|
+
});
|
|
110
139
|
// Focus on output box for scrolling
|
|
111
140
|
taskOutputBox.focus();
|
|
112
141
|
return {
|
|
@@ -117,5 +146,6 @@ export function createUI() {
|
|
|
117
146
|
taskNameBox,
|
|
118
147
|
taskOutputBox,
|
|
119
148
|
errorBox,
|
|
149
|
+
keybindsBox,
|
|
120
150
|
};
|
|
121
151
|
}
|