ldrouter 1.6.2 → 1.6.3
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 +14 -0
- package/dist/cli.js +4 -2
- package/dist/server/cli/tui/noise.js +8 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this project are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/) and the project adheres to
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.6.3] - 2026-08-30
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **TUI mode defaults**: Running `ldrouter` without args now enters interactive
|
|
12
|
+
TUI automatically if stdout is a TTY. Added `--no-tui` flag to force plain
|
|
13
|
+
server mode when needed (e.g., CI pipelines, logging redirects).
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Log pollution in TUI**: Reduced log level from `fatal` → `error` so that
|
|
18
|
+
deprecation warnings and other routine logs don't break the terminal UI
|
|
19
|
+
layout. Raw stdin mode activated earlier to capture all key presses cleanly.
|
|
20
|
+
|
|
7
21
|
## [1.6.2] - 2026-08-30
|
|
8
22
|
|
|
9
23
|
### Fixed
|
package/dist/cli.js
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// LateDev Router CLI entry point. The package's "bin" field points here.
|
|
3
3
|
import process from 'node:process';
|
|
4
4
|
async function main() {
|
|
5
|
-
|
|
5
|
+
// Auto-detect TUI mode — defaults to TUI when stdout is interactive
|
|
6
|
+
const hasNoTuiFlag = process.argv.includes('--no-tui');
|
|
7
|
+
const isTuiMode = !hasNoTuiFlag && process.stdin.isTTY && process.stdout.isTTY;
|
|
6
8
|
if (isTuiMode) {
|
|
7
9
|
// Launch TUI mode (zero-dependency console UI)
|
|
8
10
|
const { runCliTui } = await import('./server/cli/tui/noise.js');
|
|
9
11
|
await runCliTui();
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
12
|
-
// Normal server mode (
|
|
14
|
+
// Normal server mode (no terminal, or explicitly disabled via --no-tui)
|
|
13
15
|
process.env.LATEDEV_CLI_ENTRY = '1';
|
|
14
16
|
const { startApp } = await import('./server/app.js');
|
|
15
17
|
await startApp();
|
|
@@ -280,22 +280,24 @@ function shutdown(code = 0, respawnAfter = false) {
|
|
|
280
280
|
})();
|
|
281
281
|
}
|
|
282
282
|
export async function runCliTui() {
|
|
283
|
-
//
|
|
284
|
-
// loadConfig() reads it.
|
|
283
|
+
// MUST be set BEFORE loadConfig() reads it — critical for clean TUI output
|
|
285
284
|
if (!process.env.LATEDEV_LOG_LEVEL)
|
|
286
|
-
process.env.LATEDEV_LOG_LEVEL = '
|
|
285
|
+
process.env.LATEDEV_LOG_LEVEL = 'error';
|
|
287
286
|
cfg = loadConfig();
|
|
287
|
+
// Enter raw mode EARLY — before any logging happens
|
|
288
|
+
process.stdin.setRawMode(true);
|
|
289
|
+
process.stdin.resume();
|
|
288
290
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
291
|
+
process.stdin.setRawMode(false);
|
|
292
|
+
process.stdin.pause();
|
|
289
293
|
// No interactive terminal — fall back to the plain server.
|
|
290
294
|
const { startApp } = await import('../../app.js');
|
|
291
295
|
await startApp();
|
|
292
296
|
return;
|
|
293
297
|
}
|
|
298
|
+
out(hideCursor);
|
|
294
299
|
process.on('SIGINT', () => shutdown(0));
|
|
295
300
|
process.on('SIGTERM', () => shutdown(0));
|
|
296
|
-
process.stdin.setRawMode(true);
|
|
297
|
-
process.stdin.resume();
|
|
298
|
-
out(hideCursor);
|
|
299
301
|
try {
|
|
300
302
|
app = await buildApp(); // opens the DB + runs migrations
|
|
301
303
|
await app.ready();
|