feat(cli): add Bun single executable binary support

Enables building hapi as standalone Bun-compiled executables for macOS,
Linux, and Windows (x64/arm64). Adds build script, bootstrap entry point,
runtime asset management, and automatic deployment of bundled tools
(ripgrep, difftastic). Includes MCP stdio bridge support and proper
environment handling for compiled binaries. Updates documentation with
build and installation instructions for single executable distribution.
This commit is contained in:
weishu
2025-12-20 21:41:11 +08:00
parent bf18224d05
commit 17eeba10d6
28 changed files with 605 additions and 238 deletions
+3 -1
View File
@@ -62,6 +62,8 @@
"why do we need to build before running tests / dev?": "We need the binary to be built so we run daemon commands which directly run the binary - we don't want them to go out of sync or have custom spawn logic depending how we started happy",
"typecheck": "tsc --noEmit",
"build": "shx rm -rf dist && tsc --noEmit && pkgroll",
"build:exe": "bun run scripts/build-executable.ts",
"build:exe:all": "bun run scripts/build-executable.ts --all",
"test": "bun run build && tsx --env-file .env.integration-test node_modules/.bin/vitest run",
"test:win": "bun run build && vitest run",
"start": "bun run build && ./bin/happy.mjs",
@@ -87,9 +89,9 @@
"ink": "^6.5.1",
"ps-list": "^8.1.1",
"react": "^19.2.0",
"react-devtools-core": "^7.0.1",
"socket.io-client": "^4.8.1",
"tar": "^7.5.2",
"tmp": "^0.2.5",
"zod": "^3.23.8"
},
"devDependencies": {