recomposable 1.1.0 → 1.1.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/README.md +33 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +1418 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/docker.d.ts +19 -0
- package/dist/lib/docker.js +332 -0
- package/dist/lib/docker.js.map +1 -0
- package/dist/lib/renderer.d.ts +22 -0
- package/dist/lib/renderer.js +524 -0
- package/dist/lib/renderer.js.map +1 -0
- package/dist/lib/state.d.ts +7 -0
- package/dist/lib/state.js +81 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/types.d.ts +183 -0
- package/dist/lib/types.js +6 -0
- package/dist/lib/types.js.map +1 -0
- package/package.json +19 -5
- package/screenshots/exec-inline-view.png +0 -0
- package/screenshots/exec-view.png +0 -0
- package/screenshots/list-view copy.png +0 -0
- package/screenshots/list-view.png +0 -0
- package/screenshots/logs-view.png +0 -0
- package/index.js +0 -958
- package/lib/docker.js +0 -231
- package/lib/renderer.js +0 -447
- package/lib/state.js +0 -63
package/README.md
CHANGED
|
@@ -45,12 +45,29 @@ recomposable
|
|
|
45
45
|
- **Full log view** — scrollable full-screen log viewer with live auto-scroll and search (`/`, `n`/`N`)
|
|
46
46
|
- **Start / Stop / Restart / Rebuild** — full container lifecycle management per service
|
|
47
47
|
- **No cache mode** — toggle to force a full clean rebuild (`--no-cache` + `--force-recreate`), off by default
|
|
48
|
+
- **Docker Compose Watch** — toggle `docker compose watch` per service, with live output in the log panel
|
|
49
|
+
- **Dependency-aware rebuild** — rebuild a service then automatically restart all its transitive dependents in topological order
|
|
50
|
+
- **Container exec** — run commands inside any container, inline in the bottom panel (`e`) or full-screen (`x`), with `cd` support and command history
|
|
48
51
|
- **Vim keybindings** — navigate with `j`/`k`, `G`/`gg`, and more
|
|
49
52
|
|
|
50
53
|
## Full Log View
|
|
51
54
|
|
|
52
55
|

|
|
53
56
|
|
|
57
|
+
## Exec Mode
|
|
58
|
+
|
|
59
|
+
Run commands inside any running container without leaving the TUI. Press `e` for inline exec in the bottom panel, or `x` for full-screen exec. `cd` works — the working directory is tracked across commands.
|
|
60
|
+
|
|
61
|
+

|
|
62
|
+
|
|
63
|
+
## Docker Compose Watch
|
|
64
|
+
|
|
65
|
+
Press `w` to toggle `docker compose watch` for a service. A cyan `W` indicator appears next to watched services, and watch output streams to the inline log panel. Requires Docker Compose v2.22+.
|
|
66
|
+
|
|
67
|
+
## Dependency-Aware Rebuild
|
|
68
|
+
|
|
69
|
+
Press `d` to rebuild the selected service and then automatically restart all services that depend on it (transitively), in the correct topological order. Progress is shown step-by-step in the log panel. If the service has no dependents, falls back to a regular rebuild.
|
|
70
|
+
|
|
54
71
|
## Adding Compose Files
|
|
55
72
|
|
|
56
73
|
Create a `recomposable.json` file in your project root:
|
|
@@ -113,6 +130,10 @@ recomposable -f docker-compose.yml -f docker-compose.prod.yml
|
|
|
113
130
|
| `s` | Start (if stopped) or restart (if running) |
|
|
114
131
|
| `p` | Stop selected service |
|
|
115
132
|
| `b` | Rebuild selected service (`up -d --build`) |
|
|
133
|
+
| `d` | Dependency-aware rebuild (rebuild + restart all dependents) |
|
|
134
|
+
| `w` | Toggle Docker Compose Watch for selected service |
|
|
135
|
+
| `e` | Inline exec in bottom panel |
|
|
136
|
+
| `x` | Full-screen exec mode |
|
|
116
137
|
| `n` | Toggle no-cache mode (rebuild with `--no-cache` + `--force-recreate`) |
|
|
117
138
|
| `f` / `Enter` | Full-screen log view for selected service |
|
|
118
139
|
| `l` | Toggle inline log panel |
|
|
@@ -137,6 +158,17 @@ recomposable -f docker-compose.yml -f docker-compose.prod.yml
|
|
|
137
158
|
| `Esc` / `f` | Exit log view |
|
|
138
159
|
| `q` | Quit |
|
|
139
160
|
|
|
161
|
+
### Exec mode (inline & full-screen)
|
|
162
|
+
|
|
163
|
+
| Key | Action |
|
|
164
|
+
|---|---|
|
|
165
|
+
| Type | Enter commands |
|
|
166
|
+
| `Enter` | Execute command |
|
|
167
|
+
| `Up` / `Down` | Navigate command history |
|
|
168
|
+
| `x` | Expand inline exec to full screen |
|
|
169
|
+
| `Ctrl+C` | Kill running command (double to quit) |
|
|
170
|
+
| `Esc` | Exit exec mode |
|
|
171
|
+
|
|
140
172
|
## Status Icons
|
|
141
173
|
|
|
142
174
|
| Icon | Meaning |
|
|
@@ -145,6 +177,7 @@ recomposable -f docker-compose.yml -f docker-compose.prod.yml
|
|
|
145
177
|
| Red circle | Running (unhealthy) |
|
|
146
178
|
| Yellow circle | Rebuilding / Restarting / Starting / Stopping |
|
|
147
179
|
| Gray circle | Stopped |
|
|
180
|
+
| Cyan `W` | Docker Compose Watch active |
|
|
148
181
|
|
|
149
182
|
## Todo
|
|
150
183
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import type { Config, AppState, ServiceGroup } from './lib/types';
|
|
3
|
+
export interface ModuleState {
|
|
4
|
+
logScanActive: boolean;
|
|
5
|
+
statsPollActive: boolean;
|
|
6
|
+
lastRenderTime: number;
|
|
7
|
+
pendingRender: ReturnType<typeof setTimeout> | null;
|
|
8
|
+
logFetchTimer: ReturnType<typeof setTimeout> | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function createModuleState(): ModuleState;
|
|
11
|
+
export declare function loadConfig(): Config;
|
|
12
|
+
export declare function discoverServices(config: Config): ServiceGroup[];
|
|
13
|
+
export declare function pollStatuses(state: AppState): void;
|
|
14
|
+
export declare function pollLogCounts(state: AppState): void;
|
|
15
|
+
export declare function pollContainerStats(state: AppState): void;
|
|
16
|
+
export declare function render(state: AppState): void;
|
|
17
|
+
export declare function stripAnsi(str: string): string;
|
|
18
|
+
export declare function throttledRender(state: AppState): void;
|
|
19
|
+
export declare function updateSelectedLogs(state: AppState): void;
|
|
20
|
+
export declare function doRebuild(state: AppState): void;
|
|
21
|
+
export declare function doRestart(state: AppState): void;
|
|
22
|
+
export declare function doStop(state: AppState): void;
|
|
23
|
+
export declare function doStart(state: AppState): void;
|
|
24
|
+
export declare function doWatch(state: AppState): void;
|
|
25
|
+
export declare function initDepGraphs(state: AppState): void;
|
|
26
|
+
export declare function doCascadeRebuild(state: AppState): void;
|
|
27
|
+
export declare function enterExecInline(state: AppState): void;
|
|
28
|
+
export declare function enterExec(state: AppState): void;
|
|
29
|
+
export declare function exitExec(state: AppState): void;
|
|
30
|
+
export declare function runExecCommand(state: AppState): void;
|
|
31
|
+
export declare function enterLogs(state: AppState): void;
|
|
32
|
+
export declare function exitLogs(state: AppState): void;
|
|
33
|
+
export declare function executeLogSearch(state: AppState): void;
|
|
34
|
+
export declare function jumpToNextMatch(state: AppState): void;
|
|
35
|
+
export declare function jumpToPrevMatch(state: AppState): void;
|
|
36
|
+
export declare function handleKeypress(state: AppState, key: string): void;
|
|
37
|
+
export declare function createInputHandler(state: AppState): (data: Buffer | string) => void;
|
|
38
|
+
export declare function cleanup(state: AppState): void;
|
|
39
|
+
export declare function _getModuleState(): ModuleState;
|
|
40
|
+
export declare function _setModuleState(ms: ModuleState): void;
|