Skip to content

Commit 59b9a13

Browse files
Cheticclaude
andcommitted
fix: dynamically resolve OpenTUI version in bundle packager
The OpenTUI native library path was hardcoded to version 0.1.74, which broke CI when a different version was installed. Use Bun.Glob to find the installed version at build time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 90ce22c commit 59b9a13

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

script/package-offline-bundle.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ async function createBundle(buildDir: string): Promise<void> {
6868
console.log("Copying dependencies...")
6969
await $`cp -r ${DEPS_DIR}/* ${path.join(BUNDLE_DIR, "deps")}/`
7070

71-
// Copy OpenTUI native library
71+
// Copy OpenTUI native library (glob for installed version)
7272
console.log("Copying OpenTUI native library...")
73-
const opentuiSoPath = "node_modules/.bun/@opentui+core-linux-x64@0.1.74/node_modules/@opentui/core-linux-x64/libopentui.so"
73+
const opentuiGlob = new Bun.Glob("node_modules/.bun/@opentui+core-linux-x64@*/node_modules/@opentui/core-linux-x64/libopentui.so")
74+
const opentuiMatches = Array.from(opentuiGlob.scanSync({ dot: true }))
75+
if (opentuiMatches.length === 0) {
76+
throw new Error("Could not find OpenTUI native library - ensure @opentui/core-linux-x64 is installed")
77+
}
78+
const opentuiSoPath = opentuiMatches[0]
79+
console.log(`Found OpenTUI at: ${opentuiSoPath}`)
7480
await fs.mkdir(path.join(BUNDLE_DIR, "deps", "opentui"), { recursive: true })
7581
await fs.copyFile(opentuiSoPath, path.join(BUNDLE_DIR, "deps", "opentui", "libopentui.so"))
7682

0 commit comments

Comments
 (0)