fix(0.6.1): dashboard SDK version auto-derives from package.json#94
Open
nicolotognoni wants to merge 1 commit into
Open
Conversation
The dashboard topbar and footer rendered a hardcoded ``const SDK_VERSION = '0.6.0'`` literal in ``dashboard-app/src/App.tsx``. After the SDK was bumped to 0.6.1, the dashboard kept advertising ``dashboard · v0.6.0`` / ``SDK · 0.6.0`` until someone remembered to edit that literal — silent drift between the published package and the UI users see. Fix: ``dashboard-app/vite.config.ts`` (plus matching ``vitest.config.ts``) reads ``libraries/typescript/package.json`` at build time and injects the version through Vite's ``define`` as a ``__SDK_VERSION__`` global, declared in the new ``dashboard-app/src/vite-env.d.ts``. The TS SDK's ``package.json`` is already kept in lockstep with the Python ``pyproject.toml`` and ``__init__.py`` per the release-via-pr rule, so a single bump now flows into the bundled dashboard without a second manual edit. Regenerated bundle synced into ``libraries/typescript/src/dashboard/ui.html`` and ``libraries/python/getpatter/dashboard/ui.html``; both now embed ``0.6.1``. Files: ``dashboard-app/src/App.tsx``, ``dashboard-app/vite.config.ts``, ``dashboard-app/vitest.config.ts``, ``dashboard-app/src/vite-env.d.ts``, ``libraries/typescript/src/dashboard/ui.html``, ``libraries/python/getpatter/dashboard/ui.html``.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
const SDK_VERSION = '0.6.0'literal indashboard-app/src/App.tsxwith a build-time__SDK_VERSION__global injected by Vite fromlibraries/typescript/package.json.vitest.config.tsso tests that touchApp.tsxresolve the symbol against the same source of truth.libraries/typescript/src/dashboard/ui.html,libraries/python/getpatter/dashboard/ui.html); both now embed0.6.1.Implementation
dashboard-app/vite.config.tsanddashboard-app/vitest.config.tsreadlibraries/typescript/package.jsonat config-load time and inject__SDK_VERSION__via Vite'sdefine.dashboard-app/src/vite-env.d.ts(new) declares the global so TypeScript strict mode is satisfied (tsc --noEmitclean).dashboard-app/src/App.tsxswaps'0.6.0'for__SDK_VERSION__with a doc comment explaining the source of truth.package.jsonis already bumped in lockstep with the Pythonpyproject.tomland__init__.pyper the release-via-pr rule, so a single bump flows into the dashboard with no second manual edit.Breaking change?
No. Pure surface bug fix — the rendered string changes from
0.6.0to whatever the current package version is.Test plan
cd dashboard-app && npm run build— clean (tsc + vite).cd dashboard-app && npm test -- --run— 8/8 pass.cd dashboard-app && npm run sync— bundle copied into both SDKs.grep -oE '0\.6\.[0-9]+' libraries/typescript/src/dashboard/ui.html | sort -u→0.6.1only.cd libraries/typescript && npm run build— clean.Docs updates
N/A — the dashboard label is not user-documented; CHANGELOG entry added under
## 0.6.1 (2026-05-12).