MDS-Web-UI
React component library, used in MDS-Accounts, MDS-Home, actions-web, and flow-web.
Storybook: https://mds-web-ui-storybook.netlify.com/
About
This project is published to NPM as the following packages:
- @bonobolabs/mds-web-ui - uses react-router links (for MDS-Accounts)
- @bonobolabs/mds-web-ui-gatsby - uses gatsby links (for MDS-home)
- @bonobolabs/mds-web-ui-reach - for @reach/router (for actions-web and flow-web)
It is packaged using babel
, using one of three scripts in the package.json:
"build": "babel src/ -d lib --copy-files",
"build-gatsby": "NODE_ENV=gatsby babel src/ -d gatsby --copy-files",
"build-reach": "NODE_ENV=reach babel src/ -d reach --copy-files",
The NODE_ENV is read by the babel config, which swaps out the ReactRouterLink
import with GatsbyLink
(for the gatsby build) and ReachRouterLink
(for the @reach/router
build).
Dev
Install deps:
yarn
Install peers: (so elegant)
node -e "const peers = Object.entries(require('./package.json').peerDependencies || {}).map(d => d.join('@')).join(' '); if (peers.length) process.stdout.write('yarn add -P --no-lockfile ' + String(peers));" | sh
Run locally:
yarn storybook
Publishing
yarn build
yarn publish --access=public
Publish the Gatsby version
yarn build-gatsby
cd gatsby
yarn publish --access=public
Publish the @reach/router version
yarn build-reach
cd reach
yarn publish --access=public