Skip to content

Commit

Permalink
chore: upgrade storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
osslgtm committed Sep 11, 2024
1 parent 9a8bca7 commit ad761b6
Show file tree
Hide file tree
Showing 6 changed files with 4,563 additions and 8,983 deletions.
26 changes: 0 additions & 26 deletions .storybook/main.js

This file was deleted.

22 changes: 20 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import type { StorybookConfig } from "@storybook/react-webpack5"
import * as path from "path";
const toPath = (_path: any) => path.join(process.cwd(), _path);;

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)", "../src/**/*.stories.@(tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"@storybook/addon-webpack5-compiler-babel"
],
framework: {
name: "@storybook/react-webpack5",
options: {},
},
webpackFinal: (config: any) => {
return {
...config,
// https://github.com/storybookjs/storybook/issues/13277#issuecomment-751747964
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
"@emotion/core": toPath("node_modules/@emotion/react"),
"@emotion/styled": toPath("node_modules/@emotion/styled"),
"emotion-theming": toPath("node_modules/@emotion/react"),
},
},
};
},
docs: {
autodocs: true,
},
Expand Down
6 changes: 0 additions & 6 deletions .storybook/preview.js

This file was deleted.

4 changes: 3 additions & 1 deletion .storybook/preview.ts → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { Preview } from "@storybook/react";
import React from "react";
import "../src/main.css";

const preview: Preview = {
decorators: [(storyFn) => <>{storyFn()}</>],
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
Loading

0 comments on commit ad761b6

Please sign in to comment.