From 53c92cdc3f4e5abd863f323d28de4a70da5f2905 Mon Sep 17 00:00:00 2001 From: Sylvain Gougouzian Date: Mon, 13 Jul 2026 21:28:34 +0200 Subject: [PATCH] feat(tui): show package version in the header --- src/tui/components/Header.tsx | 2 ++ src/version.ts | 4 ++++ tsconfig.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 src/version.ts diff --git a/src/tui/components/Header.tsx b/src/tui/components/Header.tsx index a76a338..176f16e 100644 --- a/src/tui/components/Header.tsx +++ b/src/tui/components/Header.tsx @@ -1,6 +1,7 @@ import { basename } from "node:path"; import { Box, Text } from "ink"; import type { Model } from "../../types"; +import { VERSION } from "../../version"; import { symbols, t } from "../theme"; interface HeaderProps { @@ -16,6 +17,7 @@ export function Header({ model, modelCount }: HeaderProps) { 🏄 paikea + {VERSION} {symbols.divider} {symbols.gear} {model?.name ?? "none"} diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..640a3e4 --- /dev/null +++ b/src/version.ts @@ -0,0 +1,4 @@ +import pkg from "../package.json"; + +// Bundled into the compiled binary at build time (Bun inlines JSON imports). +export const VERSION: string = pkg.version; diff --git a/tsconfig.json b/tsconfig.json index b2e7497..88cafdf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ // Bundler mode "moduleResolution": "bundler", + "resolveJsonModule": true, "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, "noEmit": true, -- 2.51.2