Skip to content

[chore] pnp파일 git 추적 제거 및 gitignore 업데이트#13

Merged
2seb2 merged 2 commits intomainfrom
chore/initial-setting
Apr 23, 2026
Merged

[chore] pnp파일 git 추적 제거 및 gitignore 업데이트#13
2seb2 merged 2 commits intomainfrom
chore/initial-setting

Conversation

@zeon0xx0
Copy link
Copy Markdown
Contributor

@zeon0xx0 zeon0xx0 commented Apr 23, 2026

#️⃣ 관련 이슈

연관된 이슈 번호를 적어주세요.
이슈를 함께 종료하려면 Closes #이슈번호 형식으로 작성해주세요.

  • Closes #이슈번호

⏰ 작업 시간

예상과 실제 시간이 다르다면 이유를 간단히 적어주세요.

  • 예상 작업 시간 : 3h
  • 실제 작업 시간 : 3h

💻 작업 내용

이번 작업에서 진행한 내용을 정리해주세요.

  • .pnp.* 파일 및 의존성 로더의 Git 추적 제거했습니다.
    • OS마다 달라지는 패키지 경로 문제를 방지하기 위해 로컬 생성 파일들을 .gitignore에 추가했습니다.
  • yarn 캐시 경로 로컬화
    • globalFolder를 프로젝트 내부(./yarn-cache)로 설정하여, 어떤 환경에서든 상대 경로를 통해 의존성에 접근할 수 있도록 환경을 통일시켰습니다.

필요한 경우 스크린샷이나 캡처 화면을 함께 첨부해주세요.


🪏 작업하면서 고민한 부분

작업 중 겪은 문제나 고민, 그리고 그에 대한 해결 과정을 정리해주세요.
관련 트러블슈팅 문서가 있다면 링크로 연결해주세요.

OS 환경 차이로 인한 모듈 참조 에러 (react-dom 찾기 실패)

문제 현상

  • Mac에서 작업 후 커밋된 프로젝트를 Windows 환경에서 실행 시 react-dom 등 주요 패키지를 찾지 못하는 현상 발생
  • yarn install을 수행해도 문제가 해결되지 않음

원인 분석

  • .pnp.cjs의 역할

    • Yarn Berry PnP 모드는 node_modules 대신 패키지 위치를 기록한 맵 파일(.pnp.cjs)을 참조합니다.
  • 하드코딩된 상대 경로: Mac 환경에서 생성된 .pnp.cjs에는 글로벌 캐시를 향한 상대 경로(../../../../.yarn/berry/cache/)가 기록되어 있었습니다.

  • OS 경로 불일치: Windows의 실제 글로벌 캐시 경로는 AppData/Local/Yarn/Berry에 위치하여, Mac 기준의 상대 경로로는 접근이 불가능했습니다.

  • Git 추적 문제: 이미 .pnp.cjs가 Git에 커밋되어 있어, 다른 환경에서 yarn install을 해도 기존 파일을 덮어쓰지 못하고 잘못된 경로를 계속 참조하고 있었습니다.

해결 방법

  • yarn config set globalFolder ./yarn-cache 설정을 통해 캐시 위치를 프로젝트 내부로 강제하여 환경 독립적인 상대 경로를 확보했습니다.

  • Git에서 관리되던 .pnp.* 파일들을 추적 해제하여 각 개발 환경에서 yarn install 시 본인의 OS에 맞는 로더가 생성되도록 수정했습니다.


👀 리뷰 포인트

리뷰어가 중점적으로 확인해주길 바라는 부분이 있다면 작성해주세요.


📘 참고 자료

작업하면서 참고한 문서, 링크, 자료가 있다면 작성해주세요.

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 불필요한 커스텀 로더 모듈을 제거하여 런타임 로딩 관련 정리를 진행했습니다.
    • 패키지 관리 산출물 및 캐시 관련 항목들을 무시 목록에 추가/정리해 빌드 환경과 저장소 관리를 개선했습니다.

@zeon0xx0 zeon0xx0 added the 🔧 Chore 빌드 설정, 패키지 업데이트 등 자잘한 설정 label Apr 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b677a100-4aac-4de1-8cfe-8748589846dd

📥 Commits

Reviewing files that changed from the base of the PR and between 1208ea9 and 8e32337.

📒 Files selected for processing (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (1)
  • .gitignore

📝 Walkthrough

Walkthrough

Yarn PnP 관련 정리: .pnp.loader.mjs 파일을 삭제하고 .gitignore의 Yarn 관련 패턴을 변경하여 추가적인 PnP 아티팩트(.pnp.*, yarn-cache/)를 무시하도록 업데이트합니다.

Changes

Cohort / File(s) Summary
Yarn 구성
\.gitignore
Yarn Berry 관련 예외 패턴 제거 및 .yarnrc.yml, .pnp.*, yarn-cache/ 등 PnP 아티팩트와 캐시를 무시하도록 항목 추가/조정.
PnP 로더 제거
.pnp.loader.mjs
Node ESM 로더 훅을 제공하던 파일 전체 삭제: load/resolve 내보내기와 JSON 모듈 처리, 패키지 해석, 경로 가상화, fs 바인딩 패치 등이 제거됨.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Node as Node (실행 환경)
    participant Loader as .pnp.loader.mjs
    participant PnP as .pnp.cjs (PnP API)
    participant FS as 파일 시스템
    participant Module as 모듈

    Note over Node,Loader: 기존(삭제 전) 흐름
    Node->>Loader: ESM 로드/해석 요청 (import)
    Loader->>PnP: 패키지 해석 요청 (PnP API)
    PnP-->>Loader: 해석 결과 (가상 경로)
    Loader->>FS: 가상화/포터블 매핑 후 파일 읽기
    FS-->>Loader: 파일 콘텐츠
    Loader->>Module: 반환된 모듈 로드
Loading
sequenceDiagram
    autonumber
    participant Node as Node (실행 환경)
    participant Resolver as Node 내장 해석기
    participant FS as 파일 시스템
    participant Module as 모듈

    Note over Node,Resolver: 새로운(현재) 흐름
    Node->>Resolver: ESM 로드/해석 요청 (import)
    Resolver->>FS: 표준 해석 및 파일 접근
    FS-->>Resolver: 파일 콘텐츠
    Resolver->>Module: 모듈 로드
Loading

예상 코드 리뷰 난이도

🎯 4 (복잡) | ⏱️ ~45분

🐰 훅을 내리고 깃을 정리해요,
.pnp는 이제 안녕, 캐시도 쉬어요.
갈 길 단순해진 코드 정원에서,
토끼는 뛰어놀며 새 시작을 축하하네. 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항을 정확하게 요약하고 있습니다. .pnp 파일의 Git 추적 제거와 gitignore 업데이트라는 핵심 내용을 명확하게 전달합니다.
Description check ✅ Passed PR 설명이 저장소의 템플릿 구조를 충실히 따르고 있으며, 대부분의 필수 섹션(관련 이슈, 작업 시간, 작업 내용, 고민한 부분)을 자세히 작성했습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/initial-setting

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.gitignore:
- Line 31: 현재 .gitignore에 ".yarnrc.yml"이 들어가 있어 팀 공통 Yarn 설정을 버전관리에서 제외하고 있으니,
해당 파일을 추적 대상으로 되돌리려면 .gitignore에서 ".yarnrc.yml" 항목을 삭제하거나 명시적으로 예외
처리(!.yarnrc.yml)를 추가하여 .yarnrc.yml이 깃에 포함되도록 변경하세요; 변경은 .yarnrc.yml 파일명을 직접 참조하여
적용하면 됩니다.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4d2e9df-f001-4b0c-aae9-4ae41735445c

📥 Commits

Reviewing files that changed from the base of the PR and between c2e9f81 and 1208ea9.

📒 Files selected for processing (3)
  • .gitignore
  • .pnp.cjs
  • .pnp.loader.mjs
💤 Files with no reviewable changes (1)
  • .pnp.loader.mjs

Comment thread .gitignore Outdated
Copy link
Copy Markdown
Contributor

@2seb2 2seb2 left a comment

Choose a reason for hiding this comment

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

Yarn Berry PnP 환경에서 OS 차이로 발생하던 경로 문제를 해결해서, 이제는 누구든 레포를 클론한 뒤 install만 하면 각자 환경에 맞게 정상적으로 세팅될 것 같네용!

@2seb2 2seb2 merged commit d10b56c into main Apr 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 Chore 빌드 설정, 패키지 업데이트 등 자잘한 설정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants