Docs/storybook improvements (#877)

* docs: use PageDecorator

* docs: use decorators in TableHeader stories

* docs: use theming parameter in App stories

* docs: enable auto-generated docs for stories

Closes #702
This commit is contained in:
Thaïs
2023-07-24 20:06:37 +02:00
committed by GitHub
parent 07180af8c0
commit c16d420d17
23 changed files with 339 additions and 342 deletions

View File

@ -1,63 +1,73 @@
const path = require('path');
module.exports = {
webpackFinal: config => {
webpackFinal: (config) => {
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
use: [{
loader: require.resolve('babel-loader'),
options: {
presets: [require('@babel/preset-typescript').default, [require('@babel/preset-react').default, {
runtime: 'automatic'
}], require('@babel/preset-env').default]
}
}]
use: [
{
loader: require.resolve('babel-loader'),
options: {
presets: [
require('@babel/preset-typescript').default,
[
require('@babel/preset-react').default,
{
runtime: 'automatic',
},
],
require('@babel/preset-env').default,
],
},
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
type: 'javascript/auto',
});
config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack'
loader: '@svgr/webpack',
},
{
loader: 'file-loader',
options: {
name: 'static/media/[path][name].[ext]'
}
}
name: 'static/media/[path][name].[ext]',
},
},
],
type: 'javascript/auto',
issuer: {
and: [/\.(ts|tsx|js|jsx|md|mdx)$/]
}
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
},
});
config.resolve.extensions.push('.mjs');
config.resolve.alias = {
...config.resolve.alias,
'~': path.resolve(__dirname, "../src"),
'@': path.resolve(__dirname, "../src/modules"),
'~': path.resolve(__dirname, '../src'),
'@': path.resolve(__dirname, '../src/modules'),
};
return config;
},
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-coverage",
"@storybook/addon-styling",
"storybook-addon-pseudo-states",
"storybook-addon-cookie",
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-coverage',
'@storybook/addon-styling',
'storybook-addon-pseudo-states',
'storybook-addon-cookie',
],
docs: { autodocs: true },
framework: {
name: '@storybook/react-webpack5',
options: {}
options: {},
},
};
};