bug(cli): TUI displays hardcoded version "0.0.0" instead of actual semver #199

Closed
opened 2026-03-17 02:24:39 +00:00 by jason.woltje · 0 comments
Owner

Description

The TUI top bar displays v0.0.0 as the version. This is hardcoded in app.tsx rather than read from the package version.

Location

  • packages/cli/src/tui/app.tsx:314 — passes version="0.0.0" as a literal string to <TopBar>
  • packages/cli/src/tui/components/top-bar.tsx:85 — renders v{version}
  • packages/cli/package.json — also has "version": "0.0.0"

Fix

Two things need to happen:

  1. package.json version — set to the actual release version (or managed by a release tool like changesets/release-please)

  2. app.tsx — read the version dynamically instead of hardcoding:

// Option A: import from package.json (requires resolveJsonModule or a createRequire shim for ESM)
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { version } = require("../../package.json") as { version: string };

// Option B: inject at build time via define/env
const version = process.env["MOSAIC_CLI_VERSION"] ?? "0.0.0-dev";

Then pass the resolved value to <TopBar version={version} />.

## Description The TUI top bar displays `v0.0.0` as the version. This is hardcoded in `app.tsx` rather than read from the package version. ## Location - `packages/cli/src/tui/app.tsx:314` — passes `version="0.0.0"` as a literal string to `<TopBar>` - `packages/cli/src/tui/components/top-bar.tsx:85` — renders `v{version}` - `packages/cli/package.json` — also has `"version": "0.0.0"` ## Fix Two things need to happen: 1. **`package.json` version** — set to the actual release version (or managed by a release tool like changesets/release-please) 2. **`app.tsx`** — read the version dynamically instead of hardcoding: ```typescript // Option A: import from package.json (requires resolveJsonModule or a createRequire shim for ESM) import { createRequire } from "node:module"; const require = createRequire(import.meta.url); const { version } = require("../../package.json") as { version: string }; // Option B: inject at build time via define/env const version = process.env["MOSAIC_CLI_VERSION"] ?? "0.0.0-dev"; ``` Then pass the resolved value to `<TopBar version={version} />`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#199