fix(ci): install all platform opentui bindings for cross-compilation#193
Conversation
bun build --compile cross-compiles for each target platform, which
resolves the dynamic import @opentui/core-${platform}-${arch} at
build time. Install all platform-specific packages so the bundler
can resolve them for every target.
PR Review: fix(ci): install cross-platform opentui bindings for buildSummaryThis PR adds a step to install all platform-specific Code Quality ✅The change is minimal and focused - exactly 6 lines added to solve a specific problem. The step is well-named and clearly describes its purpose. Potential Issues
|
Summary
Fixes build failures when cross-compiling binaries for multiple platforms in the publish workflow. The workflow now installs all platform-specific
@opentui/core-*native bindings before runningbun build --compilefor each target platform.Problem
When using
bun build --compile --target=bun-<platform>-<arch>to cross-compile for non-host platforms, Bun resolves dynamic imports like@opentui/core-${platform}-${arch}at build time (not runtime). The build was failing with:because only the host platform's native bindings were installed by default.
Solution
@opentui/core-darwin-x64@0.1.79@opentui/core-darwin-arm64@0.1.79@opentui/core-linux-x64@0.1.79@opentui/core-linux-arm64@0.1.79@opentui/core-win32-x64@0.1.79@opentui/core-win32-arm64@0.1.79This ensures the bundler can resolve all platform imports when compiling for each target.
Test plan