Skip to content
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

[ Init/4 ] 스토리북 초기 환경 구축 #7

Merged
merged 8 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 44 additions & 14 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"plugin:react/recommended",
"next",
"next/core-web-vitals",
"prettier"
"prettier",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -35,19 +36,48 @@
"warn",
{
"groups": [
["^next", "^next(.*)$"],
["^react", "^react(.*)$"],
["^@tanstack(.*)$"],
["^[a-zA-Z/-]+$"],
["^@api/(.*)$"],
["^@components/(.*)$"],
["^@hooks/(.*)$"],
["^@constants/(.*)$"],
["^@styles/(.*)$"],
["^@lib/(.*)$"],
["^@utils/(.*)$"],
["^@types/(.*)$"],
["^[./]", ".*"]
[
"^next",
"^next(.*)$"
],
[
"^react",
"^react(.*)$"
],
[
"^@tanstack(.*)$"
],
[
"^[a-zA-Z/-]+$"
],
[
"^@api/(.*)$"
],
[
"^@components/(.*)$"
],
[
"^@hooks/(.*)$"
],
[
"^@constants/(.*)$"
],
[
"^@styles/(.*)$"
],
[
"^@lib/(.*)$"
],
[
"^@utils/(.*)$"
],
[
"^@types/(.*)$"
],
[
"^[./]",
".*"
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 왜 우리 저장되는 형식이 다를까..? prettier가 다른가요..?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier 안돌렸나보네용 ㅠㅠ 돌리고 확인해볼게요!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soomin9106 lint에러 발생했네요! 프리티어랑 같이 봐주세요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" 때문에 에러 났네용 ㅠㅠ 확인해서 커밋하구 머지 할게용

]
}
]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install

- name: Build storybook
run: pnpm run build-storybook
- name: Run Jest Test
run: pnpm test
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
21 changes: 21 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: [
'../stories/**/*.mdx',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
};
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 "../app/globals.css";

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

export default preview;
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"start": "next start",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@radix-ui/react-slot": "^1.0.2",
Expand All @@ -25,6 +27,15 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.5.0",
"@storybook/addon-essentials": "^8.1.5",
"@storybook/addon-interactions": "^8.1.5",
"@storybook/addon-links": "^8.1.5",
"@storybook/addon-onboarding": "^8.1.5",
"@storybook/blocks": "^8.1.5",
"@storybook/nextjs": "^8.1.5",
"@storybook/react": "^8.1.5",
"@storybook/test": "^8.1.5",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
Expand All @@ -39,10 +50,13 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-unused-imports": "^4.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"postcss": "^8",
"prettier": "^3.3.0",
"storybook": "^8.1.5",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"typescript": "^5"
Expand Down
Loading
Loading