feat: Bun single-file executable distribution (#819)

* feat: add Bun single-file executable distribution

- Add 7 platform packages for standalone CLI binaries
- Add bin/platform.js for shared platform detection
- Add bin/oh-my-opencode.js ESM wrapper
- Add postinstall.mjs for binary verification
- Add script/build-binaries.ts for cross-compilation
- Update publish workflow for multi-package publishing
- Add CI guard against @ast-grep/napi in CLI
- Add unit tests for platform detection (12 tests)
- Update README to remove Bun runtime requirement

Platforms supported:
- macOS ARM64 & x64
- Linux x64 & ARM64 (glibc)
- Linux x64 & ARM64 (musl/Alpine)
- Windows x64

Closes #816

* chore: remove unnecessary @ast-grep/napi CI check

* chore: gitignore compiled platform binaries

* fix: use require() instead of top-level await import() for Bun compile compatibility

* refactor: use static ESM import for package.json instead of require()
This commit is contained in:
Kenny
2026-01-15 10:33:07 -05:00
committed by GitHub
parent 72a3975799
commit c67ca8275e
26 changed files with 695 additions and 30 deletions
+1 -1
View File
@@ -8,8 +8,8 @@ import type { InstallArgs } from "./types"
import type { RunOptions } from "./run"
import type { GetLocalVersionOptions } from "./get-local-version/types"
import type { DoctorOptions } from "./doctor"
import packageJson from "../../package.json" with { type: "json" }
const packageJson = await import("../../package.json")
const VERSION = packageJson.version
const program = new Command()
+1 -1
View File
@@ -10,8 +10,8 @@ import {
addProviderConfig,
detectCurrentConfig,
} from "./config-manager"
import packageJson from "../../package.json" with { type: "json" }
const packageJson = await import("../../package.json")
const VERSION = packageJson.version
const SYMBOLS = {