feat(framework): log version, build date and git hash on startup#237
Merged
Conversation
…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().
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-237Or pin to the exact commit: npm install @vc-shell/framework@2.0.7-pr237.2bccbc6Published packages (dist-tag
|
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.
What & why
Apps built on
@vc-shell/frameworkhad 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:
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.ts—getFrameworkBuildInfo()reads the build-time constants with a"dev"fallback;logFrameworkBuildInfo()prints the banner.vite.config.mts— injects__VC_SHELL_VERSION__(frompackage.json),__VC_SHELL_BUILD_DATE__and__VC_SHELL_GIT_HASH__(git short hash,"unknown"outside a git repo) via Vitedefine.typings/build-constants.d.ts— ambient declarations (not shipped to consuming apps).index.ts— callslogFrameworkBuildInfo()as the first statement ininstall().Edge cases
"unknown"."dev", no errors (typeofguard).Verification
yarn typecheck— clean.buildInfo.test.ts— 2/2 passing.yarn build:framework+ confirmed the real version/date/hash are substituted intodist/framework.js(no raw__VC_SHELL_*__placeholders remain).