Skip to content
Permalink
Browse files

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
  • Loading branch information
Narretz committed Jul 12, 2017
1 parent 7f2acca commit 25bf1ef07cc76116ce77a5727c97c7597bfc480b
Showing with 9 additions and 0 deletions.
  1. +9 −0 docs/config/processors/versions-data.js
@@ -47,6 +47,14 @@ module.exports = function generateVersionDocProcessor(gitData) {

var latestMap = {};

// When the docs are built on a tagged commit, yarn info won't include the latest release,
// so we add it manually based on the local version.json file.
var missesCurrentVersion = !currentVersion.isSnapshot && !versions.find(function(version) {
return version === currentVersion.version;
});

if (missesCurrentVersion) versions.push(currentVersion.version);

versions = versions
.filter(function(versionStr) {
return blacklist.indexOf(versionStr) === -1;
@@ -70,6 +78,7 @@ module.exports = function generateVersionDocProcessor(gitData) {
})
.reverse();

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

0 comments on commit 25bf1ef

Please sign in to comment.
You can’t perform that action at this time.