Repository navigation
[WIP] Update home page version number to match @objectstack/spec - #323
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the docs homepage version badge to automatically reflect the current @objectstack/spec version (instead of hardcoded strings), keeping the English and Chinese homepages in sync with the spec package.
Changes:
- Added a
SPEC_VERSIONconstant that derivesv{version}from the spec package’spackage.json. - Updated homepage i18n translations (EN/CN) to use
SPEC_VERSIONfor the badge version display.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/docs/lib/version.ts | Introduces SPEC_VERSION sourced from the spec package metadata. |
| apps/docs/lib/homepage-i18n.ts | Replaces hardcoded badge version strings with SPEC_VERSION for EN/CN. |
| import specPackage from '../../../packages/spec/package.json'; | ||
|
|
||
| /** | ||
| * The current version of @objectstack/spec | ||
| * Computed once at module initialization | ||
| */ | ||
| export const SPEC_VERSION = `v${specPackage.version}`; |
There was a problem hiding this comment.
Importing packages/spec/package.json via a deep relative path hard-codes the monorepo layout and reaches across package boundaries. Consider switching to reading the installed workspace package (e.g., add @objectstack/spec as a dependency and resolve its package root at runtime/build-time) or exposing a version export from @objectstack/spec, so apps/docs doesn’t depend on ../../../packages/... paths.
Plan: Update Homepage Version Display
Changes Made
/apps/docs/lib/version.ts- ExportsSPEC_VERSIONconstant that reads the version from@objectstack/specpackage.json once at module initialization/apps/docs/lib/homepage-i18n.ts:SPEC_VERSIONconstantv0.3.3 (Draft)toSPEC_VERSION(returnsv0.4.1)v1.0toSPEC_VERSION(returnsv0.4.1)v0.4.1now appears in the homepage badgeThe homepage now automatically displays the correct version from
@objectstack/specpackage (v0.4.1) instead of hardcoded values. The version is computed once at module initialization for optimal performance.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.