-
Notifications
You must be signed in to change notification settings - Fork 36
refactor: use cosmiconfig to load config instead of bun dynamic import #869
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
base: dev
Are you sure you want to change the base?
Conversation
te6-in
commented
Aug 12, 2025
- might include: Bun.serve 대체
# Conflicts: # bun.lock # packages/mcp/CHANGELOG.md # packages/mcp/package.json
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Claude finished @te6-in's task —— View job PR 리뷰 완료 ✅다음 작업들을 수행했습니다:
리뷰 요약이번 PR은 설정 파일 로딩을 Bun의 동적 import에서 주요 개선사항:
고려할 점들도 리뷰에서 언급했는데, 특히 ES module default export 처리와 에러 로깅에 대한 부분을 확인해보시면 좋을 것 같습니다. 전체적으로 코드 품질 향상에 도움이 되는 변경사항입니다! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전반적인 리뷰
이번 PR은 설정 파일 로딩을 Bun의 동적 import에서 cosmiconfig로 변경하는 좋은 리팩토링입니다.
✅ 긍정적인 변경사항
-
표준화된 설정 로딩:
cosmiconfig는 널리 사용되는 라이브러리로, 일관된 설정 파일 검색 패턴을 제공합니다. -
코드 간소화: 기존의 복잡한 파일 타입 체크 및 처리 로직(
fs.existsSync, 파일 확장자 체크, 개별 import 처리)이 크게 단순화되었습니다 (packages/mcp/src/config.ts:11-23). -
런타임 의존성 정리:
typescript가 devDependencies에서 dependencies로 이동하여 더 명확한 의존성 관리가 되었습니다. -
Import assertion 업데이트:
assert { type: "json" }에서with { type: "json" }으로 최신 표준을 사용합니다 (packages/mcp/src/bin/index.ts:10).
🤔 고려사항
-
ES Module default export 처리: 기존 구현에서는
config.default || config로 default export를 처리했는데,cosmiconfig가 이를 자동으로 처리하는지 확인이 필요합니다. -
에러 처리 차이: 기존에는 다양한 에러 상황(파일 없음, 잘못된 형식, 파싱 에러)에 대해 구체적인 로깅이 있었는데, 새로운 구현에서는 단순히 "파일을 찾을 수 없음"만 로깅됩니다.
-
파일 경로 해석: 기존의
path.resolve(process.cwd(), configPath)와cosmiconfig의 경로 해석 방식이 동일한지 확인이 필요합니다.
📝 제안사항
변경사항은 전반적으로 좋지만, 다음을 고려해보세요:
cosmiconfig가 ES module default export를 올바르게 처리하는지 테스트- 에러 상황에 대한 더 구체적인 로깅 추가 고려
전체적으로 코드를 더 표준적이고 유지보수하기 쉽게 만드는 좋은 리팩토링입니다! 👍
Deploying seed-design-v3 with
|
| Latest commit: |
77fab7a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6b9099cd.seed-design.pages.dev |
| Branch Preview URL: | https://fix-bun-mcp-module-resolutio.seed-design.pages.dev |