Skip to content

feat: 폴더 구조 수정 - #4

Merged
lywoo00 merged 8 commits into
mainfrom
feat/dir
Nov 2, 2025
Merged

feat: 폴더 구조 수정#4
lywoo00 merged 8 commits into
mainfrom
feat/dir

Conversation

@lywoo00

@lywoo00 lywoo00 commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

📌 PR 개요

  • 이 PR이 어떤 목적을 가지고 있는지 간단히 설명해주세요.

🔍 관련 이슈

  • 폴더 구조 수정

🔧 변경 유형

해당하는 항목에 체크해주세요.

  • [] ✨ feat (새 기능 추가)
  • 🐛 fix (버그 수정)
  • [] 📝 docs (문서 수정)
  • 🎨 style (코드 스타일 변경)
  • ♻️ refactor (리팩토링)
  • ✅ test (테스트 코드)
  • 🛠 chore (빌드/환경설정)

✨ 변경 사항

  • 폴더 구조 수정

ex

  • 로그인 API 연동 (/api/login) 추가
  • 로그인 폼에서 이메일/비밀번호 유효성 검사 로직 추가
  • 로그인 성공 시 JWT 토큰을 localStorage에 저장하도록 수정
  • UI: 로그인 버튼 클릭 시 로딩 스피너 추가

📝 PR 제목 규칙

PR 제목은 커밋 컨벤션을 따라야 합니다.
ex) feat: 롤링페이퍼 작성 기능 추가 (#15)

✅ 체크리스트

  • 코드가 정상 동작함
  • 빌드 및 실행 확인 완료
  • 리뷰어가 이해하기 쉽게 변경 이유를 설명했음

📸 스크린샷 (선택)

  • UI 변경이 있다면 캡처 이미지 첨부

🤝 기타 참고 사항

  • 리뷰어가 참고하면 좋을 추가 맥락(설계 의도, 제약사항 등)

@yujinimda
yujinimda self-requested a review November 2, 2025 13:31
@yujinimda yujinimda added 생성 (feat) 새로운 기능 추가할 때 사용 피드백 (feedback) 멘토나 팀원의 의견 반영, 논의용 리뷰 (review) 리뷰 요청 또는 검토 중 표시 labels Nov 2, 2025
@yujinimda

Copy link
Copy Markdown
Member

에러 원인: CI에서 pnpm install --frozen-lockfile 를 썼는데, 러너의 pnpm 버전과 lockfile 버전이 안 맞아서 lockfile을 “호환 안 됨”으로 무시 → “없다”고 보고 실패한 거예요.

빠른 해결 2가지 중 하나만 택하세요(추천 순서대로):

Comment thread .eslintrc.json
@@ -0,0 +1,32 @@
{
"env": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

에러 원인: CI에서 pnpm install --frozen-lockfile 를 썼는데, 러너의 pnpm 버전과 lockfile 버전이 안 맞아서 lockfile을 “호환 안 됨”으로 무시 → “없다”고 보고 실패한 거예요.

빠른 해결 2가지 중 하나만 택하세요(추천 순서대로):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ 방법 1: pnpm 버전을 lockfile에 맞추기(권장)

워크플로에서 pnpm을 8로 고정(대부분의 기존 lockfile은 v6 형식 = pnpm v8 세대).

  • uses: pnpm/action-setup@v4
    with:
    version: 8

그대로 pnpm install --frozen-lockfile 유지하면 통과합니다.

🟡 방법 2: frozen 해제(임시)

재현성은 떨어지지만 수정 최소화:

  • run: pnpm install --no-frozen-lockfile

@lywoo00
lywoo00 merged commit 6350899 into main Nov 2, 2025
1 check passed
interface TitleProps {
children: ReactNode;
size: string;
whight: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

weight 오타?

import s from './Title.module.css';
interface TitleProps {
children: ReactNode;
size: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

size, weight를 string으로 받으면 오타가 런타임까지 새어나가서 ts장점이 사라짐
유니온으로 받기

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

추가로 기본값은 옵셔널까지!

whight: string;
}
const Title = ({ children, size, whight }: TitleProps) => {
return <strong className={`${s[size]} ${s[whight]}`}>{children}</strong>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s[size], s[weight]가 CSS 모듈에 없는 거면 undefined가 className에 섞임 → clsx나 filter(Boolean)로 방지할수있어요!

<>
<Header />
<main className={s.main}>
<Outlet />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

좋은거 알아갑니다

Comment thread src/main.tsx

createRoot(document.getElementById('root')!).render(
<StrictMode>
<BrowserRouter>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

나도 BrowserRouter 이거 넣어야해

return (
<div className="productWrap">
<BestProductList />
<GeneralProductList />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

여기서 필터부분 모듈한번 더 쪼개는거 어떤가요?
멘토님께 물어보고 올께요

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

전 필터랑 페이지네이션도 하나의 모듈로 구분했서요!

setLoading(true);
axios
.get(
`https://panda-market-api.vercel.app/products?page=${page}&pageSize=${size}&orderBy=${order}`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

공통 api폴더를 만들어서 axios 인스턴스랑 list api를 따로 분리하는건 어떨까요?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

axios인스턴스에 interceptors까지 추가로 넣으면 매번 error코드를 적지 않아도 됩니다 그냥 받아올수있써요!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

URL 조합은 params 옵션으로 쓰는게 안전하다고 해요
-> 유진꺼 예시 const { data } = await axiosApi.get("/products", {
params: {page, pageSize, orderBy, ...(keyword && {keyword})}
})

import axios from 'axios';
import { useState, useEffect } from 'react';

interface ProductProps {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

공통으로 쓰는 Props는 따로 공통 ts폴더를 만들어서 거기서 관리하는거 어떨까용?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

그리고 ProductProps는 필수 필드여서 옵셔널 안넣어도 될꺼같아요!

interface useProductsPrams {
page?: number;
size?: number;
order?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"recent" | "favorite"

.finally(() => {
setLoading(false);
});
}, [page, size]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

deps에 order이 빠졌어요!

});
}, [page, size]);

return { products, loading };

@yujinimda yujinimda Nov 3, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

리턴값 error 추가

order: 'favorite',
});
console.log(products);
if (loading) return <div>Loading...</div>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

로딩, 에러처리 추가

import s from './GeneralProductList.module.css';

const GeneralProductList = () => {
const { products, loading } = useProducts({ page: 1, size: 10 });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

error도 추가..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

생성 (feat) 새로운 기능 추가할 때 사용 피드백 (feedback) 멘토나 팀원의 의견 반영, 논의용 리뷰 (review) 리뷰 요청 또는 검토 중 표시

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants