Skip to content

Commit

Permalink
docs(storybook): Upgrade to 6.0.12 (#418)
Browse files Browse the repository at this point in the history
* docs(storybook): Upgrade to 6.0.12

* Use built-in Typescript support
* Convert to Typescript for config files
* Change Modal exported types from index.ts to silence storybook
warnings.
  • Loading branch information
ahobson authored Aug 19, 2020
1 parent 0849a30 commit 65d91cc
Show file tree
Hide file tree
Showing 5 changed files with 755 additions and 1,624 deletions.
25 changes: 8 additions & 17 deletions .storybook/main.js → .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
const path = require('path')

const webpackConfig = (config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
include: path.resolve(__dirname, '../src'),
use: [
{
loader: 'awesome-typescript-loader',
},
{
loader: 'react-docgen-typescript-loader',
options: {
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
},
],
})
config.resolve.extensions.push('.ts', '.tsx')

config.module.rules = config.module.rules.filter(
(rule) => rule.test.toString() !== '/\\.css$/'
)
Expand Down Expand Up @@ -57,6 +40,14 @@ const webpackConfig = (config) => {
module.exports = {
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-docs', '@storybook/addon-viewport'],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
},
webpackFinal: async (config) => {
return webpackConfig(config)
},
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/preset-react": "^7.10.4",
"@storybook/addon-docs": "^5.3.19",
"@storybook/addon-docs": "^6.0.12",
"@storybook/addon-viewport": "^6.0.12",
"@storybook/react": "^5.3.19",
"@storybook/react": "^6.0.12",
"@storybook/storybook-deployer": "^2.8.6",
"@testing-library/jest-dom": "^5.3.0",
"@testing-library/react": "^10.0.1",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export {
Overlay,
ModalContainer,
connectModal,
ConnectedModalProps,
useModal,
ModalHook,
} from './components/Modal/Modal'

// Types and interfaces should be exported separately
export type { ConnectedModalProps, ModalHook } from './components/Modal/Modal'
Loading

0 comments on commit 65d91cc

Please sign in to comment.