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

[11팀 박근백] [Chapter 2-2] 디자인 패턴과 함수형 프로그래밍 #12

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
17a284f
chore: eslint & prettier 적용
Geunbaek Jan 14, 2025
e0f0253
feat: cartUtils 완료
Geunbaek Jan 14, 2025
51c8c91
feat: useCart 훅 완료
Geunbaek Jan 14, 2025
2ba5f0d
feat: useCoupon 훅 완료
Geunbaek Jan 14, 2025
b8fdeda
feat: PickPartial util type 추가
Geunbaek Jan 14, 2025
5cf919b
feat: useProduct 훅 완료
Geunbaek Jan 14, 2025
805d8ea
chore: lint 변경 및 적용
Geunbaek Jan 16, 2025
92fdb05
chore: file name typo
Geunbaek Jan 16, 2025
a1e5717
chore: ci pull_request_target -> pull_request
Geunbaek Jan 16, 2025
ff3b650
Revert "chore: file name typo"
Geunbaek Jan 16, 2025
39a8332
Revert "chore: ci pull_request_target -> pull_request"
Geunbaek Jan 16, 2025
5299a54
feat: advanced 스크립트 추가 & entities 정의 & msw api 모킹
Geunbaek Jan 16, 2025
7b0a718
refactor: CouponSelect 컴포넌트 분리
Geunbaek Jan 16, 2025
a743424
feat: Heading 컴포넌트 분리
Geunbaek Jan 16, 2025
21c6ee4
refactor: CouponList 컴포넌트 분리
Geunbaek Jan 16, 2025
ba4394a
refactor: ProductList 컴포넌트 분리
Geunbaek Jan 16, 2025
715e08c
refactor: CartList 컴포넌트 분리
Geunbaek Jan 16, 2025
229eba1
refactor: ProductForm & CouponManageMent 컴포넌트 분리
Geunbaek Jan 16, 2025
eb7d21b
refactor: ProductManagement 컴포넌트 분리
Geunbaek Jan 16, 2025
c4ce889
refactor: CouponManagement 컴포넌트 props 변경
Geunbaek Jan 16, 2025
d36c39b
refactor: Select 적용
Geunbaek Jan 16, 2025
17de81e
refactor: 컴포넌트 네임 변경 및 ProductEditForm 컴포넌트 분리
Geunbaek Jan 16, 2025
048d565
refactor: newCoupon 상태관리 위치 변경
Geunbaek Jan 16, 2025
066a8ff
chore: zustand 추가
Geunbaek Jan 16, 2025
61a5ead
feat: useCart 훅 및 cart type, lib 추가
Geunbaek Jan 16, 2025
e8fbb6f
refactor: segment 네이밍 변경
Geunbaek Jan 16, 2025
81b8d92
feat: cart lib 메서드 추가
Geunbaek Jan 16, 2025
1b1e514
feat: feature coupon ui 추가 및 model export 변경
Geunbaek Jan 16, 2025
4bce25f
feat: widgets ProductItem ProductList ui 추가
Geunbaek Jan 16, 2025
fde3ced
feat: shared ui 추가
Geunbaek Jan 16, 2025
33755d7
feat: entities product ui, model, lib 추가
Geunbaek Jan 16, 2025
431867e
fix: feature coupon 함수 이름 변경
Geunbaek Jan 16, 2025
e6334a1
feat: features cart lib, ui 추가
Geunbaek Jan 16, 2025
1c78e0f
feat: widgets ui 추가
Geunbaek Jan 16, 2025
18b3862
feat: pages cart ui 추가
Geunbaek Jan 16, 2025
6ec9e6f
feat: AppRouter 적용
Geunbaek Jan 16, 2025
4478245
feat: AdminPage 추가
Geunbaek Jan 16, 2025
90924f0
feat: RootLayout 적용 및 AdminPage 적용
Geunbaek Jan 16, 2025
7d756ee
feat: product 모킹 함수 추가 및 적용
Geunbaek Jan 16, 2025
939ab3f
feat: features product ui 추가
Geunbaek Jan 16, 2025
f4290bd
feat: widgets product ui 추가 및 page admin ui 적용
Geunbaek Jan 16, 2025
e97711f
feat: features coupon model 수정 및 ui 추가
Geunbaek Jan 16, 2025
8e75bb7
feat: widgets coupon ui 추가
Geunbaek Jan 16, 2025
f80c2d0
feat: pages admin ui 추가
Geunbaek Jan 16, 2025
ff20eb9
chore: 파일 이름 오타 수정
Geunbaek Jan 16, 2025
a397004
refactor: 컴포넌트 이름 변경 및 분리
Geunbaek Jan 16, 2025
231c80f
refactor: Input 컴포넌트 분리 및 적용
Geunbaek Jan 16, 2025
d511d0f
refactor: Heading 컴포넌트 적용
Geunbaek Jan 16, 2025
95974a4
feat: Susponse 적용
Geunbaek Jan 16, 2025
6aee2bc
feat: useToggle 훅 추가
Geunbaek Jan 17, 2025
978a5aa
feat: mock 데이터 변경 및 useToggle 테스트 코드 추가
Geunbaek Jan 17, 2025
2eeb9db
refactor: ProductManagementItem 컴포넌트 분리
Geunbaek Jan 17, 2025
94d5c5f
refactor: 사용하지 않는 변수 및 설정 삭제
Geunbaek Jan 17, 2025
ece0506
chore: airbnb ts eslint 제거
Geunbaek Jan 17, 2025
80f0395
fix: advanced 테스트코드
Geunbaek Jan 17, 2025
2e1fa27
fix: advanced 테스트 코드
Geunbaek Jan 17, 2025
dd667c6
fix: advanced 테스트 코드
Geunbaek Jan 17, 2025
d922983
refactor: 불필요한 log, 주석 제거
Geunbaek Jan 17, 2025
62dafee
refactor: useCoupon 훅 추가
Geunbaek Jan 18, 2025
d5fc330
refactor: features product 훅분리
Geunbaek Jan 18, 2025
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
137 changes: 137 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true,
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
],
"rules": {
"prettier/prettier": "error",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/function-component-definition": [
"error",
{
"namedComponents": "function-declaration",
"unnamedComponents": "arrow-function",
},
],
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" },
],
"@typescript-eslint/explicit-function-return-type": "off",
"import/prefer-default-export": "off", // 유틸 함수 내보내기 규칙 맞춤
},
"ignorePatterns": [
"**/dist",
"src/origin/**",
"vite.config.ts",
"**/__tests__/**",
],
"overrides": [
// TypeScript 파일 설정
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": [
"./tsconfig.json",
"./tsconfig.app.json",
"./tsconfig.node.json",
],
},
"plugins": ["@typescript-eslint", "react", "react-hooks"],
"extends": ["plugin:@typescript-eslint/recommended"],
},
{
"files": ["./src/advanced/**/*.{ts,tsx}"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": [
"./tsconfig.json",
"./tsconfig.app.json",
"./tsconfig.node.json",
],
},
"extends": ["@feature-sliced"],
"plugins": ["import", "boundaries"],
},
],
"settings": {
"react": {
"version": "detect",
},
"boundaries/elements": [
{
"type": "app",
"pattern": ["@advanced/app/**", "src/advanced/app/**"],
"mode": "file",
},
{
"type": "processes",
"pattern": ["@advanced/processes/**", "src/advanced/processes/**"],
"mode": "file",
},
{
"type": "pages",
"pattern": ["@advanced/pages/**", "src/advanced/pages/**"],
"mode": "file",
},
{
"type": "widgets",
"pattern": ["@advanced/widgets/**", "src/advanced/widgets/**"],
"mode": "file",
},
{
"type": "features",
"pattern": ["@advanced/features/**", "src/advanced/features/**"],
"mode": "file",
},
{
"type": "entities",
"pattern": ["@advanced/entities/**", "src/advanced/entities/**"],
"mode": "file",
},
{
"type": "shared",
"pattern": ["@advanced/shared/**", "src/advanced/shared/**"],
"mode": "file",
},
{
"type": "tests",
"pattern": ["src/advanced/**/*.test.tsx"],
"mode": "file",
},
],
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": [
"./tsconfig.json",
"./tsconfig.app.json",
"./tsconfig.node.json",
],
},
},
},
}
18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2
}
14 changes: 14 additions & 0 deletions index.advanced.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>장바구니로 학습하는 디자인패턴</title>
<script src="https://unpkg.com/react-scan/dist/auto.global.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 p-8">
<div id="root"></div>
<script type="module" src="/src/advanced/app/main.tsx"></script>
</body>
</html>
30 changes: 26 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,55 @@
"scripts": {
"start:origin": "vite serve --open ./index.origin.html",
"start:refactoring": "vite serve --open ./index.refactoring.html",
"start:advanced": "vite serve --open ./index.advanced.html",
"test": "vitest",
"test:origin": "vitest src/origin",
"test:basic": "vitest src/basic",
"test:advanced": "vitest src/advanced",
"test:ui": "vitest --ui",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
"lint": "eslint ."
},
"dependencies": {
"@tanstack/react-query": "^5.64.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router": "^7.1.1",
"zustand": "^5.0.3"
},
"devDependencies": {
"@feature-sliced/eslint-config": "^0.1.1",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^22.10.7",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/ui": "^2.1.3",
"eslint": "^9.12.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-boundaries": "^5.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-testing-library": "^7.1.1",
"eslint-plugin-vitest": "^0.5.4",
"jsdom": "^26.0.0",
"msw": "^2.7.0",
"prettier": "^3.4.2",
"typescript": "^5.6.3",
"vite": "^5.4.9",
"vitest": "^2.1.3"
},
"msw": {
"workerDirectory": [
"public"
]
}
}
}
Loading
Loading