conqr 1.7.2 → 2.1.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/CHANGELOG.md +22 -0
- package/README.md +52 -67
- package/dist/conqr-darwin-amd64 +0 -0
- package/dist/conqr-darwin-arm64 +0 -0
- package/dist/conqr-linux-amd64 +0 -0
- package/dist/conqr-linux-arm64 +0 -0
- package/dist/conqr-win32-amd64.exe +0 -0
- package/dist/conqr-win32-arm64.exe +0 -0
- package/npm/conqr.js +38 -0
- package/package.json +9 -19
- package/dist/cli.d.ts +0 -13
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -45
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -41
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -96
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/log-buffer.d.ts +0 -18
- package/dist/log-buffer.d.ts.map +0 -1
- package/dist/log-buffer.js +0 -41
- package/dist/log-buffer.js.map +0 -1
- package/dist/process-manager.d.ts +0 -49
- package/dist/process-manager.d.ts.map +0 -1
- package/dist/process-manager.js +0 -478
- package/dist/process-manager.js.map +0 -1
- package/dist/ui.d.ts +0 -12
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -582
- package/dist/ui.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.1.0] - 2026-05-31
|
|
4
|
+
|
|
5
|
+
- fix(tui): preserve log viewport while scrolled- Maintenance release.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## [v2.0.0] - 2026-05-30
|
|
9
|
+
|
|
10
|
+
- ci: harden npm release publishing- Maintenance release.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [2.0.0] - 2026-05-30
|
|
14
|
+
|
|
15
|
+
- refactor: rewrite conqr runtime in Go- Maintenance release.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Unreleased
|
|
19
|
+
|
|
20
|
+
- Rewrote the runtime in Go while preserving the npm `conqr` command.
|
|
21
|
+
- Switched the terminal UI to Bubble Tea, Bubbles viewport, and Lip Gloss.
|
|
22
|
+
- Added npm packaging for bundled Go binaries.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# conqr
|
|
2
2
|
|
|
3
|
-
Dead-simple TUI process runner
|
|
3
|
+
Dead-simple TUI process runner, written in Go.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Dead-simple TUI process runner for Node.js.
|
|
|
10
10
|
conqr 'npm run dev' 'npm run build:emails' 'npm run worker'
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Customize process names with the `'name'='command'` syntax:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
conqr 'Dev Server'='npm run dev' 'Build Process'='npm run build' 'Worker'='npm run worker'
|
|
@@ -18,9 +18,10 @@ conqr 'Dev Server'='npm run dev' 'Build Process'='npm run build' 'Worker'='npm r
|
|
|
18
18
|
|
|
19
19
|
### Configuration File
|
|
20
20
|
|
|
21
|
-
Create a `conqr.json` or `.conqr.json` file in your project directory
|
|
21
|
+
Create a `conqr.json` or `.conqr.json` file in your project directory.
|
|
22
|
+
|
|
23
|
+
Simple commands:
|
|
22
24
|
|
|
23
|
-
**Simple commands (string values):**
|
|
24
25
|
```json
|
|
25
26
|
{
|
|
26
27
|
"commands": {
|
|
@@ -31,7 +32,8 @@ Create a `conqr.json` or `.conqr.json` file in your project directory:
|
|
|
31
32
|
}
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
Extended commands with restart options:
|
|
36
|
+
|
|
35
37
|
```json
|
|
36
38
|
{
|
|
37
39
|
"commands": {
|
|
@@ -53,36 +55,24 @@ Create a `conqr.json` or `.conqr.json` file in your project directory:
|
|
|
53
55
|
}
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"commands": {
|
|
60
|
-
"Dev Server": "npm run dev",
|
|
61
|
-
"Worker": {
|
|
62
|
-
"command": "npm run worker",
|
|
63
|
-
"restart": { "policy": "on-error" }
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
58
|
+
Then run:
|
|
68
59
|
|
|
69
|
-
Then simply run:
|
|
70
60
|
```bash
|
|
71
61
|
conqr
|
|
72
62
|
```
|
|
73
63
|
|
|
74
|
-
CLI arguments take precedence over
|
|
64
|
+
CLI arguments take precedence over config files.
|
|
75
65
|
|
|
76
66
|
### Restart Configuration
|
|
77
67
|
|
|
78
|
-
|
|
68
|
+
Restart policies:
|
|
69
|
+
|
|
70
|
+
- `"never"`: no automatic restart
|
|
71
|
+
- `"on-error"`: restart only when a process exits with a non-zero code
|
|
72
|
+
- `"on-exit"`: restart whenever a process exits
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
- `"never"` - No automatic restart (default)
|
|
82
|
-
- `"on-error"` - Restart only when process exits with non-zero code
|
|
83
|
-
- `"on-exit"` - Restart whenever process exits, regardless of exit code
|
|
74
|
+
Global restart settings apply to all config-file commands:
|
|
84
75
|
|
|
85
|
-
**Global restart (applies to all commands):**
|
|
86
76
|
```json
|
|
87
77
|
{
|
|
88
78
|
"restart": {
|
|
@@ -96,7 +86,8 @@ Configure automatic restart behavior for processes that crash or exit.
|
|
|
96
86
|
}
|
|
97
87
|
```
|
|
98
88
|
|
|
99
|
-
|
|
89
|
+
Per-process restart settings override global settings:
|
|
90
|
+
|
|
100
91
|
```json
|
|
101
92
|
{
|
|
102
93
|
"restart": {
|
|
@@ -118,7 +109,7 @@ Configure automatic restart behavior for processes that crash or exit.
|
|
|
118
109
|
|
|
119
110
|
### JSON Schema
|
|
120
111
|
|
|
121
|
-
For IDE autocomplete and validation, add a `$schema` reference
|
|
112
|
+
For IDE autocomplete and validation, add a `$schema` reference:
|
|
122
113
|
|
|
123
114
|
```json
|
|
124
115
|
{
|
|
@@ -130,76 +121,70 @@ For IDE autocomplete and validation, add a `$schema` reference to your config fi
|
|
|
130
121
|
}
|
|
131
122
|
```
|
|
132
123
|
|
|
133
|
-
The schema file is also available in the npm package at `node_modules/conqr/conqr.schema.json` for local reference.
|
|
134
|
-
|
|
135
124
|
## Demo
|
|
136
125
|
|
|
137
126
|
Try it with the included demo scripts:
|
|
138
127
|
|
|
139
128
|
```bash
|
|
140
|
-
|
|
129
|
+
go run . 'node demo/logger1.js' 'node demo/logger2.js' 'node demo/logger3.js'
|
|
141
130
|
```
|
|
142
131
|
|
|
143
132
|
## Features
|
|
144
133
|
|
|
145
134
|
- Run multiple commands concurrently
|
|
146
|
-
- Two-pane interface
|
|
147
|
-
|
|
148
|
-
- **Main pane**: Logs from selected command or unified view when "All processes" is selected
|
|
135
|
+
- Two-pane terminal interface with process statuses and logs
|
|
136
|
+
- Unified "All processes" log view
|
|
149
137
|
- ANSI color support in logs
|
|
150
|
-
- Automatic error detection
|
|
151
|
-
- Auto-scroll to bottom
|
|
152
|
-
- Mouse wheel scrolling
|
|
153
|
-
- Raw
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
138
|
+
- Automatic error detection from common error patterns and red ANSI output
|
|
139
|
+
- Auto-scroll to bottom while new logs arrive
|
|
140
|
+
- Mouse wheel and keyboard scrolling
|
|
141
|
+
- Raw log mode with `l`
|
|
142
|
+
- Manual process restart with `r`
|
|
143
|
+
- Automatic process restart with configurable policies
|
|
144
|
+
- Graceful process-group shutdown on quit
|
|
145
|
+
|
|
146
|
+
## Keyboard Controls
|
|
147
|
+
|
|
148
|
+
- Arrow Left/Right: switch focus between sidebar and logs
|
|
149
|
+
- Arrow Up/Down: navigate commands or scroll logs
|
|
150
|
+
- PageUp/PageDown: scroll logs 10 lines
|
|
151
|
+
- Home/End: jump to top or bottom
|
|
152
|
+
- `r`: restart selected process
|
|
153
|
+
- `l`: toggle raw log mode
|
|
154
|
+
- `q` or Ctrl+C: quit
|
|
166
155
|
|
|
167
156
|
## Requirements
|
|
168
157
|
|
|
169
|
-
- Node.js
|
|
158
|
+
- For npm installs: Node.js 18 or newer
|
|
159
|
+
- For source builds: Go 1.25 or newer
|
|
160
|
+
- Prebuilt npm binaries are published for macOS, Linux, and Windows on `amd64` and `arm64`
|
|
170
161
|
|
|
171
162
|
## Installation
|
|
172
163
|
|
|
173
|
-
Install
|
|
164
|
+
Install from npm:
|
|
165
|
+
|
|
174
166
|
```bash
|
|
175
167
|
npm install -g conqr
|
|
176
168
|
```
|
|
177
169
|
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
npm install conqr
|
|
181
|
-
```
|
|
170
|
+
The npm package preserves the existing `conqr` command and launches the bundled Go binary for your platform.
|
|
182
171
|
|
|
183
|
-
|
|
172
|
+
Install from source:
|
|
184
173
|
|
|
185
174
|
```bash
|
|
186
|
-
|
|
175
|
+
go install github.com/bohdan-shulha/conqr@latest
|
|
187
176
|
```
|
|
188
177
|
|
|
189
|
-
|
|
178
|
+
Or build locally:
|
|
190
179
|
|
|
191
|
-
Run in development mode (using tsx):
|
|
192
180
|
```bash
|
|
193
|
-
|
|
181
|
+
make build
|
|
182
|
+
./bin/conqr 'command1' 'command2' 'command3'
|
|
194
183
|
```
|
|
195
184
|
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
npm run build
|
|
199
|
-
node dist/index.js 'command1' 'command2' 'command3'
|
|
200
|
-
```
|
|
185
|
+
## Development
|
|
201
186
|
|
|
202
|
-
Or after installing globally:
|
|
203
187
|
```bash
|
|
204
|
-
|
|
188
|
+
make test
|
|
189
|
+
go run . 'command1' 'command2' 'command3'
|
|
205
190
|
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/npm/conqr.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const arch = process.arch;
|
|
11
|
+
|
|
12
|
+
const binaryName = platform === 'win32'
|
|
13
|
+
? `conqr-${platform}-${arch}.exe`
|
|
14
|
+
: `conqr-${platform}-${arch}`;
|
|
15
|
+
const binaryPath = join(__dirname, '..', 'dist', binaryName);
|
|
16
|
+
|
|
17
|
+
if (!existsSync(binaryPath)) {
|
|
18
|
+
console.error(`conqr: no bundled binary for ${platform}/${arch}`);
|
|
19
|
+
console.error(`Expected: ${binaryPath}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
24
|
+
stdio: 'inherit'
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
child.on('error', (error) => {
|
|
28
|
+
console.error(`conqr: failed to start bundled binary: ${error.message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
child.on('exit', (code, signal) => {
|
|
33
|
+
if (signal) {
|
|
34
|
+
process.kill(process.pid, signal);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
process.exit(code ?? 0);
|
|
38
|
+
});
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conqr",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Dead-simple TUI process runner",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"bin": {
|
|
8
|
-
"conqr": "
|
|
7
|
+
"conqr": "npm/conqr.js"
|
|
9
8
|
},
|
|
10
9
|
"files": [
|
|
11
|
-
"dist",
|
|
10
|
+
"dist/conqr-*",
|
|
11
|
+
"npm/conqr.js",
|
|
12
12
|
"README.md",
|
|
13
|
+
"CHANGELOG.md",
|
|
13
14
|
"conqr.schema.json"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"dev": "tsx src/index.ts"
|
|
17
|
+
"build": "go build -o bin/conqr .",
|
|
18
|
+
"test": "go test ./...",
|
|
19
|
+
"prepack": "node npm/check-binaries.js"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"tui",
|
|
@@ -30,20 +30,10 @@
|
|
|
30
30
|
"license": "ISC",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "https://github.com/bohdan-shulha/conqr.git"
|
|
33
|
+
"url": "git+https://github.com/bohdan-shulha/conqr.git"
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/bohdan-shulha/conqr#readme",
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18.0.0"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"ink": "^4.4.1",
|
|
41
|
-
"react": "^18.2.0"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@types/node": "^24.10.1",
|
|
45
|
-
"@types/react": "^19.2.4",
|
|
46
|
-
"tsx": "^4.20.6",
|
|
47
|
-
"typescript": "^5.9.3"
|
|
48
38
|
}
|
|
49
39
|
}
|
package/dist/cli.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type RestartPolicy = 'never' | 'on-error' | 'on-exit';
|
|
2
|
-
export interface RestartConfig {
|
|
3
|
-
policy: RestartPolicy;
|
|
4
|
-
delay: number;
|
|
5
|
-
}
|
|
6
|
-
export interface CommandInfo {
|
|
7
|
-
id: number;
|
|
8
|
-
name: string;
|
|
9
|
-
command: string;
|
|
10
|
-
restart?: RestartConfig;
|
|
11
|
-
}
|
|
12
|
-
export declare function parseCommands(): CommandInfo[];
|
|
13
|
-
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,aAAa,IAAI,WAAW,EAAE,CA0C7C"}
|
package/dist/cli.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export function parseCommands() {
|
|
2
|
-
const args = process.argv.slice(2);
|
|
3
|
-
if (args.length === 0) {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
return args.map((arg, index) => {
|
|
7
|
-
const equalsIndex = arg.indexOf('=');
|
|
8
|
-
let command;
|
|
9
|
-
let name;
|
|
10
|
-
if (equalsIndex > 0 && equalsIndex < arg.length - 1) {
|
|
11
|
-
name = arg.substring(0, equalsIndex).trim();
|
|
12
|
-
command = arg.substring(equalsIndex + 1).trim();
|
|
13
|
-
if (name.startsWith("'") && name.endsWith("'")) {
|
|
14
|
-
name = name.slice(1, -1);
|
|
15
|
-
}
|
|
16
|
-
else if (name.startsWith('"') && name.endsWith('"')) {
|
|
17
|
-
name = name.slice(1, -1);
|
|
18
|
-
}
|
|
19
|
-
if (command.startsWith("'") && command.endsWith("'")) {
|
|
20
|
-
command = command.slice(1, -1);
|
|
21
|
-
}
|
|
22
|
-
else if (command.startsWith('"') && command.endsWith('"')) {
|
|
23
|
-
command = command.slice(1, -1);
|
|
24
|
-
}
|
|
25
|
-
if (name.length === 0) {
|
|
26
|
-
name = extractCommandName(command);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
command = arg;
|
|
31
|
-
name = extractCommandName(command);
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
id: index,
|
|
35
|
-
name,
|
|
36
|
-
command
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function extractCommandName(command) {
|
|
41
|
-
const firstWord = command.trim().split(/\s+/)[0];
|
|
42
|
-
const basename = firstWord.split('/').pop();
|
|
43
|
-
return basename || `cmd${Date.now()}`;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,aAAa;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC7B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,OAAe,CAAC;QACpB,IAAI,IAAY,CAAC;QAEjB,IAAI,WAAW,GAAG,CAAC,IAA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AAC,CAAC;QACrC,CAAC;QAED,OAAO;YACL,EAAE,EAAE,KAAK;YACT,IAAI;YACJ,OAAO;SACR,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAe;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAC5C,OAAO,QAAQ,IAAI,MAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/config.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CommandInfo, RestartConfig } from './cli.js';
|
|
2
|
-
/**
|
|
3
|
-
* Default restart configuration used when no restart settings are provided.
|
|
4
|
-
* Policy 'never' means processes won't auto-restart by default.
|
|
5
|
-
*/
|
|
6
|
-
export declare const DEFAULT_RESTART_CONFIG: RestartConfig;
|
|
7
|
-
/**
|
|
8
|
-
* Resolves restart configuration by merging defaults, global config, and per-process config.
|
|
9
|
-
* Precedence (highest to lowest): per-process → global → defaults
|
|
10
|
-
*
|
|
11
|
-
* @param global - Global restart config from config file root
|
|
12
|
-
* @param perProcess - Per-process restart config from command object
|
|
13
|
-
* @returns Complete RestartConfig with all fields populated
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveRestartConfig(global?: Partial<RestartConfig>, perProcess?: Partial<RestartConfig>): RestartConfig;
|
|
16
|
-
export interface CommandObject {
|
|
17
|
-
name: string;
|
|
18
|
-
command: string;
|
|
19
|
-
restart?: Partial<RestartConfig>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Extended command configuration for object command values.
|
|
23
|
-
* Used when a command entry value is an object instead of a simple string.
|
|
24
|
-
*/
|
|
25
|
-
export interface ExtendedCommandConfig {
|
|
26
|
-
/** The command string to execute (required) */
|
|
27
|
-
command: string;
|
|
28
|
-
/** Optional per-process restart configuration */
|
|
29
|
-
restart?: Partial<RestartConfig>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Command value can be a simple string (the command to execute)
|
|
33
|
-
* or an extended config object with command and optional restart settings.
|
|
34
|
-
*/
|
|
35
|
-
export type CommandValue = string | ExtendedCommandConfig;
|
|
36
|
-
export interface ConfigFile {
|
|
37
|
-
commands: Record<string, CommandValue>;
|
|
38
|
-
restart?: Partial<RestartConfig>;
|
|
39
|
-
}
|
|
40
|
-
export declare function loadConfig(): CommandInfo[] | null;
|
|
41
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAItD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,EAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAClC,aAAa,CAMf;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,qBAAqB,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AAED,wBAAgB,UAAU,IAAI,WAAW,EAAE,GAAG,IAAI,CAkBjD"}
|
package/dist/config.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
const CONFIG_FILES = ['.conqr.json', 'conqr.json'];
|
|
4
|
-
/**
|
|
5
|
-
* Default restart configuration used when no restart settings are provided.
|
|
6
|
-
* Policy 'never' means processes won't auto-restart by default.
|
|
7
|
-
*/
|
|
8
|
-
export const DEFAULT_RESTART_CONFIG = {
|
|
9
|
-
policy: 'never',
|
|
10
|
-
delay: 1000 // 1 second default delay
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Resolves restart configuration by merging defaults, global config, and per-process config.
|
|
14
|
-
* Precedence (highest to lowest): per-process → global → defaults
|
|
15
|
-
*
|
|
16
|
-
* @param global - Global restart config from config file root
|
|
17
|
-
* @param perProcess - Per-process restart config from command object
|
|
18
|
-
* @returns Complete RestartConfig with all fields populated
|
|
19
|
-
*/
|
|
20
|
-
export function resolveRestartConfig(global, perProcess) {
|
|
21
|
-
return {
|
|
22
|
-
...DEFAULT_RESTART_CONFIG,
|
|
23
|
-
...global,
|
|
24
|
-
...perProcess
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function loadConfig() {
|
|
28
|
-
const cwd = process.cwd();
|
|
29
|
-
for (const configFile of CONFIG_FILES) {
|
|
30
|
-
const configPath = join(cwd, configFile);
|
|
31
|
-
if (existsSync(configPath)) {
|
|
32
|
-
try {
|
|
33
|
-
const content = readFileSync(configPath, 'utf-8');
|
|
34
|
-
const config = JSON.parse(content);
|
|
35
|
-
return parseConfigCommands(config);
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
console.error(`Error reading config file ${configFile}:`, err);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
function parseConfigCommands(config) {
|
|
46
|
-
if (!config.commands) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
// Check for array format - no longer supported (Requirements 1.2, 5.1, 5.2)
|
|
50
|
-
if (Array.isArray(config.commands)) {
|
|
51
|
-
console.error('Error: Array format for commands is no longer supported.');
|
|
52
|
-
console.error('Please use object format: { "name": "command" } or { "name": { "command": "..." } }');
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const commands = [];
|
|
56
|
-
// Extract global restart config from config file root
|
|
57
|
-
const globalRestart = config.restart;
|
|
58
|
-
// Record<string, CommandValue> format: process object entries
|
|
59
|
-
let index = 0;
|
|
60
|
-
for (const [name, value] of Object.entries(config.commands)) {
|
|
61
|
-
if (typeof value === 'string') {
|
|
62
|
-
// Simple command: string value (Requirements 2.1, 2.2, 2.3)
|
|
63
|
-
// - Key is used as the process display name
|
|
64
|
-
// - Value is the command to execute
|
|
65
|
-
// - Global restart config is applied
|
|
66
|
-
commands.push({
|
|
67
|
-
id: index++,
|
|
68
|
-
name,
|
|
69
|
-
command: value,
|
|
70
|
-
restart: resolveRestartConfig(globalRestart, undefined)
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else if (typeof value === 'object' && value !== null) {
|
|
74
|
-
// Extended command: object value (Requirements 3.1, 3.2, 3.3, 3.4)
|
|
75
|
-
if (value.command) {
|
|
76
|
-
// Valid extended command with required 'command' property
|
|
77
|
-
// - Key is used as the process display name
|
|
78
|
-
// - value.command is the command to execute
|
|
79
|
-
// - Per-process restart config is merged with global restart config
|
|
80
|
-
commands.push({
|
|
81
|
-
id: index++,
|
|
82
|
-
name,
|
|
83
|
-
command: value.command,
|
|
84
|
-
restart: resolveRestartConfig(globalRestart, value.restart)
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
// Invalid extended command: missing required 'command' property (Requirement 3.4)
|
|
89
|
-
console.warn(`Warning: Command entry "${name}" is missing required "command" property, skipping.`);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return commands;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,YAAY,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,IAAI,CAAC,yBAAyB;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAA+B,EAC/B,UAAmC;IAEnC,OAAO;QACL,GAAG,sBAAsB;QACzB,GAAG,MAAM;QACT,GAAG,UAAU;KACd,CAAC;AACJ,CAAC;AA8BD,MAAM,UAAU,UAAU;IACxB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACzC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBAClD,MAAM,MAAM,GAAe,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC/C,OAAO,mBAAmB,CAAC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AAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAClB,0DAA0D;gBAC1D,4CAA4C;gBAC5C,4CAA4C;gBAC5C,oEAAoE;gBACpE,QAAQ,CAAC,IAAI,CAAC;oBACZ,EAAE,EAAE,KAAK,EAAE;oBACX,IAAI;oBACJ,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,OAAO,EAAE,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC;iBAC5D,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,kFAAkF;gBAClF,OAAO,CAAC,IAAI,CAAC,2BAA2B,IAAI,qDAAqD,CAAC,CAAC;gBACnG,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { parseCommands } from './cli.js';
|
|
3
|
-
import { loadConfig } from './config.js';
|
|
4
|
-
import { ProcessManager } from './process-manager.js';
|
|
5
|
-
import { LogBuffer } from './log-buffer.js';
|
|
6
|
-
import { renderTUI } from './ui.js';
|
|
7
|
-
const cliCommands = parseCommands();
|
|
8
|
-
const configCommands = loadConfig();
|
|
9
|
-
let commands;
|
|
10
|
-
if (cliCommands.length > 0) {
|
|
11
|
-
commands = cliCommands;
|
|
12
|
-
}
|
|
13
|
-
else if (configCommands && configCommands.length > 0) {
|
|
14
|
-
commands = configCommands;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
console.error('No commands provided. Use CLI arguments or create a conqr.json config file.');
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
const logBuffer = new LogBuffer();
|
|
21
|
-
const processManager = new ProcessManager(logBuffer);
|
|
22
|
-
renderTUI(commands, processManager, logBuffer);
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,WAAW,GAAG,aAAa,EAAE,CAAC;AACpC,MAAM,cAAc,GAAG,UAAU,EAAE,CAAC;AAEpC,IAAI,QAAQ,CAAC;AACb,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IAC3B,QAAQ,GAAG,WAAW,CAAC;AACzB,CAAC;KAAM,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACvD,QAAQ,GAAG,cAAc,CAAC;AAC5B,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;IAC7F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAClC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AAErD,SAAS,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
package/dist/log-buffer.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface LogEntry {
|
|
2
|
-
line: string;
|
|
3
|
-
source: 'stdout' | 'stderr';
|
|
4
|
-
timestamp: number;
|
|
5
|
-
processId?: number;
|
|
6
|
-
isSystem?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class LogBuffer {
|
|
9
|
-
private buffers;
|
|
10
|
-
private unifiedBuffer;
|
|
11
|
-
private maxLines;
|
|
12
|
-
constructor();
|
|
13
|
-
addLog(processId: number, line: string, source?: 'stdout' | 'stderr', isSystem?: boolean): void;
|
|
14
|
-
getLogs(processId: number): LogEntry[];
|
|
15
|
-
getUnifiedLogs(): LogEntry[];
|
|
16
|
-
clear(processId?: number): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=log-buffer.d.ts.map
|
package/dist/log-buffer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-buffer.d.ts","sourceRoot":"","sources":["../src/log-buffer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAS;;IAQzB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,QAAQ,GAAG,QAAmB,EAAE,QAAQ,GAAE,OAAe,GAAG,IAAI;IAkBhH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;IAItC,cAAc,IAAI,QAAQ,EAAE;IAI5B,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;CAQhC"}
|
package/dist/log-buffer.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const MAX_LINES_PER_PROCESS = 1000;
|
|
2
|
-
export class LogBuffer {
|
|
3
|
-
buffers;
|
|
4
|
-
unifiedBuffer;
|
|
5
|
-
maxLines;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.buffers = new Map();
|
|
8
|
-
this.unifiedBuffer = [];
|
|
9
|
-
this.maxLines = MAX_LINES_PER_PROCESS;
|
|
10
|
-
}
|
|
11
|
-
addLog(processId, line, source = 'stdout', isSystem = false) {
|
|
12
|
-
if (!this.buffers.has(processId)) {
|
|
13
|
-
this.buffers.set(processId, []);
|
|
14
|
-
}
|
|
15
|
-
const buffer = this.buffers.get(processId);
|
|
16
|
-
buffer.push({ line, source, timestamp: Date.now(), isSystem });
|
|
17
|
-
if (buffer.length > this.maxLines) {
|
|
18
|
-
buffer.shift();
|
|
19
|
-
}
|
|
20
|
-
this.unifiedBuffer.push({ processId, line, source, timestamp: Date.now(), isSystem });
|
|
21
|
-
if (this.unifiedBuffer.length > this.maxLines * 10) {
|
|
22
|
-
this.unifiedBuffer.shift();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
getLogs(processId) {
|
|
26
|
-
return this.buffers.get(processId) || [];
|
|
27
|
-
}
|
|
28
|
-
getUnifiedLogs() {
|
|
29
|
-
return this.unifiedBuffer;
|
|
30
|
-
}
|
|
31
|
-
clear(processId) {
|
|
32
|
-
if (processId !== undefined) {
|
|
33
|
-
this.buffers.delete(processId);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.buffers.clear();
|
|
37
|
-
this.unifiedBuffer = [];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=log-buffer.js.map
|