GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — opencode-workflows/scripts/build-tui.ts at main · rphang/opencode-workflows

Expand file tree

/

build-tui.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
41 lines (38 loc) · 1.48 KB
/

build-tui.ts

Copy path

File metadata and controls

41 lines (38 loc) · 1.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Builds the TUI entry (src/tui/index.tsx) into one precompiled ESM file, dist/tui.js (X14).
//
// opencode's TUI swaps in its own copies of solid-js, @opentui/* and @opencode/plugin/tui for
// plugins, including those under node_modules, but it does NOT JSX-transform files under
// node_modules. So the JSX is compiled here with @opentui/solid's Babel transform (Solid "universal"
// mode, module @opentui/solid), and every host-provided module stays external: the bundle ships no
// copy of solid-js or opentui, only our own code (src/tui plus the host-agnostic src/client it uses,
// which is bundled in).
import path from "node:path"
import { createSolidTransformPlugin } from "@opentui/solid/bun-plugin"
/** Modules the TUI host provides at runtime; never bundled. */
export const TUI_EXTERNALS = [
"solid-js",
"solid-js/store",
"@opentui/core",
"@opentui/solid",
"@opentui/keymap",
"@opencode/plugin",
"@opencode/plugin/tui",
]
export async function buildTui(outdir: string): Promise<string> {
const root = path.resolve(import.meta.dir, "..")
const result = await Bun.build({
entrypoints: [path.join(root, "src", "tui", "index.tsx")],
outdir,
naming: "tui.js",
target: "bun",
format: "esm",
external: TUI_EXTERNALS,
plugins: [createSolidTransformPlugin()],
sourcemap: "none",
minify: false,
})
if (!result.success) {
throw new Error(`TUI build failed:\n${result.logs.map((l) => String(l)).join("\n")}`)
}
return path.join(outdir, "tui.js")
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.