Skip to content

Commit

Permalink
Merge pull request #7 from YAPP-Github/init/4
Browse files Browse the repository at this point in the history
[ Init/4 ] 스토리북 초기 환경 구축
  • Loading branch information
soomin9106 authored Jun 3, 2024
2 parents a749e2d + d98a588 commit 4b6a9f2
Show file tree
Hide file tree
Showing 34 changed files with 6,631 additions and 120 deletions.
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/(.*)$"
],
[
"^[./]",
".*"
]
]
}
]
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: [
'../src/stories/**/*.mdx',
'../src/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

0 comments on commit 4b6a9f2

Please sign in to comment.