Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split versions.json into two files #5896

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions docs/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ function pagesToSitemap(pages) {
}));
}

function getVersionData(distTag) {
const versionFile = `${__dirname}/src/versions/${distTag}.json`;
if (!fs.existsSync(versionFile)) {
return null;
}
const data = {
[distTag]: JSON.parse(fs.readFileSync(versionFile)),
};
return data;
}

function generateVersionsFile() {
const latest = getVersionData('latest');
const next = getVersionData('next');
const data = { ...latest, ...next };
fs.writeFileSync(`${__dirname}/public/versions.json`, JSON.stringify(data));
}

function generateSitemap(pages) {
const sitemap = sm.createSitemap({
hostname: 'https://storybook.js.org',
Expand All @@ -36,6 +54,7 @@ module.exports = {
}
}
`);
generateVersionsFile();
generateSitemap(result.data.allSitePage.edges.map(({ node }) => node));
},
onCreateNode({ node, boundActionCreators, getNode }) {
Expand Down
6 changes: 6 additions & 0 deletions docs/src/versions/latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "5.0.0",
"info": {
"plain": "Storybook 5.0 is a completely new UI with the following improvements:\n\n- 🌓 New design with light and dark themes\n- 🛠 Canvas toolbar for easy access to addons\n- 🗺 Overhauled navigation sidebar with an intuitive menu\n- 🗜 Redesigned addons panel with handy buttons to toggle visibility and orientation\n- ⌨️ Improved keyboard shortcuts that are user configurable\n- 🌍 New URL structure that eliminates long strings of query parameters\n\n5.0 contains hundreds more fixes, features, and tweaks. Browse the changelogs matching `5.0.0-alpha.*`, `5.0.0-beta.*`, and `5.0.0-rc.*` for the full list of changes. See [MIGRATION.md](https://github.com/storybooks/storybook/blob/next/MIGRATION.md) to ugprade from `4.x`."
}
}
6 changes: 6 additions & 0 deletions docs/src/versions/next.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "5.1.0-alpha.0",
"info": {
"plain": "### Features\n\n* UI: Custom scrollbars ([#5714](https://github.com/storybooks/storybook/pull/5714))\n\n### Bug Fixes\n\n* Fix: Move `react-select` dependency to 2.2 ([#5867](https://github.com/storybooks/storybook/pull/5867))\n\n### Maintenance\n\n* Cleanup unused dependencies ([#5453](https://github.com/storybooks/storybook/pull/5453))\n* Add directory attribute to repositories in package.json files ([#5643](https://github.com/storybooks/storybook/pull/5643))\n\n### Dependency Upgrades\n\n* Project-wide dependency upgrades ([#5740](https://github.com/storybooks/storybook/pull/5740))\n* Bump react-is from 16.8.1 to 16.8.3 ([#5743](https://github.com/storybooks/storybook/pull/5743))\n* Bump danger from 7.0.13 to 7.0.14 ([#5744](https://github.com/storybooks/storybook/pull/5744))\n* Bump babel-plugin-named-asset-import from 0.3.0 to 0.3.1 ([#5745](https://github.com/storybooks/storybook/pull/5745))\n* Bump eslint-plugin-json from 1.3.2 to 1.4.0 ([#5719](https://github.com/storybooks/storybook/pull/5719))\n* Bump react-native-modal-datetime-picker from 5.1.0 to 6.0.0 ([#4425](https://github.com/storybooks/storybook/pull/4425))\n* Bump immer from 1.12.0 to 2.0.0 ([#5694](https://github.com/storybooks/storybook/pull/5694))\n* Bump danger from 7.0.11 to 7.0.13 ([#5696](https://github.com/storybooks/storybook/pull/5696))\n* Bump eslint-plugin-jsx-a11y from 6.2.0 to 6.2.1 ([#5698](https://github.com/storybooks/storybook/pull/5698))\n* Bump @angular/platform-browser-dynamic from 7.2.4 to 7.2.6 ([#5697](https://github.com/storybooks/storybook/pull/5697))\n* Bump eslint from 5.12.1 to 5.14.1 ([#5653](https://github.com/storybooks/storybook/pull/5653))\n* Bump babel-preset-react-app from 7.0.0 to 7.0.1 ([#5674](https://github.com/storybooks/storybook/pull/5674))\n* Bump react from 16.8.1 to 16.8.2 ([#5673](https://github.com/storybooks/storybook/pull/5673))\n* Bump @angular/cli from 7.3.0 to 7.3.2 ([#5654](https://github.com/storybooks/storybook/pull/5654))\n* Bump @types/jest from 24.0.0 to 24.0.6 ([#5655](https://github.com/storybooks/storybook/pull/5655))\n* Bump lint-staged from 8.1.3 to 8.1.4 ([#5606](https://github.com/storybooks/storybook/pull/5606))\n* Bump @types/lodash from 4.14.120 to 4.14.121 ([#5609](https://github.com/storybooks/storybook/pull/5609))\n* Bump webpack from 4.29.0 to 4.29.3 ([#5570](https://github.com/storybooks/storybook/pull/5570))\n* update modal manager for rn 0.58 support ([#5581](https://github.com/storybooks/storybook/pull/5581))\n* Bump danger from 7.0.7 to 7.0.11 ([#5568](https://github.com/storybooks/storybook/pull/5568))\n* Bump jest-jasmine2 from 24.0.0 to 24.1.0 ([#5569](https://github.com/storybooks/storybook/pull/5569))\n* Bump jest-jasmine2 from 24.0.0 to 24.1.0 ([#5567](https://github.com/storybooks/storybook/pull/5567))\n* Bump handlebars from 4.0.12 to 4.1.0 ([#5576](https://github.com/storybooks/storybook/pull/5576))\n* Bump esm from 3.2.1 to 3.2.4 ([#5556](https://github.com/storybooks/storybook/pull/5556))\n* Bump @types/jest from 23.3.13 to 24.0.0 ([#5554](https://github.com/storybooks/storybook/pull/5554))\n* Bump webpack-dev-middleware from 3.5.1 to 3.5.2 ([#5552](https://github.com/storybooks/storybook/pull/5552))\n* Bump @emotion/core from 10.0.6 to 10.0.7 ([#5555](https://github.com/storybooks/storybook/pull/5555))\n* Bump terser-webpack-plugin from 1.2.1 to 1.2.2 ([#5553](https://github.com/storybooks/storybook/pull/5553))\n* Bump fuse.js from 3.3.1 to 3.4.2 ([#5538](https://github.com/storybooks/storybook/pull/5538))\n* Bump @angular/platform-browser-dynamic from 7.2.3 to 7.2.4 ([#5540](https://github.com/storybooks/storybook/pull/5540))\n* Bump emotion-theming from 10.0.6 to 10.0.7 ([#5541](https://github.com/storybooks/storybook/pull/5541))\n* Bump eslint-config-prettier from 3.6.0 to 4.0.0 ([#5539](https://github.com/storybooks/storybook/pull/5539))"
}
}
1 change: 0 additions & 1 deletion docs/static/versions.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/versions.json

This file was deleted.