Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughnpm 워크스페이스에서 pnpm + TurboRepo로 전환하고, 여러 앱에서 내부 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/shared-axios/tsconfig.json (1)
1-10: 패키지 tsconfig 중복을 공통 프리셋으로 추출하는 것을 권장합니다.동일한
compilerOptions/include/exclude가 여러 패키지에 반복되어 설정 드리프트가 생기기 쉬워 보입니다.tsconfig.package.json(루트)로 추출해extends만 유지하면 관리가 더 단순해집니다.예시 diff
- "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.package.json",As per coding guidelines, "파일과 컴포넌트 책임이 과도하면 응집도와 결합도 기준으로 분리안을 제시."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/shared-axios/tsconfig.json` around lines 1 - 10, The package tsconfig.json duplicates common settings (compilerOptions, include, exclude); extract these shared settings into a root tsconfig.package.json and have the package tsconfig.json simply extend that preset. Concretely, create a root tsconfig.package.json containing the common compilerOptions, include and exclude, then replace the package's full options by leaving only "extends": "<root preset name>" in packages/shared-axios/tsconfig.json (preserve any package-specific overrides by adding them alongside extends if needed); ensure the package still compiles by running tsc -p after the change and update any other packages to use the same tsconfig.package.json to eliminate drift.turbo.json (1)
7-13:build/linttask에 로컬typecheck도 선행 의존으로 추가 권장합니다.현재 turbo.json에서
^typecheck만 지정되어 있어 의존 패키지의 타입체크만 선행되도록 설정되어 있습니다. 그러나 root 패키지는 자신의 typecheck 스크립트를 보유하고 있으므로(apps는 typecheck 스크립트가 없음), 명시적으로 로컬typecheck의존성도 선언하여 task 실행 순서를 일관되게 구성하는 것이 좋습니다.🔧 제안 변경
"build": { - "dependsOn": ["^typecheck"], + "dependsOn": ["typecheck", "^typecheck"], "outputs": [".next/**", "!.next/cache/**"] }, "lint": { - "dependsOn": ["^typecheck"], + "dependsOn": ["typecheck", "^typecheck"], "outputs": [] }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@turbo.json` around lines 7 - 13, Update turbo.json's task dependencies so build and lint depend on the local typecheck as well as dependent packages' typecheck: in the "build" and "lint" tasks, add "typecheck" to the dependsOn arrays alongside the existing "^typecheck" entry (so dependsOn becomes ["typecheck", "^typecheck"]) to ensure the root/local typecheck runs before build and lint; modify the entries for the "build" and "lint" tasks accordingly.packages/shared-auth/src/signup.ts (1)
19-32:getValidationErrorMessage구현이 적절합니다.Zod 검증 에러 구조(
issues배열)를 안전하게 처리하는 방어적 코드입니다. 다만 타입 안전성을 높이고 싶다면 Zod의ZodError타입을 활용하는 방법도 고려해 볼 수 있습니다.♻️ (선택) Zod 타입을 활용한 타입 가드 패턴
+import { ZodError } from "zod"; + export function getValidationErrorMessage(error: unknown): string | null { - if (!error || typeof error !== "object") return null; - - const issues = (error as { issues?: { message?: unknown }[] }).issues; - if ( - Array.isArray(issues) && - issues.length > 0 && - typeof issues[0]?.message === "string" - ) { - return issues[0].message; + if (error instanceof ZodError && error.issues.length > 0) { + return error.issues[0].message; } return null; }이 리팩토링은
zod를 이 패키지의 의존성으로 추가해야 하므로, 현재 런타임 의존성 없이 유지하려는 의도라면 기존 구현이 더 적합합니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/shared-auth/src/signup.ts` around lines 19 - 32, The current getValidationErrorMessage implementation is fine; no runtime fix required—keep the defensive checks as-is, or if you want stronger typing instead add zod as a dependency and replace the ad-hoc type assertion with a ZodError type guard (import ZodError from "zod" and check error instanceof ZodError, then read error.issues[0]?.message as string) inside getValidationErrorMessage to improve type safety.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Around line 9-11: Add a "typecheck" npm script to the three app packages
(OC-RECORD, OC-ADMIN, OC-DASHBOARD) so they run tsc --noEmit like the packages
(dashboard-domain, shared-auth, shared-axios, shared-types, submission-domain);
update each app's package.json to include "typecheck": "tsc --noEmit" (or the
monorepo-equivalent command used elsewhere) so that running pnpm typecheck or
Turbo tasks that depend on ^typecheck will validate app-level TypeScript errors
as well.
---
Nitpick comments:
In `@packages/shared-auth/src/signup.ts`:
- Around line 19-32: The current getValidationErrorMessage implementation is
fine; no runtime fix required—keep the defensive checks as-is, or if you want
stronger typing instead add zod as a dependency and replace the ad-hoc type
assertion with a ZodError type guard (import ZodError from "zod" and check error
instanceof ZodError, then read error.issues[0]?.message as string) inside
getValidationErrorMessage to improve type safety.
In `@packages/shared-axios/tsconfig.json`:
- Around line 1-10: The package tsconfig.json duplicates common settings
(compilerOptions, include, exclude); extract these shared settings into a root
tsconfig.package.json and have the package tsconfig.json simply extend that
preset. Concretely, create a root tsconfig.package.json containing the common
compilerOptions, include and exclude, then replace the package's full options by
leaving only "extends": "<root preset name>" in
packages/shared-axios/tsconfig.json (preserve any package-specific overrides by
adding them alongside extends if needed); ensure the package still compiles by
running tsc -p after the change and update any other packages to use the same
tsconfig.package.json to eliminate drift.
In `@turbo.json`:
- Around line 7-13: Update turbo.json's task dependencies so build and lint
depend on the local typecheck as well as dependent packages' typecheck: in the
"build" and "lint" tasks, add "typecheck" to the dependsOn arrays alongside the
existing "^typecheck" entry (so dependsOn becomes ["typecheck", "^typecheck"])
to ensure the root/local typecheck runs before build and lint; modify the
entries for the "build" and "lint" tasks accordingly.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4b3a3aec-ce07-4a36-9a33-994a74850c58
⛔ Files ignored due to path filters (3)
.DS_Storeis excluded by!**/.DS_Store,!**/.DS_Storepackage-lock.jsonis excluded by!**/package-lock.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!**/pnpm-lock.yaml
📒 Files selected for processing (27)
.gitignoreapps/OC-ADMIN/eslint.config.mjsapps/OC-ADMIN/package.jsonapps/OC-ADMIN/src/app/register/page.tsxapps/OC-ADMIN/tsconfig.jsonapps/OC-DASHBOARD/next.config.tsapps/OC-DASHBOARD/package.jsonapps/OC-DASHBOARD/tsconfig.jsonapps/OC-RECORD/eslint.config.mjsapps/OC-RECORD/package.jsonapps/OC-RECORD/src/app/home/page.jsxapps/OC-RECORD/src/app/register/page.tsxapps/OC-RECORD/tsconfig.jsonpackage.jsonpackages/dashboard-domain/package.jsonpackages/dashboard-domain/tsconfig.jsonpackages/shared-auth/package.jsonpackages/shared-auth/src/signup.tspackages/shared-auth/tsconfig.jsonpackages/shared-axios/package.jsonpackages/shared-axios/tsconfig.jsonpackages/shared-types/package.jsonpackages/shared-types/tsconfig.jsonpackages/submission-domain/package.jsonpackages/submission-domain/tsconfig.jsonpnpm-workspace.yamlturbo.json
| "build": "turbo build --filter=@ocean-kit/oc-admin --filter=@ocean-kit/oc-dashboard --filter=@ocean-kit/oc-record", | ||
| "lint": "turbo lint --filter=@ocean-kit/oc-admin --filter=@ocean-kit/oc-dashboard --filter=@ocean-kit/oc-record", | ||
| "typecheck": "turbo typecheck --filter=@ocean-kit/dashboard-domain --filter=@ocean-kit/shared-auth --filter=@ocean-kit/shared-axios --filter=@ocean-kit/shared-types --filter=@ocean-kit/submission-domain" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: 앱들의 package.json에 typecheck 스크립트가 있는지 확인
echo "=== Checking for typecheck scripts in apps ==="
for app in apps/OC-RECORD apps/OC-ADMIN apps/OC-DASHBOARD; do
if [ -f "$app/package.json" ]; then
echo "--- $app/package.json ---"
jq '.scripts.typecheck // "NOT DEFINED"' "$app/package.json"
fi
doneRepository: OCEAN-KIT/OC-PROJECT
Length of output: 263
🏁 Script executed:
#!/bin/bash
# Check turbo.json task configuration for typecheck dependencies
echo "=== Checking turbo.json ==="
cat turbo.json | head -100Repository: OCEAN-KIT/OC-PROJECT
Length of output: 375
🏁 Script executed:
#!/bin/bash
# Verify that the packages being filtered in typecheck have typecheck scripts
echo "=== Checking typecheck scripts in packages ==="
for pkg in packages/dashboard-domain packages/shared-auth packages/shared-axios packages/shared-types packages/submission-domain; do
if [ -f "$pkg/package.json" ]; then
echo "--- $pkg ---"
jq '.scripts.typecheck // "NOT DEFINED"' "$pkg/package.json"
else
echo "--- $pkg (NOT FOUND) ---"
fi
doneRepository: OCEAN-KIT/OC-PROJECT
Length of output: 429
🏁 Script executed:
#!/bin/bash
# Check if there's any root-level or workspace configuration for typecheck
echo "=== Checking pnpm-workspace.yaml ==="
if [ -f "pnpm-workspace.yaml" ]; then
cat pnpm-workspace.yaml
fiRepository: OCEAN-KIT/OC-PROJECT
Length of output: 141
앱들에 typecheck 스크립트 추가 필요
확인 결과, 3개 앱(OC-RECORD, OC-ADMIN, OC-DASHBOARD)에는 typecheck 스크립트가 정의되어 있지 않습니다. 하지만 패키지들(dashboard-domain, shared-auth, shared-axios, shared-types, submission-domain)은 모두 tsc --noEmit 스크립트를 가지고 있어 현재 구조에서 불일치가 발생합니다.
turbo.json에서 build와 lint가 ^typecheck에 의존하므로 패키지의 타입 검사는 이들 작업 실행 시 자동으로 수행되지만, 앱 자체의 타입 오류는 직접적으로 검증되지 않습니다. 모노레포의 일관성과 개발 경험을 위해 각 앱에도 typecheck 스크립트를 추가하여 pnpm typecheck 실행 시 앱도 함께 타입 검사되도록 하는 것이 권장됩니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` around lines 9 - 11, Add a "typecheck" npm script to the three
app packages (OC-RECORD, OC-ADMIN, OC-DASHBOARD) so they run tsc --noEmit like
the packages (dashboard-domain, shared-auth, shared-axios, shared-types,
submission-domain); update each app's package.json to include "typecheck": "tsc
--noEmit" (or the monorepo-equivalent command used elsewhere) so that running
pnpm typecheck or Turbo tasks that depend on ^typecheck will validate app-level
TypeScript errors as well.
Summary by CodeRabbit
릴리스 노트
버그 수정
신규 기능
작업