Skip to content

Commit 43df0ff

Browse files
feat: basic storybook setup
1 parent 855b46c commit 43df0ff

File tree

7 files changed

+8181
-1586
lines changed

7 files changed

+8181
-1586
lines changed

packages/react/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
3-
extends: ['standard', 'standard-react', 'plugin:@typescript-eslint/eslint-recommended'],
3+
extends: ['standard', 'standard-react', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:storybook/recommended'],
44
env: {
55
node: true
66
},

packages/react/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ playground/node_modules
55
coverage
66
src/react-app-env.d.ts
77
*.tgz
8+
9+
*storybook.log

packages/react/.storybook/main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
// const { build } = require("@storybook/core-server");
4+
// const options = {};
5+
// build(options).then(() => console.log("done"));
6+
7+
const config: StorybookConfig = {
8+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
9+
addons: [
10+
'@storybook/addon-webpack5-compiler-swc',
11+
// '@storybook/addon-onboarding',
12+
'@storybook/addon-essentials',
13+
'@chromatic-com/storybook',
14+
'@storybook/addon-interactions'
15+
],
16+
framework: {
17+
name: '@storybook/react-webpack5',
18+
options: {}
19+
}
20+
};
21+
export default config;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Preview } from '@storybook/react';
2+
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i
9+
}
10+
}
11+
}
12+
};
13+
14+
export default preview;

0 commit comments

Comments
 (0)