Skip to content

Commit

Permalink
Merge pull request #456 from sohosai/feat/storybook
Browse files Browse the repository at this point in the history
Storybook導入
  • Loading branch information
masebb authored Feb 7, 2025
2 parents db9859c + 738f471 commit e6b3c71
Show file tree
Hide file tree
Showing 49 changed files with 10,833 additions and 6,227 deletions.
18 changes: 14 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"extends": ["next/core-web-vitals", "prettier", "plugin:jsx-a11y/recommended"],
"plugins": ["unused-imports", "jsx-a11y"],
"extends": [
"next/core-web-vitals",
"prettier",
"plugin:jsx-a11y/recommended",
"plugin:storybook/recommended"
],
"plugins": [
"unused-imports",
"jsx-a11y"
],
"rules": {
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
Expand All @@ -17,8 +25,10 @@
"no-restricted-imports": [
"error",
{
"patterns": ["../*"]
"patterns": [
"../*"
]
}
]
}
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ styled-system-studio
# sentry example
src/app/sentry-example-page
src/app/api/sentry-example-api

*storybook.log
storybook-static
30 changes: 30 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { StorybookConfig } from "@storybook/nextjs";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/nextjs",
options: {},
},
staticDirs: ["../public"],
// https://storybook.js.org/docs/builders/webpack#typescript-modules-are-not-resolved-within-storybook
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: config.resolve.extensions,
}),
];
}
return config;
},
};
export default config;
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";
import "../src/app/globals.css";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading

0 comments on commit e6b3c71

Please sign in to comment.