From 89fac01903016925653a14951962e93a78e73062 Mon Sep 17 00:00:00 2001 From: hypnos Date: Thu, 28 Dec 2017 02:00:42 +0300 Subject: [PATCH 1/4] Docs: fix logos display --- docs/src/components/Homepage/UsedBy/index.jsx | 6 ++-- docs/src/pages/_users.yml | 30 +++++++++---------- docs/src/pages/index.jsx | 5 ++++ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/docs/src/components/Homepage/UsedBy/index.jsx b/docs/src/components/Homepage/UsedBy/index.jsx index abf772575312..8a2e96faa940 100644 --- a/docs/src/components/Homepage/UsedBy/index.jsx +++ b/docs/src/components/Homepage/UsedBy/index.jsx @@ -37,18 +37,18 @@ UsedByBg.defaultProps = { style: {}, }; -const User = ({ logo, demo, site, title }) => ( +const User = ({ logoSrc, demo, site, title }) => ( - {title} + {title} ); User.propTypes = { - logo: PropTypes.string.isRequired, + logoSrc: PropTypes.string.isRequired, demo: PropTypes.string, site: PropTypes.string.isRequired, title: PropTypes.string, diff --git a/docs/src/pages/_users.yml b/docs/src/pages/_users.yml index 067cbf4d54ad..607da089eb37 100644 --- a/docs/src/pages/_users.yml +++ b/docs/src/pages/_users.yml @@ -1,84 +1,84 @@ airbnb: - logo: ./logos/airbnb.svg + logo: airbnb.svg title: Airbnb Dates description: An internationalizable, mobile-friendly datepicker library for the web. source: https://github.com/airbnb/react-dates demo: http://airbnb.io/react-dates/ site: http://airbnb.com slack: - logo: ./logos/slack.svg + logo: slack.svg title: Slack Emoji Picker description: Slack improves performance and maintainability with Storybook! demo: https://slack.engineering/rebuilding-slacks-emoji-picker-in-react-bfbd8ce6fbfe site: http://slack.com lonelyplanet: - logo: ./logos/lonelyplanet.svg + logo: lonelyplanet.svg title: Lonely Planet description: All the tools you need to build the Lonely Planet UI experience. source: https://github.com/lonelyplanet/backpack-ui demo: https://lonelyplanet.github.io/backpack-ui/ site: https://www.lonelyplanet.com/ squarespace: - logo: ./logos/squarespace.png + logo: squarespace.png title: Squarespace description: Component design and development at Squarespace site: http://squarespace.com dbsbank: - logo: ./logos/dbsbank.svg + logo: dbsbank.svg title: DBS Bank description: DBS Bank consumer products improves performance and maintainability with Storybook! site: https://www.dbs.com coursera: - logo: ./logos/coursera.svg + logo: coursera.svg title: Coursera description: Coursera UI component library site: https://building.coursera.org/ui/ # buffer: -# logo: ./logos/buffer.svg +# logo: buffer.svg # title: Buffer Components # description: A collection of Buffer UI React components. # source: https://github.com/bufferapp/buffer-components # demo: https://bufferapp.github.io/buffer-components/ # site: https://buffer.com # wix: -# logo: ./logos/wix.svg +# logo: wix.svg # title: Wix # description: React component library for all Wix verticals # demo: https://wix.github.io/wix-style-react/ # source: https://github.com/wix/wix-style-react # source2: https://github.com/wix/react-native-storybook-example/ # algolia: -# logo: ./logos/algolia.svg +# logo: algolia.svg # title: Algolia Instantsearch # description: Lightning-fast, hyper-configurable search. # source: https://github.com/algolia/react-instantsearch/ # demo: https://community.algolia.com/react-instantsearch/storybook/ # mozilla: -# logo: ./logos/mozilla.svg +# logo: mozilla.svg # title: Mozilla Foundation # site: https://mozilla.org # remitly: -# logo: ./logos/remitly.svg +# logo: remitly.svg # title: Remitly # site: https://remitly.com # nulogy: -# logo: ./logos/nulogy.png +# logo: nulogy.png # title: Nulogy # description: SaaS for Supply Chain # site: https://nulogy.com # postmates: -# logo: ./logos/postmates.png +# logo: postmates.png # title: Quran.com # site: https://postmates.com # appbase: -# logo: ./logos/appbase.svg +# logo: appbase.svg # title: Appbase Maps # description: A storybook playground for ReactiveMaps and ReactiveSearch. # source: https://github.com/appbaseio/playground # demo: https://opensource.appbase.io/playground/ # site: https://appbase.io # quran: -# logo: ./logos/quran.svg +# logo: quran.svg # title: Quran.com # description: Component library for Quran.com, Quranicaudio.com and Salah.com. # source: https://github.com/quran/common-components diff --git a/docs/src/pages/index.jsx b/docs/src/pages/index.jsx index d0f4d51e8ce1..212a3c21dee5 100644 --- a/docs/src/pages/index.jsx +++ b/docs/src/pages/index.jsx @@ -3,4 +3,9 @@ import { values } from 'lodash'; import Homepage from '../components/Homepage'; import users from './_users.yml'; +const usersArray = values(users); +usersArray.forEach(user => { + user.logoSrc = require(`./logos/${user.logo}`); +}); + export default () => ; From b65b00d3eb11d90acff6d360dc39eb17ef6342b5 Mon Sep 17 00:00:00 2001 From: hypnos Date: Thu, 28 Dec 2017 02:01:11 +0300 Subject: [PATCH 2/4] Docs: add an empty babelrc --- docs/.babelrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/.babelrc diff --git a/docs/.babelrc b/docs/.babelrc new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/docs/.babelrc @@ -0,0 +1 @@ +{} From c458e758c0d4298b8490f3c2bda2875537b05a43 Mon Sep 17 00:00:00 2001 From: hypnos Date: Thu, 28 Dec 2017 02:09:46 +0300 Subject: [PATCH 3/4] Docs: don't install root dependencies on CI --- .circleci/config.yml | 22 ++++++---------------- scripts/repo-dirty-check.js | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c77e6a729f14..2d2af36ff743 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,29 +137,19 @@ jobs: steps: - checkout - restore_cache: - name: "Restore core dependencies cache" - keys: - - core-dependencies-{{ checksum "yarn.lock" }} - - restore_cache: - name: "Restore docs dependencies cache" + name: "Restore dependencies cache" keys: - docs-dependencies-{{ checksum "docs/yarn.lock" }} - - run: - name: "Install core dependencies" - command: | - yarn install - run: name: "Install dependencies" command: | - yarn bootstrap --docs - - run: - name: "Dirty check" - command: | - yarn repo-dirty-check + cd docs + yarn install --frozen-lockfile - run: - name: "Run docs" + name: "Build docs" command: | - yarn docs:build + cd docs + yarn build - save_cache: name: "Cache dependencies" key: docs-dependencies-{{ checksum "docs/yarn.lock" }} diff --git a/scripts/repo-dirty-check.js b/scripts/repo-dirty-check.js index 02d921e459f8..c20889132d84 100644 --- a/scripts/repo-dirty-check.js +++ b/scripts/repo-dirty-check.js @@ -4,7 +4,7 @@ const shell = require('shelljs'); // exit with code 1 if there are some changed files if (shell.exec('git status --porcelain').stdout.trim() !== '') { console.error( - 'Git repo is dirty, please consider updating lockfiles by running `yarn bootstrap --reset --core --docs`' + 'Git repo is dirty, please consider updating lockfiles by running `yarn bootstrap --reset --core`' ); process.exit(1); } From fcd387a281e125a6d28beb1868d49e3b14e483ef Mon Sep 17 00:00:00 2001 From: hypnos Date: Thu, 28 Dec 2017 02:26:55 +0300 Subject: [PATCH 4/4] Fix lint errors --- docs/src/pages/index.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/src/pages/index.jsx b/docs/src/pages/index.jsx index 212a3c21dee5..a7b097ddcbf0 100644 --- a/docs/src/pages/index.jsx +++ b/docs/src/pages/index.jsx @@ -3,9 +3,10 @@ import { values } from 'lodash'; import Homepage from '../components/Homepage'; import users from './_users.yml'; -const usersArray = values(users); -usersArray.forEach(user => { - user.logoSrc = require(`./logos/${user.logo}`); -}); +const usersArray = values(users).map(user => ({ + ...user, + // eslint-disable-next-line import/no-dynamic-require, global-require + logoSrc: require(`./logos/${user.logo}`), +})); -export default () => ; +export default () => ;