fix(cli): exit on Ctrl+C during hyperframes dev

The SIGINT handlers that were meant to do graceful cleanup (close server,
remove symlinks) override Node's default exit behavior. If the cleanup
hangs (e.g. server.close() blocked by open connections), the process is
stuck and Ctrl+C does nothing.

Fix: don't intercept SIGINT at all. Node's default behavior exits the
process immediately on Ctrl+C. The OS reclaims the port and file handles.
Use process.on("exit") for best-effort symlink cleanup instead.

Also fixes running the CLI via `tsx` in dev mode — __CLI_VERSION__ is a
tsup build-time define that crashes at runtime without a fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-03-27 06:35:41 +00:00
co-authored by Claude Opus 4.6
parent 2915b68633
commit 89beb95a87
2 changed files with 25 additions and 41 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
declare const __CLI_VERSION__: string;
export const VERSION = __CLI_VERSION__;
declare const __CLI_VERSION__: string | undefined;
export const VERSION = typeof __CLI_VERSION__ !== "undefined" ? __CLI_VERSION__ : "0.0.0-dev";