Skip to content

Conversation

six-standard
Copy link
Member

@six-standard six-standard commented Nov 22, 2024

프로젝트 초기 세팅을 완료하였습니다.
프로젝트를 세팅하는 과정에서 ESLint를 React에서만 세팅해봐서 그런가 세팅할 때마다 오류가 터져서 조금 오래 걸렸던 것 같습니다.

로그인 페이지 테스팅 구성 및 퍼블리싱은 오늘 내로 완료하겠습니다!

Summary by CodeRabbit

  • 새로운 기능

    • Next.js 애플리케이션을 위한 다양한 구성 파일이 추가되었습니다.
    • Tailwind CSS를 활용한 글로벌 스타일이 도입되었습니다.
    • 기본 페이지 구조가 설정되었습니다.
    • 프로젝트에 필요한 패키지와 스크립트가 포함된 package.json 파일이 생성되었습니다.
    • ESLint 및 Prettier 설정이 통합되어 코드 품질이 향상되었습니다.
  • 버그 수정

    • 테스트 커버리지를 향상시키기 위한 간단한 테스트 케이스가 추가되었습니다.
  • 문서화

    • README 파일이 업데이트되어 프로젝트 시작 방법과 배포 방법에 대한 정보가 포함되었습니다.
  • 구성

    • ESLint, Prettier, Jest 등 다양한 도구에 대한 설정 파일이 추가되었습니다.
    • Tailwind CSS 및 PostCSS에 대한 구성 파일이 도입되었습니다.
    • TypeScript 및 Jest 설정 파일이 추가되었습니다.

@six-standard six-standard added the enhancement New feature or request label Nov 22, 2024
Copy link

coderabbitai bot commented Nov 22, 2024

Walkthrough

이 변경 사항은 Next.js 애플리케이션을 위한 여러 구성 파일을 추가하고, ESLint 및 Prettier 설정을 통합하며, Jest 테스트를 위한 구성을 포함합니다. 새로운 .gitignore, .npmrc, .prettierrc, .vscode/settings.json, eslint.config.mjs, jest.config.ts, jest.setup.ts, next.config.mjs, package.json, postcss.config.mjs, readme.md, src 디렉토리 내의 여러 파일들이 추가되었습니다. 이들 파일은 코드 품질을 향상시키고, 개발 환경을 설정하며, 기본적인 테스트 및 스타일링 규칙을 정의합니다.

Changes

파일 경로 변경 요약
.eslintrc.json ESLint 구성 파일 생성, next/core-web-vitalsnext/typescript 확장.
.gitignore Git에서 무시할 파일 및 디렉토리 목록을 포함하는 새로운 파일 생성.
.npmrc auto-install-peers=true 설정 추가.
.prettierrc Prettier 포맷팅 옵션을 정의하는 새로운 파일 생성.
.vscode/settings.json VSCode 설정을 포함하는 새로운 파일 생성. 다양한 개발 환경 설정 포함.
eslint.config.mjs ESLint 구성 파일 추가, 다양한 플러그인 및 설정 통합.
jest.config.ts Next.js 애플리케이션을 위한 Jest 구성 파일 추가.
jest.setup.ts Jest의 DOM 관련 어설션을 위한 @testing-library/jest-dom 라이브러리 임포트 추가.
next.config.mjs Next.js 애플리케이션을 위한 새로운 구성 파일 생성.
package.json 새 프로젝트를 위한 package.json 파일 생성, 스크립트 및 의존성 정의.
postcss.config.mjs PostCSS 구성 파일 생성, Tailwind CSS 플러그인 설정.
readme.md Next.js 프로젝트에 대한 정보 및 시작 방법 문서화.
src/__test__/app.test.ts 새로운 테스트 케이스 추가.
src/app/(login)/page.tsx 새로운 기본 내보내기 함수 Home 추가.
src/app/(main)/page.tsx 새로운 기본 내보내기 함수 Home 추가.
src/app/globals.css Tailwind CSS를 사용한 글로벌 스타일 정의.
src/app/layout.tsx 새로운 레이아웃 컴포넌트 추가, 메타데이터 및 글로벌 CSS 포함.
src/app/page.tsx 새로운 함수형 컴포넌트 Home 추가.
tailwind.config.ts Tailwind CSS 설정 파일 생성, 커스텀 색상 및 콘텐츠 경로 정의.
tsconfig.json Next.js 프로젝트를 위한 TypeScript 컴파일러 옵션 설정.

Poem

🐰 새로운 설정이 왔어요,
코드가 빛나고 있어요.
ESLint와 Prettier,
함께 일해요, 기쁘게!
테스트도 추가되어,
모두가 즐거워요!
개발의 길이 열렸어요! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b40b32e and bd43bb4.

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

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

🧹 Outside diff range and nitpick comments (2)
src/app/layout.tsx (2)

30-30: HTML lang 속성을 검토해주세요

현재 HTML lang 속성이 "en"으로 설정되어 있습니다. 웹사이트의 주 사용 언어가 한국어인 경우 "ko"로 변경하는 것이 좋겠습니다.

-    <html lang="en">
+    <html lang="ko">

24-34: 루트 레이아웃에 오류 처리와 분석 기능 추가를 고려해주세요

대시보드 애플리케이션의 안정성과 모니터링을 위해 다음 기능들의 추가를 고려해보시기 바랍니다:

  1. 전역 에러 바운더리 구현
  2. 애널리틱스 설정 (예: Google Analytics, Amplitude 등)
  3. 성능 모니터링 도구 통합
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0954f5d and fedb701.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • public/favicon.png is excluded by !**/*.png
📒 Files selected for processing (20)
  • .eslintrc.json (1 hunks)
  • .gitignore (1 hunks)
  • .npmrc (1 hunks)
  • .prettierrc (1 hunks)
  • .vscode/settings.json (1 hunks)
  • eslint.config.mjs (1 hunks)
  • jest.config.ts (1 hunks)
  • jest.setup.ts (1 hunks)
  • next.config.mjs (1 hunks)
  • package.json (1 hunks)
  • postcss.config.mjs (1 hunks)
  • readme.md (1 hunks)
  • src/__test__/app.test.ts (1 hunks)
  • src/app/(login)/page.tsx (1 hunks)
  • src/app/(main)/page.tsx (1 hunks)
  • src/app/globals.css (1 hunks)
  • src/app/layout.tsx (1 hunks)
  • src/app/page.tsx (1 hunks)
  • tailwind.config.ts (1 hunks)
  • tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (18)
  • .eslintrc.json
  • .gitignore
  • .npmrc
  • .prettierrc
  • .vscode/settings.json
  • jest.config.ts
  • jest.setup.ts
  • next.config.mjs
  • package.json
  • postcss.config.mjs
  • readme.md
  • src/test/app.test.ts
  • src/app/(login)/page.tsx
  • src/app/(main)/page.tsx
  • src/app/globals.css
  • src/app/page.tsx
  • tailwind.config.ts
  • tsconfig.json
🔇 Additional comments (4)
src/app/layout.tsx (1)

16-22: favicon 파일의 존재 여부를 확인해주세요

메타데이터에서 참조하고 있는 favicon.png 파일이 public 디렉토리에 존재하는지 확인이 필요합니다.

✅ Verification successful

favicon 파일이 정상적으로 존재합니다

public 디렉토리에서 favicon.png 파일을 확인했습니다.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if favicon exists in the public directory
fd "favicon.png" ./public

Length of output: 46

eslint.config.mjs (3)

11-11: 타입 어노테이션이 적절히 설정되었습니다

ESLint 설정에 대한 타입 정의가 명확하게 되어있어 TypeScript 지원이 잘 될 것으로 보입니다.


24-26: react-in-jsx-scope 규칙 비활성화 확인

React 17+ 버전에서는 이 규칙이 필요하지 않으므로, 비활성화가 적절합니다. 다만 프로젝트의 React 버전을 확인해주세요.

✅ Verification successful

react-in-jsx-scope 규칙 비활성화가 적절합니다

React 18 버전을 사용하고 있으므로, JSX 사용 시 React를 명시적으로 import할 필요가 없습니다. 해당 ESLint 규칙 비활성화는 적절한 설정입니다.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# React 버전 확인
cat package.json | jq '.dependencies.react, .devDependencies.react'

Length of output: 80


1-10: 임포트 구문 개선 제안

임포트 구문을 다음과 같이 그룹화하여 가독성을 향상시키는 것이 좋습니다:

  1. 코어 ESLint/TypeScript
  2. React 관련
  3. 테스트 관련
  4. 코드 스타일 관련

또한 각 플러그인의 호환성을 확인하는 것이 중요합니다.

✅ Verification successful

The previous script showed the package versions, but let's verify the actual ESLint configuration structure and any potential warnings. This will help us confirm if there are any compatibility issues between the plugins before making the final recommendation.


ESLint 플러그인 구성이 적절히 설정되어 있습니다

package.json과 eslint.config.mjs를 검토한 결과:

  • 모든 플러그인이 최신 버전으로 설치되어 있으며 서로 호환됩니다
  • ESLint v8.57.1과 함께 사용되는 플랫 설정이 올바르게 구성되어 있습니다
  • 플러그인들이 논리적인 순서로 이미 잘 구성되어 있습니다:
    1. 코어 (globals, @eslint/js)
    2. TypeScript
    3. React
    4. 테스트 관련 (Jest, Testing Library)
    5. 코드 스타일 (Prettier)

임포트 구문 재구성이 불필요하며 현재 구성이 최적의 상태입니다.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: 패키지 버전 호환성 확인

# package.json에서 관련 의존성 버전 확인
echo "Checking package versions:"
cat package.json | jq '.dependencies, .devDependencies'

Length of output: 924


Script:

#!/bin/bash
# Check if there are any version compatibility warnings in the logs
echo "Checking for any ESLint warnings in recent logs:"
fd -e log -e out . | xargs cat 2>/dev/null | grep -i "warn.*compatibility"

# Check ESLint configuration validation
echo -e "\nValidating ESLint configuration:"
cat eslint.config.mjs

Length of output: 1231

Copy link
Member

@Nuung Nuung left a comment

Choose a reason for hiding this comment

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

전체 세팅 매우 잘 봤습니다, 2가지 궁금한게 있습니다!

리뷰

  1. api repo 와 linting 이나 rule 을 맞추는 것은 어떨까요? @HA0N1 논의가 필요해 보이긴 하지만, 굳이 FE 와 api 둘 다른 스타일링을 할 필요는 없어 보입니다.
  2. README.md 파일은 제 3자가 누구나 따라 세팅할 수 있도록, 가이드라인이 있으면 좋을 것 같아요. next 에서 자동으로 만들어 주는 것 말구요!

좋았던 점

  1. 미리 meta data 세팅을 (favicon 과 같은) 잡아 두신게 좋았습니다!
  2. jest 도 일단 간단한 테스팅이지만 미리 붙여 놓고, config 도 잘 확인했습니다!
  3. app 에 핵심 페이지 빼놓은 것도 좋았습니다~

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: 0

🧹 Outside diff range and nitpick comments (1)
src/app/layout.tsx (1)

16-22: 메타데이터 구성을 개선해주세요

메타데이터 구성이 기본적인 수준으로 되어있습니다. SEO 최적화와 더 나은 사용자 경험을 위해 다음 속성들을 추가하는 것이 좋겠습니다:

 export const metadata: Metadata = {
   title: 'Velog Dashboard',
   description: 'Velog 통계를 확인할 수 있는 Velog Dashboard',
+  viewport: 'width=device-width, initial-scale=1',
+  robots: 'index, follow',
+  openGraph: {
+    title: 'Velog Dashboard',
+    description: 'Velog 통계를 확인할 수 있는 Velog Dashboard',
+    type: 'website',
+  },
   icons: {
     icon: '/favicon.png',
+    apple: '/apple-touch-icon.png',
   },
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fedb701 and 589f90e.

📒 Files selected for processing (1)
  • src/app/layout.tsx (1 hunks)
🔇 Additional comments (1)
src/app/layout.tsx (1)

24-34: 레이아웃 구현이 깔끔합니다

Next.js의 레이아웃 컴포넌트가 간단하고 명확하게 구현되었습니다. lang 속성도 적절하게 "ko"로 설정되어 있습니다.

@six-standard six-standard requested a review from Nuung November 23, 2024 14:16
Copy link

@BDlhj BDlhj left a comment

Choose a reason for hiding this comment

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

첫 PR 잘 봤습니다!
제가 두 부분에 리뷰 남겨두었는데 해당 부분이 반드시 변경되어야하는 것은 아닐 수도 있어서 우선 'Comment'로 리뷰 남깁니다. 기준님 의견도 적어주시면 최종 결정 후에 'Approve' 드리겠습니다! 수고하셨습니다!

좋았던 점

  1. next를 활용한 프로젝트의 구조화에 대해 잘 알지 못하지만, 조금 찾아보니 app router에서 router group을 사용했을 때 그룹마다 레이아웃을 다르게 적용할 수 있고 유지보수에도 좋다는 것을 알게 됐습니다. 해당 부분들을 염두에 두고 프로젝트를 세팅하신 점이 좋았습니다!

@six-standard six-standard requested a review from BDlhj November 23, 2024 17:35
@HA0N1
Copy link

HA0N1 commented Nov 23, 2024

리뷰

  1. 주석 처리된 코드가 있는데, 추후에 사용할 예정이라면 TODO 주석을 추가하는 건 어떠신가요? 나중에 작업해야 할 부분을 쉽게 찾을 수 있어 도움이 될 것 같습니다!
  2. .env.sample 같은 파일을 생성하여 필요한 환경 변수 목록을 문서화하는건 어떤가요? 셋업할 때 설정 누락을 방지할 수 있을 거 같습니다!

논의하고 싶은 점

ESLint 설정과 관련하여 몇 가지 규칙을 제안드리고 싶습니다!

  1. 유명 eslint 설정 추가
  • eslint-config-airbnb 규칙 확장을 고려해보면 좋을 것 같습니다!
  1. 타입스크립트 관련 규칙 추가
'@typescript-eslint/promise-function-async' // Promise 반환 함수에 async 강제
'@typescript-eslint/explicit-function-return-type' // 함수 반환 타입 명시
'@typescript-eslint/consistent-type-assertions'  //타입 단언보다 타입 선언 사용 권장
'@typescript-eslint/naming-convention' // 네이밍 컨벤션 (현재 `변수, 함수 : 카멜`, `typeLike : 파스칼` 로 구성 되어있습니다) 

사용에 불필요하거나 불편하신 게 있다면 같이 수정해가면 좋겠습니다!

좋았던 점

전체적인 코드 구조가 매우 깔끔하게 나누어져 있어서 이해하기 쉬웠습니다! ( )가 무엇인지 찾아보던 중 라우트 그룹화 기능을 처음 접하게 되었는데 이번 기회에 새로운 Next.js 기능을 배우게 되어 좋았습니다!

@six-standard
Copy link
Member Author

리뷰

주석 처리된 코드가 있는데, 추후에 사용할 예정이라면 TODO 주석을 추가하는 건 어떠신가요? 나중에 작업해야 할 부분을 쉽게 찾을 수 있어 도움이 될 것 같습니다!

논의하고 싶은 점

ESLint 설정과 관련하여 몇 가지 규칙을 제안드리고 싶습니다!

  1. 유명 eslint 설정 추가
  • eslint-config-airbnb 규칙 확장을 고려해보면 좋을 것 같습니다!
  1. 타입스크립트 관련 규칙 추가
'@typescript-eslint/promise-function-async' // Promise 반환 함수에 async 강제
'@typescript-eslint/explicit-function-return-type' // 함수 반환 타입 명시
'@typescript-eslint/consistent-type-assertions'  //타입 단언보다 타입 선언 사용 권장
'@typescript-eslint/naming-convention' // 네이밍 컨벤션 (현재 `변수, 함수 : 카멜`, `typeLike : 파스칼` 로 구성 되어있습니다) 

사용에 불필요하거나 불편하신 게 있다면 같이 수정해가면 좋겠습니다!

좋았던 점

전체적인 코드 구조가 매우 깔끔하게 나누어져 있어서 이해하기 쉬웠습니다! ( )가 무엇인지 찾아보던 중 라우트 그룹화 기능을 처음 접하게 되었는데 이번 기회에 새로운 Next.js 기능을 배우게 되어 좋았습니다!

주석 처리된 코드는 폰트 관련 코드인데, 현재 feature/login 브랜치에서 세팅한 상태입니다!

또한, 유명 ESLint 세팅 중 유기(?)된 것으로 추측되는 것들이 좀 많이 보여서 적용하지 못했습니다. (eslint-config-airbnb는 typescript 지원 버전이 archived, 본가 버전은 flat이라는 신형 ESLint 세팅 파일 미지원 / eslint-config-google은 5년 전이 마지막 커밋. 최근 다운로드 기록이 꽤 많긴 하지만 뭔가 애매한 상황)

Typescript 관련 규칙은 전부 warn으로 적용하였습니다!

Copy link

@BDlhj BDlhj left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!👏🏻

Copy link
Member

@Nuung Nuung left a comment

Choose a reason for hiding this comment

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

저는 뭐 readme file 만 업데이트 되면 될 것 같다고 생각합니다!

@HA0N1
Copy link

HA0N1 commented Nov 24, 2024

맞습니다 기준님 말씀대로 eslint-config-airbnb-typescript 는 사용하게 되면 오류가 치덕치덕 생깁니다!.
그래서 차선책으로 airbnb 규칙 + tslint의 recommended + typescript 규칙 커스터마이징 하여 설정한 상태입니다!

airbnb-base(or airbnb)의 불필요한 JS 규칙들을 사용하지 않는다면 tslint.strict + tslint.recommended 정도로 사용해보는건 어떨까요?!

strict 설정 : https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
recommended 설정 : https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts

Copy link

@six-standard
Copy link
Member Author

말씀해주신 부분들 전부 반영했습니다!
이제 머지 진행하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants