Skip to content

Commit 9a02f4b

Browse files
author
Erik Ritter
authored
Merge pull request #60 from etr2460/erik-ritter--consolidate-storybook
Consolidate storybook and update docs
2 parents 1545e27 + 93bf554 commit 9a02f4b

File tree

9 files changed

+8
-25
lines changed

9 files changed

+8
-25
lines changed

packages/components/.storybook/main.js renamed to .storybook/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ const path = require('path');
33
const toPath = (_path) => path.join(process.cwd(), _path);
44

55
module.exports = {
6-
stories: ['../src/**/*.stories.tsx'],
6+
stories: ['../**/*.stories.tsx'],
77
webpackFinal: async (config) => {
88
return {
99
...config,
1010
resolve: {
1111
...config.resolve,
1212
alias: {
1313
...config.resolve.alias,
14-
'@emotion/core': toPath('../../node_modules/@emotion/react'),
15-
'emotion-theming': toPath('../../node_modules/@emotion/react'),
14+
'@emotion/core': toPath('node_modules/@emotion/react'),
15+
'emotion-theming': toPath('node_modules/@emotion/react'),
1616
},
1717
},
1818
};
File renamed without changes.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ nvm install
1919
yarn install
2020
```
2121

22-
To verify setup, run the Storybook for one of the packages with either `yarn storybook:components` or `yarn storybook:hooks`. You can develop new or existing components and verify functionality in the Storybook.
22+
To verify setup, run the Storybook with `yarn storybook`. You can develop new or existing components/hooks and verify functionality in the Storybook.
2323

2424
Run all unit tests with `yarn test`. Run unit tests on only the package you're working on with `yarn test packages/<PACKAGE_NAME_HERE>`.
2525

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"test": "jest",
2222
"test:watch": "yarn test --watch",
2323
"test:coverage": "jest --coverage --colors",
24-
"storybook:components": "yarn workspace @web3-ui/components storybook",
25-
"storybook:hooks": "yarn workspace @web3-ui/hooks storybook",
24+
"storybook": "start-storybook -p 9001 -s ./packages/components/src/assets -c .storybook",
2625
"postinstall": "preconstruct dev"
2726
},
2827
"devDependencies": {

packages/components/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"build": "preconstruct build",
2222
"format": "prettier --write \"src/**/*.{ts,tsx,json,js,jsx}\"",
2323
"format:check": "prettier --list-different \"src/**/*.{ts,tsx,json,js,jsx}\"",
24-
"storybook": "start-storybook -p 9001 -s ./src/assets -c .storybook",
2524
"pre-commit-hook": "yarn lint-staged"
2625
},
2726
"main": "dist/web3-ui-components.cjs.js",

packages/hooks/.storybook/main.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/hooks/.storybook/preview.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/hooks/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
"test": "jest --maxWorkers=2",
2525
"test:watch": "yarn test --watch",
2626
"test:coverage": "jest --coverage --colors --maxWorkers=2",
27-
"pre-commit-hook": "yarn lint-staged",
28-
"storybook": "start-storybook -p 6006",
29-
"build-storybook": "build-storybook"
27+
"pre-commit-hook": "yarn lint-staged"
3028
},
3129
"main": "dist/web3-ui-hooks.cjs.js",
3230
"module": "dist/web3-ui-hooks.esm.js",

packages/hooks/src/stories/ConnectWallet.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { storiesOf } from '@storybook/react';
22
import React from 'react';
3+
import { Button } from '@chakra-ui/react';
34
import { Provider, useWallet } from '..';
45

56
const Default = () => {
@@ -8,7 +9,7 @@ const Default = () => {
89
if (connected) {
910
return (
1011
<div>
11-
<button onClick={disconnectWallet}>Disconnect wallet</button>
12+
<Button onClick={disconnectWallet}>Disconnect wallet</Button>
1213
<p>{connection.ens || connection.userAddress}</p>
1314
</div>
1415
);

0 commit comments

Comments
 (0)