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

chore(doc-gen): insert current tagged version if missing from list of… #16099

Merged
merged 1 commit into from
Jul 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/config/processors/versions-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'); });

Expand Down