Skip to content

feat: add stable version management for footer display - #1450

Open
JeevanMahesha wants to merge 1 commit into
openng-org:mainfrom
JeevanMahesha:fix/footer-version
Open

feat: add stable version management for footer display#1450
JeevanMahesha wants to merge 1 commit into
openng-org:mainfrom
JeevanMahesha:fix/footer-version

Conversation

@JeevanMahesha

Copy link
Copy Markdown

Description

The docs footer displayed the monorepo's working package.json version directly (require('@/package.json').version), which currently holds an in-progress pre-release identifier like 2.0.0-rc.0. Since the docs site is deployed continuously from main, this meant every page footer showed an unreleased RC version instead of the actual latest stable release published on npm.

Before: footer shows Optimus UI 2.0.0-rc.0
After: footer shows Optimus UI 1.0.1 (the real latest dist-tag for @openng/optimus-ui)

Fix: added a build step (scripts/build-stable-version.mjs) that queries the npm registry for @openng/optimus-ui's latest dist-tag and writes it to assets/data/stable-version.json, which the footer now imports instead of reading package.json directly. Falls back to the local package.json version (stripped of any pre-release suffix) if the registry is unreachable, so the build never fails outright. Wired into the existing build:docs pipeline alongside the other generated-asset scripts (routes, sitemap, etc.).

Related issues

Fixes #1445

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes the public API)
  • Documentation only
  • Refactor, test, or chore (no user-facing change)

Breaking changes

None.

Test plan

  • node apps/docs/scripts/build-stable-version.mjs — confirmed it generates 1.0.1 (npm's current latest dist-tag), not the working 2.0.0-rc.0
  • npx tsc -p apps/docs/tsconfig.json --noEmit — no type errors from the new JSON import
  • npm run build
  • npm test
  • npm run lint
  • Verified footer renders "Optimus UI 1.0.1" instead of "Optimus UI 2.0.0-rc.0"

Checklist

  • Issue discussed or bug clearly described (link issue when applicable)
  • Tests added or updated for behavioral changes
  • Documentation updated (README, JSDoc, migration notes as needed)
  • Public API changes documented; breaking changes called out
  • CHANGELOG updated (if the repository maintains one and the change is user-facing)
  • Commit messages follow Conventional Commits
  • I agree to follow the OpenNG Foundation Code of Conduct

Additional context

The generated assets/data/stable-version.json is committed to the repo, following the same convention as other build-generated docs assets (public/sitemap.xml, router/routes.txt) — it gets refreshed on the next build:docs run whenever a new stable version is published to npm.

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.

[Docs]: Pages show unreleased version at the bottom

1 participant