Skip to content

Conversation

@jihun3666
Copy link
Contributor

@jihun3666 jihun3666 commented Oct 12, 2025

📌 Related Issue

  • Closes #13

✅ Checklist

  • PR 제목의 형식을 잘 작성했나요? e.g. [Feat] PR 템플릿 작성
  • 빌드가 성공했나요? (pnpm build)
  • 이슈는 등록했나요?
  • 리뷰어와 라벨을 지정했나요?

📚 Tasks

절대경로 설정을 위한 tsconfig.json 및 vite.config.ts 수정

Summary by CodeRabbit

릴리스 노트

  • Chores
    • TypeScript 구성 개선: 최신 타겟/모듈 설정, esModuleInterop 및 증분 빌드/선언 출력 활성화로 빌드 효율 향상.
    • 경로 알리아스 추가: 간편한 절대 임포트 지원(@ 알리아스).
    • 빌드 메타정보 및 선언 출력(dist) 도입으로 배포/타입 처리 개선.
    • 타입 보강: CSS 모듈 전역 타입 선언 추가로 스타일 임포트 안정성 향상.

@coderabbitai
Copy link

coderabbitai bot commented Oct 12, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'ignored_paths'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

TypeScript 및 Vite 설정에 프로젝트 루트 절대 경로 별칭 @/* 추가, tsconfig들의 증분 빌드 및 declaration emit 설정 활성화, CSS(.css/.css.ts) 모듈 타입 선언 추가 및 일부 import 경로를 별칭으로 전환했습니다.

Changes

Cohort / File(s) 변경 요약
루트 TypeScript 설정
tsconfig.json
baseUrl: "."paths@/*src/* 매핑 추가, esModuleInterop, target: "es2022", module: "ESnext", moduleResolution: "bundler", jsx: "react-jsx", skipLibCheck 등 compilerOptions 추가. references./tsconfig.app.json./tsconfig.node.json 포함
앱용 tsconfig
tsconfig.app.json
composite, declaration, declarationMap, incremental, emitDeclarationOnly 활성화, outDir: "dist" 지정, allowJs: true 등 빌드/선언 관련 옵션 추가. 기존 noEmit은 주석 처리됨
Node용 tsconfig
tsconfig.node.json
composite, declaration, declarationMap, incremental, emitDeclarationOnly 활성화, moduleResolution: "bundler", outDir: "dist" 지정. 기존 noEmit은 주석 처리됨
Vite 설정(별칭 추가)
vite.config.ts
path 임포트 추가 및 resolve.alias@path.resolve(__dirname, './src') 매핑 추가
증분 빌드 메타데이터
tsconfig.tsbuildinfo
TypeScript 증분 빌드 메타데이터 파일 추가(버전, 소스 파일 목록 등)
글로벌 타입 선언 추가
src/shared/types/global.d.ts
*.css*.css.ts 모듈에 대한 ambient 타입 선언 추가 (export const vars: Record<string, any> 및 기본 클래스 맵 default export)
소스 파일 경로 변경(별칭 적용)
src/app/main.tsx, src/pages/home/home-page.css.ts
상대경로로 되어 있던 스타일/테마 임포트를 절대별칭(@/styles/...)으로 변경

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 추가 확인 권장:
    • tsconfig들에서 emitDeclarationOnly, composite 등의 빌드 옵션이 CI/배포 파이프라인과 호환되는지
    • pathsvite.resolve.alias의 일관성(IDE, 빌드, 테스트 환경에서 동일 동작 보장)
    • src/shared/types/global.d.ts의 타입이 실제 CSS/vanilla-extract 출력과 일치하는지
    • tsconfig.tsbuildinfo가 의도적으로 리포지토리에 커밋되었는지(일반적으로 빌드 캐시 아티팩트로 제외)

Possibly related PRs

Suggested reviewers

  • jihun3666

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 '절대경로 설정'으로 변경사항의 핵심을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 코드 변경사항이 연결된 이슈 #13의 절대경로 설정 목표를 충족하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 절대경로 설정이라는 범위 내에 있으며, 무관한 변경사항은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

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

Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tsconfig.json (1)

11-12: 파이프라인 빌드 실패: composite 설정이 누락되었습니다.

참조된 프로젝트(tsconfig.app.json, tsconfig.node.json)에 "composite": true 설정이 필요합니다. TypeScript project references를 사용할 때 참조되는 모든 프로젝트는 composite 모드여야 합니다.

각 참조된 tsconfig 파일에 다음 설정을 추가하세요:

tsconfig.app.json:

{
  "compilerOptions": {
    "composite": true,
    // ... 기존 설정
  }
}

tsconfig.node.json:

{
  "compilerOptions": {
    "composite": true,
    // ... 기존 설정
  }
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8204e2 and 4c4fdac.

📒 Files selected for processing (2)
  • tsconfig.json (1 hunks)
  • vite.config.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Build Test
tsconfig.json

[error] 11-11: tsconfig.json(11,5): Referenced project '/home/runner/work/fini-client/fini-client/tsconfig.app.json' must have setting "composite": true.

🔇 Additional comments (2)
tsconfig.json (1)

2-7: 스크립트 수정: tsx 파일 검색 포함

현재 rg가 tsx 파일을 인식하지 못해 검사에서 제외되고 있습니다. 아래 명령으로 ts와 tsx 모두 스캔되도록 수정하세요.

#!/bin/bash
# Description: 상대경로 import 패턴 확인 (ts, tsx 검색 포함)
rg -n -C2 "from ['\"]\.\./" --glob "*.ts" --glob "*.tsx" src/ || echo "상대경로 import 없음"
vite.config.ts (1)

3-3: ESM 환경에서 __dirname 사용 검토

  • devDependencies에 @types/node(^24.6.0)가 있어 path 모듈 타입 정의는 문제가 없습니다.
  • package.json의 type 필드가 "module"인지 확인하고, ESM 환경에서 __dirname을 사용하려면 아래처럼 import.meta.url 기반으로 정의하세요:
    import path from 'path'
    import { fileURLToPath } from 'url'
    
    const __filename = fileURLToPath(import.meta.url)
    const __dirname = path.dirname(__filename)

Comment on lines +9 to +13
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Vite 경로 별칭 설정이 올바르게 추가되었습니다.

@ 별칭이 src 디렉토리로 올바르게 매핑되었습니다. 이는 tsconfig.json의 설정과 일관성을 유지합니다.

__dirname 사용이 현재 환경에서 올바르게 작동하는지 확인하세요. Vite config 파일이 ESM 모드로 실행되는 경우 __dirname이 정의되지 않을 수 있습니다:


🏁 Script executed:

#!/bin/bash
# Description: package.json의 type 필드와 vite.config 확장자 확인

echo "=== package.json의 type 필드 확인 ==="
if [ -f package.json ]; then
  TYPE_FIELD=$(cat package.json | jq -r '.type // "commonjs"')
  echo "Module type: $TYPE_FIELD"
  
  if [ "$TYPE_FIELD" = "module" ]; then
    echo "경고: ESM 모드에서는 __dirname이 정의되지 않습니다."
    echo "대안: import.meta.url을 사용하세요:"
    echo "  import { fileURLToPath } from 'url'"
    echo "  const __dirname = fileURLToPath(new URL('.', import.meta.url))"
  fi
else
  echo "package.json을 찾을 수 없습니다."
fi

echo ""
echo "=== vite.config 파일 확장자 확인 ==="
fd -e ts -e mts -e cts "^vite\.config\." . --max-depth 1

Length of output: 267


Vite 설정에서 __dirname 대체 필요
vite.config.ts이 ESM 모드(module)로 실행되므로 __dirname이 정의되지 않습니다. 아래처럼 import.meta.url과 fileURLToPath를 사용해 __dirname을 재정의해주세요:

import { fileURLToPath } from 'url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
🤖 Prompt for AI Agents
In vite.config.ts around lines 9 to 13, __dirname is undefined because the file
runs in ESM mode; add an import of fileURLToPath from 'url' and define __dirname
via fileURLToPath(new URL('.', import.meta.url)), then use that __dirname when
calling path.resolve so the alias resolution works correctly.

@1jiwoo27 1jiwoo27 changed the title [init] 절대경로 설정 [Init] 절대경로 설정 Oct 12, 2025
@1jiwoo27 1jiwoo27 self-requested a review October 12, 2025 08:28
Copy link

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c4fdac and b68fd01.

📒 Files selected for processing (1)
  • package.json (1 hunks)

@1jiwoo27 1jiwoo27 marked this pull request as draft October 12, 2025 09:16
@jihun3666 jihun3666 marked this pull request as ready for review October 31, 2025 06:35
@1jiwoo27 1jiwoo27 marked this pull request as draft November 18, 2025 04:36
@1jiwoo27 1jiwoo27 closed this Dec 2, 2025
@1jiwoo27 1jiwoo27 deleted the 13-feature-절대경로-세팅 branch December 2, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants