Skip to content

fix(0.6.1): dashboard SDK version auto-derives from package.json#94

Open
nicolotognoni wants to merge 1 commit into
feat/observability-otel-attrs-0.6.1from
fix/0.6.1-dashboard-version-auto-derive
Open

fix(0.6.1): dashboard SDK version auto-derives from package.json#94
nicolotognoni wants to merge 1 commit into
feat/observability-otel-attrs-0.6.1from
fix/0.6.1-dashboard-version-auto-derive

Conversation

@nicolotognoni
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hardcoded const SDK_VERSION = '0.6.0' literal in dashboard-app/src/App.tsx with a build-time __SDK_VERSION__ global injected by Vite from libraries/typescript/package.json.
  • Same wiring added to vitest.config.ts so tests that touch App.tsx resolve the symbol against the same source of truth.
  • Regenerated dashboard bundle synced into both SDKs (libraries/typescript/src/dashboard/ui.html, libraries/python/getpatter/dashboard/ui.html); both now embed 0.6.1.

Implementation

  • dashboard-app/vite.config.ts and dashboard-app/vitest.config.ts read libraries/typescript/package.json at config-load time and inject __SDK_VERSION__ via Vite's define.
  • dashboard-app/src/vite-env.d.ts (new) declares the global so TypeScript strict mode is satisfied (tsc --noEmit clean).
  • dashboard-app/src/App.tsx swaps '0.6.0' for __SDK_VERSION__ with a doc comment explaining the source of truth.
  • The TS SDK package.json is already bumped in lockstep with the Python pyproject.toml and __init__.py per 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.0 to 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 -u0.6.1 only.
  • cd libraries/typescript && npm run build — clean.
  • CI: Python + TS test matrices + secret scan green.

Docs updates

N/A — the dashboard label is not user-documented; CHANGELOG entry added under ## 0.6.1 (2026-05-12).

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``.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant