refactor: migrate from tsx to bun as TypeScript runtime

Remove tsx dependency and update all dev scripts and documentation to use bun
as the primary TypeScript runtime for development. Consolidate process detection
logic in daemon.ts to check for dev mode via src/index.ts regardless of runtime.
This commit is contained in:
weishu
2025-12-25 22:13:58 +08:00
parent e9b1f9983d
commit 4314aececd
6 changed files with 66 additions and 65 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
*
* HAPI CLI runs in two modes:
* 1. **Compiled binary**: A single executable built with `bun build --compile`
* 2. **Development mode**: Running TypeScript directly via `tsx` or `bun`
* 2. **Development mode**: Running TypeScript directly via `bun`
*
* ## Execution Modes
*
@@ -15,7 +15,7 @@
* - No additional entrypoint needed - just pass args to `process.execPath`
*
* **Development Mode:**
* - Running via `tsx src/index.ts` or `bun src/index.ts`
* - Running via `bun src/index.ts`
* - Spawn child processes using the same runtime with `src/index.ts` entrypoint
*
* ## Cross-Platform Support
@@ -70,7 +70,7 @@ export function getHappyCliCommand(args: string[]): HappyCliCommand {
};
}
// Node.js with tsx: preserve execArgv (which includes tsx loader)
// Node.js fallback: preserve execArgv (for compatibility)
return {
command: process.execPath,
args: [...process.execArgv, entrypoint, ...args]