Skip to content

Commit

Permalink
chore: Update versions ref
Browse files Browse the repository at this point in the history
  • Loading branch information
marikaner committed May 6, 2020
1 parent 5ef35dc commit 2866181
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
3 changes: 2 additions & 1 deletion docs/api/versions.js → docs/api/versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default [
[
"1.19.0",
"1.18.1",
"1.18.0"
]

29 changes: 14 additions & 15 deletions scripts/after-bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ const path = require('path');
const { transformFile, version, jsonStringify, apiDocsDir } = require('./util');

function updateDocumentationMd() {
transformFile(path.resolve('DOCUMENTATION.md'), documentation => documentation.split('\n')
.map(line => line.startsWith('## Version:') ? `## Version: ${version}` : line)
.join('\n')
)
transformFile(path.resolve('DOCUMENTATION.md'), documentation =>
documentation
.split('\n')
.map(line =>
line.startsWith('## Version:') ? `## Version: ${version}` : line
)
.join('\n')
);
}

function updateTypeDocConfig() {
Expand All @@ -19,15 +23,12 @@ function updateTypeDocConfig() {
}

function updateDocsVersions() {
transformFile(
path.resolve('docs', '_data', 'versions.json'),
versionsJson => {
const versions = JSON.parse(versionsJson);
return versions.includes(version)
? versionsJson
: jsonStringify([version, ...versions]);
}
);
transformFile(path.resolve('docs', 'api', 'versions.json'), versionsJson => {
const versions = JSON.parse(versionsJson);
return versions.includes(version)
? versionsJson
: jsonStringify([version, ...versions]);
});
}

const nextChangelogTemplate = [
Expand Down Expand Up @@ -80,8 +81,6 @@ function updateChangelog() {
);
}



function afterBump() {
updateDocumentationMd();
updateTypeDocConfig();
Expand Down

0 comments on commit 2866181

Please sign in to comment.