-
Notifications
You must be signed in to change notification settings - Fork 0
[QNRR 299] storybook 환경 재설정 #93
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
Closed
The head ref may contain hidden characters: "QNRR-299-Storybook-\uD658\uACBD-\uC7AC\uC124\uC815-\uC5F0\uD658"
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
60a3c33
fix: Storybook 메이저 버전 업데이트
yeonhwan 6d83821
fix: Badge.stories 수정 및 Badge 컴포넌트 리팩토링
yeonhwan bd1e17f
fix: Button.stories 수정 및 Button 컴포넌트 리팩토링
yeonhwan 6715057
fix: Chip.stories 수정
yeonhwan 36b5d12
fix: Chip-input.stories 수정
yeonhwan 60e4735
fix: Dropdown.stories 수정
yeonhwan 04c96f9
fix: Input.stories 수정
yeonhwan ef0932a
fix: Table.stories 수정 및 Tablelist 관련 컴포넌트 수정
yeonhwan 304c2c5
fix: Toggle.stories 수정
yeonhwan d00cdb5
fix: Calendar.stories 수정 및 msw 추가
yeonhwan dd64608
feat: widget/banner.stories 추가 vite-plugin-svgr 추가
yeonhwan 40e6071
fix: MSW, Vitest 관련 Storybook 환경설정 정리
yeonhwan 7278441
fix: cookie 함수 관련 서버환경 체킹 과정 수정
yeonhwan cc0b346
fix: ui/table 리팩토링과정중 충돌부분 원상태로 복구
yeonhwan c4a7e00
feat: widget/banner.stories 수정 및 추가작업
yeonhwan 19d2cf8
feat: widget/home/header.stories 추가
yeonhwan 780c510
feat: widget/home/sidebar.stories 추가 및 원 컴포넌트 리팩토링
yeonhwan 18a9241
feat: widget/home/study-list-table.stories 추가 및 기존 study-list-table 충…
yeonhwan 345d627
feat: widget/home/todo-list.stories 추가
yeonhwan f2e81f9
feat: widget/my-page/profileinfo-card.stories 추가
yeonhwan a8e9673
feat: widget/my-page/sidebar.stories 추가
yeonhwan f251062
feat: widget/my-study-card.stories 추가
yeonhwan f0dc429
chore: 기존의 banner.storeis 위치 변경 및 삭제
yeonhwan 9c16f61
chore: 필요없는 주석 및 console.log 제거
yeonhwan 0a1aec6
chore: 필요없는 mockServiceWorker 중복파일 제거
yeonhwan cd97aea
fix: shared/table-list 관련 수정 및 디폴트 분기 적용
yeonhwan 34985fa
chore: calendar.stories 필요 없는 주석 대체
yeonhwan ebfaaaf
refactor: modal.stories meta 정보 추가 및 리팩토링
yeonhwan 9b81b6c
chore: toggle.stories 주석 추가
yeonhwan fffb39d
fix: widgets/home/header.stories 제거
yeonhwan 635dfa9
fix: sidebar.tsx studyApplied 옵셔널체이닝 추가 및 story 파일에 변수 추가
yeonhwan 975065a
fix: storybook msw addon에 정적에셋 경로 제외로 경고 억제
yeonhwan 93c9271
fix: storybook 의 워닝 및 에러 로그 제거 및 msw 연결
yeonhwan 3cce062
fix: rebase 충돌 해결 및 디폴트 값 관련 오류 처리
yeonhwan 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
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 |
|---|---|---|
| @@ -1,27 +1,53 @@ | ||
| import type { StorybookConfig } from '@storybook/experimental-nextjs-vite'; | ||
| import { mergeConfig } from 'vite'; | ||
| import path from 'path'; | ||
| import type { StorybookConfig } from '@storybook/nextjs-vite'; | ||
| import svgr from 'vite-plugin-svgr'; | ||
|
|
||
| const config: StorybookConfig = { | ||
| stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
| stories: [ | ||
| '../stories/**/*.mdx', | ||
| '../src/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
| ], | ||
| addons: [ | ||
| '@storybook/addon-essentials', | ||
| '@chromatic-com/storybook', | ||
| '@storybook/experimental-addon-test', | ||
| '@storybook/addon-docs', | ||
| 'msw-storybook-addon', | ||
| '@storybook/addon-vitest' | ||
| ], | ||
| framework: { | ||
| name: '@storybook/experimental-nextjs-vite', | ||
| name: '@storybook/nextjs-vite', | ||
| options: {}, | ||
| }, | ||
| staticDirs: ['../public'], | ||
| async viteFinal(config) { | ||
| return mergeConfig(config, { | ||
| resolve: { | ||
| alias: { | ||
| '@': path.resolve(__dirname, '../src'), | ||
| }, | ||
| }, | ||
| staticDirs: ['../public', '../public/mock/'], | ||
| viteFinal: (config) => { | ||
| // SVGR plugin이 Storybook 내 Vite 번들링에 사용되도록 추가 | ||
| config.plugins = [...(config.plugins || []), svgr({ include: /\.svg$/ })]; | ||
|
|
||
| // nextjs-vite 내에서 SVGR 이 작동하도록 plugin 동작 수정 | ||
| // 출처: https://github.com/ygkn/storybook-nextjs-vite-svgr/blob/main/.storybook/main.ts | ||
| config.plugins = config.plugins!.flat().map((plugin) => { | ||
| if ( | ||
| typeof plugin === 'object' && | ||
| plugin !== null && | ||
| 'name' in plugin && | ||
| plugin.name === 'vite-plugin-storybook-nextjs-image' | ||
| ) { | ||
| return { | ||
| ...plugin, | ||
| resolveId(id, importer) { | ||
| if (id.endsWith('.svg')) { | ||
| return null; | ||
| } | ||
|
|
||
| // @ts-expect-error `resolveId` hook of vite-plugin-storybook-nextjs-image is a function | ||
| return plugin.resolveId(id, importer); | ||
| }, | ||
| }; | ||
| } | ||
| return plugin; | ||
| }); | ||
|
|
||
| config.plugins = [...config.plugins]; | ||
|
|
||
| return config; | ||
| }, | ||
| }; | ||
| 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
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 |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| import { beforeAll } from 'vitest'; | ||
| import { setProjectAnnotations } from '@storybook/experimental-nextjs-vite'; | ||
| import { setProjectAnnotations } from '@storybook/nextjs-vite'; | ||
| import * as projectAnnotations from './preview'; | ||
|
|
||
| // This is an important step to apply the right configuration when testing your stories. | ||
| // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations | ||
| const project = setProjectAnnotations([projectAnnotations]); | ||
| const annotaions = setProjectAnnotations([projectAnnotations]); | ||
|
|
||
| // Run Storybook's beforeAll hook | ||
| beforeAll(annotaions.beforeAll); | ||
|
|
||
| beforeAll(project.beforeAll); |
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.
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.
이 부분이랑 연관된 내용으로 보입니다!
어떤 이유로 warning 로깅이 되었는지, url 화이트리스트로 했으면 로깅이 안남는건지 궁금합니다.
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.
저 부분은 제가 추가한 코드입니다!
디폴트 동작을 완전히 제거할 경우 혹시 모를 상황이 생길까봐 남겨둔 뒤 정규표현식으로 파악되는 에셋 요청들만 제거했습니다.