feat(tui): render Mermaid diagrams as terminal images (#6320)
* feat(tui): render Mermaid diagrams as terminal images * perf(tui): streamline Mermaid rendering and resource ownership * fix(tui): clarify diagram navigation hints * fix(tui): release viewer layout leases and retain retry targets * docs(tui): keep Mermaid guide focused on usage
This commit is contained in:
1 parent
9b5d552f40
commit
9adbcc2cef
31 files changed
+1983
-21
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { join } from "node:path"
|
||||
|
||||
const packagesByTarget: Record<string, string[]> = {
|
||||
"darwin-arm64": ["@opentui/core-darwin-arm64"],
|
||||
"darwin-x64": ["@opentui/core-darwin-x64"],
|
||||
"linux-arm64": ["@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl"],
|
||||
"linux-x64": ["@opentui/core-linux-x64", "@opentui/core-linux-x64-musl"],
|
||||
"win32-x64": ["@opentui/core-win32-x64"],
|
||||
"darwin-arm64": ["@opentui/core-darwin-arm64", "@resvg/resvg-js-darwin-arm64"],
|
||||
"darwin-x64": ["@opentui/core-darwin-x64", "@resvg/resvg-js-darwin-x64"],
|
||||
"linux-arm64": ["@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@resvg/resvg-js-linux-arm64-gnu", "@resvg/resvg-js-linux-arm64-musl"],
|
||||
"linux-x64": ["@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@resvg/resvg-js-linux-x64-gnu", "@resvg/resvg-js-linux-x64-musl"],
|
||||
"win32-x64": ["@opentui/core-win32-x64", "@resvg/resvg-js-win32-x64-msvc"],
|
||||
}
|
||||
|
||||
const target = process.argv[2]
|
||||
@@ -15,9 +15,11 @@ if (!packages) throw new Error(`unsupported target: ${target}`)
|
||||
|
||||
const root = join(import.meta.dir, "..")
|
||||
const manifest = await Bun.file(join(root, "package.json")).json()
|
||||
const version = manifest.dependencies?.["@opentui/core"]
|
||||
if (typeof version !== "string" || !/^\d+\.\d+\.\d+$/.test(version)) {
|
||||
throw new Error("@opentui/core must use an exact version")
|
||||
const versions: Record<string, string> = {}
|
||||
for (const name of ["@opentui/core", "@resvg/resvg-js"]) {
|
||||
const version = manifest.dependencies?.[name]
|
||||
if (typeof version !== "string" || !/^\d+\.\d+\.\d+$/.test(version)) throw new Error(`${name} must use an exact version`)
|
||||
versions[name] = version
|
||||
}
|
||||
|
||||
const npm = process.platform === "win32" ? "npm.cmd" : "npm"
|
||||
@@ -29,7 +31,7 @@ const result = Bun.spawnSync(
|
||||
"--ignore-scripts",
|
||||
"--force",
|
||||
"--package-lock=false",
|
||||
...packages.map((name) => `${name}@${version}`),
|
||||
...packages.map((name) => `${name}@${versions[name.startsWith("@opentui/") ? "@opentui/core" : "@resvg/resvg-js"]}`),
|
||||
],
|
||||
{
|
||||
cwd: root,
|
||||
|
||||
Reference in new issue
Block a user