Skip to content

Derive the browser-mode version from package.json instead of a hand-edited literal #705

Description

@enaboapps

Surfaced by review of #704.

browserState.version in src/api.ts is a hand-maintained copy of the package.json version. It is what the browser/jsdom fallback path reports (used by npm run tauri dev UI work and by the tests), so every release preparation must remember to edit it, and the release workflow's Verify source versions step does not cover it: a missed bump ships silently and shows the previous version in the sidebar badge and the Updates panel under that path.

Fix

Inject it at build time so the bump cannot be missed:

// vite.config.ts
import pkg from "./package.json";
export default defineConfig({ define: { __APP_VERSION__: JSON.stringify(pkg.version) }, ... });
// src/api.ts
version: __APP_VERSION__,

with a declare const __APP_VERSION__: string; in a .d.ts. That reduces each release bump to the files CI already verifies. The tests/config.rs literal is deliberately left alone: it pins the promoted identity and fails on drift, which is its job.

Deliberately not folded into #704, which stays a pure version sync like every previous release preparation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions