Skip to content

Commit f599f8f

Browse files
committed
fix(tui): guard Bun runtime plugin support
1 parent b201022 commit f599f8f

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎packages/tui/package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
"bun": "./src/editor-zed-sqlite.bun.ts",
7373
"node": "./src/editor-zed-sqlite.node.ts",
7474
"default": "./src/editor-zed-sqlite.bun.ts"
75+
},
76+
"#runtime-plugin-support": {
77+
"bun": "./src/plugin/runtime-plugin-support.bun.ts",
78+
"node": "./src/plugin/runtime-plugin-support.node.ts",
79+
"default": "./src/plugin/runtime-plugin-support.node.ts"
7580
}
7681
},
7782
"dependencies": {

‎packages/tui/src/plugin/context.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { fileURLToPath, pathToFileURL } from "url"
1616
import type { Context, Dialog, Page, Slot, SlotMap, SlotName, Toast } from "@opencode-ai/plugin/tui/context"
1717
import { createStore, produce, reconcile as reconcileStore } from "solid-js/store"
1818
import { useRenderer } from "@opentui/solid"
19-
import { ensureRuntimePluginSupport } from "@opentui/solid/runtime-plugin-support/configure"
19+
import "#runtime-plugin-support"
2020
import { useConfig } from "../config"
2121
import { useClient } from "../context/client"
2222
import { useData } from "../context/data"
@@ -37,8 +37,6 @@ import { abbreviateHome } from "../util/path-format"
3737
import { builtins } from "./builtins"
3838
import { discoverTuiPlugins } from "./discovery"
3939

40-
ensureRuntimePluginSupport()
41-
4240
export interface PackageResolver {
4341
readonly resolve: (spec: string) => Promise<string | undefined>
4442
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ensureRuntimePluginSupport } from "@opentui/solid/runtime-plugin-support/configure"
2+
3+
ensureRuntimePluginSupport()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// OpenTUI's runtime plugin transform uses Bun's plugin API. Node loads precompiled plugins without it.

0 commit comments

Comments
 (0)