fix: hooks 함수가 배포되지 않던 tsconfig noEmit 수정 및 배포 워크플로우 정리 - #622
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Warning Review limit reachedNext included review available in 8 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughhooks 앱의 Vercel 배포 구성을 추가했습니다. API 함수 배포를 유지하고, Changeshooks Vercel 배포
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change configures the hooks service for Vercel deployment and provides a static 안내 page for the public output directory. The deployment configuration is ready to merge with no identified current-head risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
작업 변경사항 정리초기 접근( 1. 함수가 전부 죽던 원인 —
|
| 프로브 | 내용 | 결과 |
|---|---|---|
.ts (import 없음, named export) |
500 | |
.ts (import 없음, default export) |
500 | |
.ts (클래식 (req, res), 웹 전역 미사용) |
500 | |
.mjs (TS 미경유) |
200 |
코드 내용과 무관하게 .ts 만 전부 실패 → TS 컴파일 단계 문제. Vercel 은 함수를 빌드할 때 프로젝트 tsconfig.json 을 그대로 쓰는데 "noEmit": true 가 걸려 있어 JS 를 하나도 내보내지 않았습니다. 빈 함수가 배포되니 무엇을 넣어도 죽었습니다.
noEmit제거 (check-types는tsc --noEmit플래그로 검사하므로 영향 없음)- emit 형식 정합:
module: ESNext/moduleResolution: Bundler오버라이드 제거 → base 의 NodeNext 상속 - NodeNext ESM 이므로 상대 import 에
.js확장자 추가
검증 (프리뷰):
POST /api/webhooks/eas-build → 500 {"error":"server misconfigured"}
POST /api/webhooks/eas → 500 {"error":"server misconfigured"}
POST /api/webhooks/asc → 500 {"error":"server misconfigured"}
Vercel 의 크래시 페이지가 아니라 핸들러가 직접 낸 JSON 입니다. 환경변수만 없는 상태이고 함수는 정상입니다.
2. 빌드 설정은 vercel.json 대신 대시보드
한 번은 vercel.json 으로 넣었다가 대시보드 관리로 정리했습니다. 레포에 vercel.json 은 남지 않습니다. 설정값과 근거는 apps/hooks/README.md 의 표에 적어뒀습니다.
| 설정 | 값 |
|---|---|
| Framework Preset | Other |
| Build Command (Override) | echo skip |
| Output Directory (Override) | public |
| Root Directory → Skip deployment | 켬 |
Build Command 를 비우면 Turborepo 자동 감지가 turbo run build 를 돌리는데 @piki/hooks 에는 build task 가 없어 출력 디렉터리를 못 찾고 실패합니다. Output Directory 는 없어도, 비어 있어도 거부되므로 빈 public/index.html 을 채움용으로 둡니다.
3. 배포 알림 오탐 차단
Vercel 프로젝트가 둘이 되면서 환경 이름에 프로젝트명이 붙기 시작했는데(Production – piki-notify), 게이트가 Production* 와일드카드라 hooks 배포 실패가 ❌ [WEB·PROD] PiKi 배포 실패 로 나갔습니다.
85 Preview ← 단일 프로젝트 시절
5 Production ←
1 Production – piki-notify ← 오알림
웹 프로젝트로 한정하고, 접미사 없는 옛 이름도 계속 받도록 했습니다. deployment_status 는 default 브랜치 워크플로우만 실행되므로 dev 머지 후부터 적용됩니다.
4. E2E 워크플로우 분리
브라우저 설치 + 웹 빌드까지 하는 무거운 job 이 apps/hooks 전용 커밋에서도 돌고 있었습니다. e2e.yml 로 분리하고 경로 필터를 걸었습니다 — 웹이 의존하는 packages/core 도 포함했습니다.
Lint, Type Check 는 필터 없이 그대로 둡니다. turbo 로 hooks 까지 검사하는 job 이고, dev 의 유일한 required check 라 경로 필터를 걸면 hooks-only PR 의 머지가 막힙니다.
머지 후 남은 셋업 (#618 체크리스트)
- 환경변수 5개 Production 스코프에 등록
- 두 Vercel 프로젝트에 Skip deployment 토글
-
hooks.piki.day확인 —401 {"error":"invalid signature"}가 나오면 정상 - EAS·ASC 웹훅 등록 (도메인이 살아난 뒤에)
작업 요약
apps/hooksVercel 배포가 빌드 단계에서 실패하던 것을vercel.json으로 고칩니다.작업 세부 내용
Vercel 프로젝트를 등록했더니 첫 배포가 이렇게 실패했습니다.
Vercel이 모노레포를 보고 Turborepo를 자동 감지해
turbo run build를 돌리는데,@piki/hooks에는buildtask가 없어 아무것도 만들지 않고 끝납니다. 그런데도 Vercel은 "빌드가 돌았다"고 판단해 결과물을 찾으러 가고, 출력 디렉터리가 없어 실패합니다.apps/hooks는 번들할 것이 없는 순수 함수 프로젝트라 빌드 단계 자체가 필요 없습니다. 그래서 빌드 명령을 빈 디렉터리 생성으로 갈아끼워 "빌드할 정적 산출물이 없다"는 사실을 그대로 표현했습니다.{ "framework": null, "buildCommand": "mkdir -p public", "outputDirectory": "public" }framework: null— 프리셋 추측으로 기본 빌드 명령·출력 경로가 끼어드는 것을 막습니다api/**/*.ts는 이 설정과 무관하게 Vercel이 Root Directory 아래api/를 스캔해 함수로 배포합니다 (TS 컴파일도 런타임이 처리)Root Directory는
apps/hooks그대로 둡니다. 루트로 잡으면 함수 탐색 기준이 레포 루트가 되어apps/hooks/api/**가 함수로 안 잡히고, web 프로젝트와vercel.json공간이 겹칩니다. 반면apps/hooks로 두어도 install은 Vercel이 pnpm workspace를 감지해 레포 루트에서 돌기 때문에 (Scope: all 6 workspace projects) 잃는 것이 없습니다.스크린샷
연관 이슈
#618
Summary by CodeRabbit
새 기능
POST /api/webhooks/*엔드포인트 정보를 제공합니다.문서