Skip to content

Commit

Permalink
Ensure upcoming releases page is synchronized across branches (#90)
Browse files Browse the repository at this point in the history
Co-authored-by: Zac Bergquist <[email protected]>
  • Loading branch information
ptgott and zmb3 authored Jan 3, 2025
1 parent 3f68d6c commit c5c43ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/prepare-files.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { glob } from "glob";
import { docusaurusifyNavigation } from "../server/config-docs";
import {
getCurrentVersion,
getLatestVersion,
getVersionNames,
getDocusaurusVersions,
} from "../server/config-site";
Expand All @@ -17,6 +18,7 @@ const GET_VERSION_SIDEBAR_FILENAME = (version) =>

const docusaurusVersions = getDocusaurusVersions();
const currentVersion = getCurrentVersion();
const defaultVersion = getLatestVersion();
const versions = getVersionNames();

const writeSidebar = (version: string) => {
Expand Down Expand Up @@ -66,3 +68,14 @@ versions.forEach((version) => {
});

writeVersions();

// Make sure the upcoming releases page is the same on all 3 branches.
const versionsToOverride = getVersionNames().filter(v => v !== defaultVersion);
const defaultUpcomingReleases = resolve("content", defaultVersion, "docs/pages/upcoming-releases.mdx");
versionsToOverride.forEach((version) => {
const destination = version === currentVersion
? resolve("docs", "upcoming-releases.mdx")
: resolve(DOCS_PAGES_ROOT, `version-${version}`, "upcoming-releases.mdx");

copyFileSync(defaultUpcomingReleases, destination);
})

0 comments on commit c5c43ac

Please sign in to comment.