Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 25bf1ef

Browse files
authored
chore(doc-gen): insert current tagged version if missing from list of all versions
In commit ce49edc, we switched to npm info (now yarn info) instead of the local git repository information to get the list of currently available versions for the docs app. This means that during a release the version that is currently tagged is not yet available on npm, and therefore our list of available versions is incomplete. We now simply add the current build version (read from build/version.json) to the list of all versions if it fulfills the following conditions: - it is not a snapshot build - it is not already part of the list of all versions (i.e. if you are building locally on a tagged commit) Closes #15741 Closes #16099
1 parent 7f2acca commit 25bf1ef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/config/processors/versions-data.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ module.exports = function generateVersionDocProcessor(gitData) {
4747

4848
var latestMap = {};
4949

50+
// When the docs are built on a tagged commit, yarn info won't include the latest release,
51+
// so we add it manually based on the local version.json file.
52+
var missesCurrentVersion = !currentVersion.isSnapshot && !versions.find(function(version) {
53+
return version === currentVersion.version;
54+
});
55+
56+
if (missesCurrentVersion) versions.push(currentVersion.version);
57+
5058
versions = versions
5159
.filter(function(versionStr) {
5260
return blacklist.indexOf(versionStr) === -1;
@@ -70,6 +78,7 @@ module.exports = function generateVersionDocProcessor(gitData) {
7078
})
7179
.reverse();
7280

81+
// List the latest version for each branch
7382
var latest = sortObject(latestMap, reverse(semver.compare))
7483
.map(function(version) { return makeOption(version, 'Latest'); });
7584

0 commit comments

Comments
 (0)