feat: add stable version management for footer display - #1450
Open
JeevanMahesha wants to merge 1 commit into
Open
feat: add stable version management for footer display#1450JeevanMahesha wants to merge 1 commit into
JeevanMahesha wants to merge 1 commit into
Conversation
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.
Description
The docs footer displayed the monorepo's working
package.jsonversion directly (require('@/package.json').version), which currently holds an in-progress pre-release identifier like2.0.0-rc.0. Since the docs site is deployed continuously frommain, 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.0After: footer shows
Optimus UI 1.0.1(the reallatestdist-tag for@openng/optimus-ui)Fix: added a build step (
scripts/build-stable-version.mjs) that queries the npm registry for@openng/optimus-ui'slatestdist-tag and writes it toassets/data/stable-version.json, which the footer now imports instead of readingpackage.jsondirectly. Falls back to the localpackage.jsonversion (stripped of any pre-release suffix) if the registry is unreachable, so the build never fails outright. Wired into the existingbuild:docspipeline alongside the other generated-asset scripts (routes, sitemap, etc.).Related issues
Fixes #1445
Type of change
Breaking changes
None.
Test plan
node apps/docs/scripts/build-stable-version.mjs— confirmed it generates1.0.1(npm's currentlatestdist-tag), not the working2.0.0-rc.0npx tsc -p apps/docs/tsconfig.json --noEmit— no type errors from the new JSON importnpm run buildnpm testnpm run lintChecklist
Additional context
The generated
assets/data/stable-version.jsonis 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 nextbuild:docsrun whenever a new stable version is published to npm.