Skip to content

[WIP] Update home page version number to match @objectstack/spec - #323

Merged
hotlong merged 3 commits into
mainfrom
copilot/update-version-number-display
Jan 27, 2026
Merged

hotlong merged 3 commits into
mainfrom
copilot/update-version-number-display

Conversation

Copilot AI commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Plan: Update Homepage Version Display

  • Create a utility to import @objectstack/spec version from package.json
  • Update homepage-i18n.ts to use the dynamic version instead of hardcoded values
  • Verify the version is correctly displayed on both English and Chinese homepages
  • Test the build to ensure no errors
  • Optimize to use a constant instead of function calls (code review feedback)

Changes Made

  1. Created /apps/docs/lib/version.ts - Exports SPEC_VERSION constant that reads the version from @objectstack/spec package.json once at module initialization
  2. Updated /apps/docs/lib/homepage-i18n.ts:
    • Imported SPEC_VERSION constant
    • Changed English version from hardcoded v0.3.3 (Draft) to SPEC_VERSION (returns v0.4.1)
    • Changed Chinese version from hardcoded v1.0 to SPEC_VERSION (returns v0.4.1)
  3. Build verified successfully - version v0.4.1 now appears in the homepage badge

The homepage now automatically displays the correct version from @objectstack/spec package (v0.4.1) instead of hardcoded values. The version is computed once at module initialization for optimal performance.

Original prompt

官网首页显示的版本号应该对应 @objectstack/spec 的版本号


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel

vercel Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 27, 2026 11:55am

Request Review

Copilot AI and others added 2 commits January 27, 2026 11:50
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@hotlong
hotlong marked this pull request as ready for review January 27, 2026 11:54
Copilot AI review requested due to automatic review settings January 27, 2026 11:54
@hotlong
hotlong merged commit e77b1d6 into main Jan 27, 2026
5 checks passed
Copilot AI requested a review from hotlong January 27, 2026 11:55
Copilot stopped work on behalf of hotlong due to an error January 27, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_VERSION constant that derives v{version} from the spec package’s package.json.
  • Updated homepage i18n translations (EN/CN) to use SPEC_VERSION for 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.

Comment thread apps/docs/lib/version.ts
Comment on lines +7 to +13
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}`;

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

This branch was successfully deployed

1 active deployment
Preview — 95e47521 Deployed Jan 27, 2026 by vercel[bot]
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.

3 participants