Skip to content

feat(framework): log version, build date and git hash on startup#237

Merged
maksimzinchuk merged 3 commits into
mainfrom
feat/framework-version-banner
Jun 10, 2026
Merged

feat(framework): log version, build date and git hash on startup#237
maksimzinchuk merged 3 commits into
mainfrom
feat/framework-version-banner

Conversation

@maksimzinchuk

@maksimzinchuk maksimzinchuk commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

What & why

Apps built on @vc-shell/framework had no way to tell which framework version they were compiled against. When debugging (especially in production) it was impossible to quickly see which framework build is baked into the bundle.

The framework now prints a single styled console banner when the plugin installs:

@vc-shell/framework v2.0.7 · 2026-06-10T12:06:56.779Z · aa7b6056a

Version / build date / git hash are baked in at framework build time, so they reflect exactly the framework version the app was built from.

Changes

  • core/utilities/buildInfo.tsgetFrameworkBuildInfo() reads the build-time constants with a "dev" fallback; logFrameworkBuildInfo() prints the banner.
  • vite.config.mts — injects __VC_SHELL_VERSION__ (from package.json), __VC_SHELL_BUILD_DATE__ and __VC_SHELL_GIT_HASH__ (git short hash, "unknown" outside a git repo) via Vite define.
  • typings/build-constants.d.ts — ambient declarations (not shipped to consuming apps).
  • index.ts — calls logFrameworkBuildInfo() as the first statement in install().

Edge cases

  • Build outside a git repo → git hash = "unknown".
  • Dev mode (framework source via alias / Storybook) → values = "dev", no errors (typeof guard).

Verification

  • yarn typecheck — clean.
  • Unit tests buildInfo.test.ts — 2/2 passing.
  • yarn build:framework + confirmed the real version/date/hash are substituted into dist/framework.js (no raw __VC_SHELL_*__ placeholders remain).

…state

All action icons in the expanded mobile toolbar now use the primary
color, matching the topmost button that morphs out of the pill.
Print a single styled console banner ("@vc-shell/framework v<version> ·
<build-date> · <git-hash>") when the framework plugin installs, so apps
can see which framework build they were compiled against — useful for
debugging, including in production.

- core/utilities/buildInfo.ts: getFrameworkBuildInfo() reads build-time
  constants with a "dev" fallback; logFrameworkBuildInfo() prints them.
- vite.config.mts: inject __VC_SHELL_VERSION__ (from package.json),
  __VC_SHELL_BUILD_DATE__ and __VC_SHELL_GIT_HASH__ (git short hash,
  "unknown" outside a repo) via Vite define at framework build time.
- typings/build-constants.d.ts: ambient declarations (not shipped to apps).
- index.ts: call logFrameworkBuildInfo() first thing in install().
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

📦 Preview published for commit 2bccbc6

Install the preview with dist-tag:

npm install @vc-shell/framework@pr-237

Or pin to the exact commit:

npm install @vc-shell/framework@2.0.7-pr237.2bccbc6

Published packages (dist-tag pr-237, version 2.0.7-pr237.2bccbc6):

  • @vc-shell/framework
  • @vc-shell/api-client-generator
  • @vc-shell/create-vc-app
  • @vc-shell/config-generator
  • @vc-shell/migrate
  • @vc-shell/ts-config
  • @vc-shell/mf-config
  • @vc-shell/mf-host
  • @vc-shell/mf-module
  • @vc-shell/vc-app-skill

@maksimzinchuk maksimzinchuk merged commit 6263714 into main Jun 10, 2026
10 checks passed
@maksimzinchuk maksimzinchuk deleted the feat/framework-version-banner branch June 10, 2026 14:16
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