Skip to content

Commit

Permalink
Merge pull request #27 from primus-teoSprint/feat/#26
Browse files Browse the repository at this point in the history
[#26] storybook 세팅
  • Loading branch information
03hoho03 authored May 18, 2024
2 parents 3227681 + 1a0f0cb commit 5197482
Show file tree
Hide file tree
Showing 33 changed files with 16,328 additions and 1,947 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

*storybook.log
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx.cmd lint-staged
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 path from 'path'

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'@storybook/addon-styling'
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['..\\public'],
webpackFinal:async (config) =>{
if(config.resolve) {
config.resolve.alias = {
...config.resolve?.alias,
'@':path.resolve(__dirname,'../src'),
}
}

return config
}
}
export default config
27 changes: 27 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Preview } from '@storybook/react'
import { withThemeFromJSXProvider } from '@storybook/addon-styling'
import GlobalStyle from '../src/styles/GlobalStyle'


const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
nextjs: {
appDirectory: true
},
},
}

export const decorators = [
withThemeFromJSXProvider({
GlobalStyles: GlobalStyle
})
]

export default preview
Loading

0 comments on commit 5197482

Please sign in to comment.