-
Notifications
You must be signed in to change notification settings - Fork 1
[Init] Storybook 초기 세팅 #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ac43172
init: Storybook 초기 설정 구성
u-zzn 2b19139
chore: Storybook 도입을 위한 프로젝트 설정 추가
u-zzn cd73ce8
docs: Storybook 사용 가이드 문서 추가
u-zzn efcb62f
feat: 예시 Button 공용 UI 및 Storybook 스토리 추가
u-zzn 75ebaae
chore: pnpm lockfile 동기화
u-zzn 11f6a94
chore: vite-tsconfig-paths 의존성 추가
u-zzn 029b872
feat: Storybook main 설정 추가 및 FSD alias 지원
u-zzn 5bfac51
feat: Storybook preview 전역 파라미터 설정
u-zzn 045ecf2
style: Storybook import type 위치 컨벤션 적용
u-zzn 32538e6
Merge branch 'dev' into init/#11/storybook-init
u-zzn 4fb2058
fix: 빌드 에러 해결 (#11)
odukong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,4 +24,6 @@ dist-ssr | |
| *.sln | ||
| *.sw? | ||
|
|
||
| .env | ||
| .env | ||
| *storybook.log | ||
| storybook-static | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import type { StorybookConfig } from '@storybook/react-vite'; | ||
|
Check warning on line 1 in .storybook/main.ts
|
||
| import { mergeConfig } from 'vite'; | ||
| import tsconfigPaths from 'vite-tsconfig-paths'; | ||
|
|
||
| const config: StorybookConfig = { | ||
| stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
|
|
||
| addons: ['@storybook/addon-docs', '@storybook/addon-a11y'], | ||
|
|
||
| framework: '@storybook/react-vite', | ||
|
|
||
| viteFinal: async (storybookConfig) => | ||
| mergeConfig(storybookConfig, { | ||
| plugins: [tsconfigPaths()], | ||
| }), | ||
|
|
||
| typescript: { | ||
| reactDocgen: 'react-docgen-typescript', | ||
| reactDocgenTypescriptOptions: { | ||
| shouldExtractLiteralValuesFromEnum: true, | ||
| shouldRemoveUndefinedFromOptional: true, | ||
| propFilter: (prop) => !/node_modules/.test(prop.parent?.fileName || ''), | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default config; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Preview } from '@storybook/react-vite'; | ||
|
|
||
| // 나중에 전역 스타일 여기서 import | ||
| // vanilla-extract의 globalStyle / theme entry 여기서 불러옴 | ||
| // 예: import '@/shared/styles/global.css.ts'; | ||
|
|
||
| const preview: Preview = { | ||
| tags: ['autodocs'], | ||
|
|
||
| parameters: { | ||
| layout: 'padded', | ||
|
|
||
| controls: { | ||
| matchers: { | ||
| color: /(background|color)$/i, | ||
| date: /Date$/i, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default preview; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스토리북의 대부분 컴포넌트에서 docs 파일이 생성될 거라면,
preview.ts파일에tags: ["autodocs"]옵션을 미리 추가해주는 것도 좋을 것 같아요🙌🏻