From 943331dfd09009de0d310a34a1f25cdabee34809 Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:33:43 -0700 Subject: [PATCH] Tweak release script to update both `website`'s and `src-docs`'s versions.json (#7941) Co-authored-by: Tomasz Kajtoch --- packages/eui/scripts/release.js | 8 +++++++- packages/eui/scripts/update-versions-log.js | 6 +++--- packages/website/static/versions.json | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/eui/scripts/release.js b/packages/eui/scripts/release.js index d3d7f5b1595..79c73780a80 100644 --- a/packages/eui/scripts/release.js +++ b/packages/eui/scripts/release.js @@ -129,7 +129,13 @@ const hasStep = (step) => { await updateTokenChangelog(versionTarget); // Update version switcher data and changelog - if (!isSpecialRelease) updateDocsVersionSwitcher(versionTarget); + if (!isSpecialRelease) { + updateDocsVersionSwitcher(versionTarget); + + // TODO: Remove this once EUI is fully on the new website and src-docs has been removed + const oldEuiDocsVersions = cwd + '/src-docs/src/components/guide_page/versions.json'; + updateDocsVersionSwitcher(versionTarget, oldEuiDocsVersions); + } updateChangelog(changelog, versionTarget); execSync('git commit -m "Updated changelog" -n'); diff --git a/packages/eui/scripts/update-versions-log.js b/packages/eui/scripts/update-versions-log.js index ed3d4f53541..106aec782f1 100644 --- a/packages/eui/scripts/update-versions-log.js +++ b/packages/eui/scripts/update-versions-log.js @@ -3,14 +3,14 @@ const fs = require('fs'); const { execSync } = require('child_process'); const rootDir = path.resolve(__dirname, '..'); -const versionsLogFile = - rootDir + '/src-docs/src/components/guide_page/versions.json'; +const websiteDir = path.resolve(__dirname, '../../website'); +const versionsLogFile = path.join(websiteDir, '/static/versions.json'); /** * Writes to the above `versions.json` file (which is what the docs version switcher * uses to generate its list of versions) with the latest release * - * To test locally, run `node -e "require('./scripts/update-versions-log')('vX.Y.Z')"` + * To test locally, run `node -e "require('./scripts/update-versions-log').updateDocsVersionSwitcher('vX.Y.Z')"` */ const updateDocsVersionSwitcher = (versionToAdd, file = versionsLogFile) => { if (!versionToAdd) { diff --git a/packages/website/static/versions.json b/packages/website/static/versions.json index 9912ea21288..7bd0e5c9566 100644 --- a/packages/website/static/versions.json +++ b/packages/website/static/versions.json @@ -1,5 +1,6 @@ { "euiVersions": [ + "95.5.0", "95.4.0", "95.3.0", "95.2.0",