Disco UI
Install in your app
npm install --save disco-ui react
yarn add disco-ui react
Development
Local development alongside your app
If you wish to work on the Disco UI library while importing it into your own app, you can do so for instance using npm link
or yarn link
.
Set up the Disco UI repo:
git clone https://github.com/discoxyz/disco-ui.git
yarn install
yarn link
yarn run watch
In your app you can then run:
yarn link disco-ui
Your app will now use your local copy of Disco UI and should receive any changes as you make them.
Standalone Disco UI development
If you wish to work on the Disco UI library directly, you can do so without another app:
git clone https://github.com/discoxyz/disco-ui.git
cd disco-ui
yarn install
yarn run install-peer-deps
You can now run yarn run storybook
to work on individual components, or yarn run server:start
to run the example create-react-app app.
Note that once you have run install-peer-deps
in your local Disco UI library, if you are also linking it to your app then your app will end up with duplicate copies of Disco UI's package.json
's peerDependencies
, and so React will probably break. To resolve this, you will have to link these dependencies: navigate to <your-app>/node_modules/<peer-dep>
and run yarn link
, repeat for all peer dependencies, and then return to the disco-ui
directory and run yarn link-peer-deps
. See this article for more context. Note that these will have to be re-linked if node_modules
gets deleted.