-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): implement storybook example
- Loading branch information
Showing
40 changed files
with
135 additions
and
19,341 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-links', | ||
'@storybook/addon-controls', | ||
'storybook-addon-react-docgen', | ||
'storybook-formik/register', | ||
], | ||
webpackFinal: async (baseConfig) => { | ||
const { module = {} } = baseConfig | ||
|
||
// Remove original less loader | ||
baseConfig.module.rules = baseConfig.module.rules.filter( | ||
(f) => f.test.toString() !== '/\\.less$/', | ||
) | ||
|
||
const newConfig = { | ||
...baseConfig, | ||
module: { | ||
...module, | ||
rules: [...(module.rules || [])], | ||
}, | ||
} | ||
|
||
// Less | ||
newConfig.module.rules.push({ | ||
test: /\.less$/, | ||
include: [ | ||
// Include antd to rebuild | ||
/[\\/]node_modules[\\/].*antd/, | ||
path.resolve(__dirname, '../assets/styles'), | ||
], | ||
use: [ | ||
'style-loader', | ||
'css-loader', | ||
{ | ||
loader: 'less-loader', | ||
options: { | ||
javascriptEnabled: true, | ||
}, | ||
}, | ||
], | ||
}) | ||
|
||
//Resolve Alias Module (import absolute path) | ||
newConfig.resolve.modules = [ | ||
...(newConfig.resolve.modules || []), | ||
path.resolve(__dirname, '../'), | ||
path.resolve(__dirname, '../src'), | ||
] | ||
|
||
return newConfig | ||
}, | ||
typescript: { | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
shouldExtractLiteralValuesFromEnum: true, | ||
propFilter: (prop) => { | ||
return !prop.parent | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.