Open
Conversation
- Vitest 테스트 환경 설정 - Notion 블록 타입 정의 (14가지 블록 타입) - NotionBlockParser 클래스 구현 (블록 파싱 로직) - NotionBlocksRenderer 컴포넌트 구현 (React 렌더링) - 47개 테스트 케이스 작성 및 모두 통과 파일 구조: - api/blocks/block-types.ts: 타입 정의 - api/blocks/block-parser.ts: 파싱 로직 - api/blocks/block-parser.test.ts: 파서 테스트 (24 tests) - api/blocks/block-renderer.tsx: 렌더링 컴포넌트 - api/blocks/block-renderer.test.tsx: 렌더러 테스트 (23 tests)
- Notion 블록 가져오기 API 함수 구현 (api/post-detail.ts) - getPostById: 페이지 정보 가져오기 - getPageBlocks: 블록 재귀적으로 가져오기 - getPostWithBlocks: 페이지와 블록 동시 가져오기 - 블로그 상세 페이지 구현 (/app/blog/[id]/page.tsx) - 기존 디자인과 일관된 스타일링 - 다크모드 지원 - 썸네일, 제목, 메타정보, 카테고리 표시 - Notion 블록 렌더링 - Notion 블록 전용 스타일링 (app/globals.css) - 14가지 블록 타입별 스타일 - 다크모드 완벽 지원 - 코드 하이라이팅, Callout, 이미지 등 - 기존 디자인 시스템과 조화 - 에러 핸들링 강화 - 환경 변수 누락 시 graceful degradation - TypeScript 타입 안정성 개선 - 빌드 에러 수정 빌드 테스트: ✅ 성공 단위 테스트: ✅ 47개 통과
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
Notion API를 활용한 블로그 글 상세 페이지를 구현했습니다. TDD 방식으로 테스트를 먼저 작성하고, Notion 블록 파서와 렌더러를 구축했습니다.
주요 변경사항
1️⃣ 테스트 환경 설정
2️⃣ Notion 블록 파서 시스템
타입 정의 (
api/blocks/block-types.ts)파서 로직 (
api/blocks/block-parser.ts)NotionBlockParser클래스 구현렌더러 (
api/blocks/block-renderer.tsx)3️⃣ API 함수
포스트 상세 API (
api/post-detail.ts)getPostById()- 페이지 정보 가져오기getPageBlocks()- 블록 재귀적으로 가져오기getPostWithBlocks()- 페이지와 블록 동시 가져오기4️⃣ 블로그 상세 페이지
페이지 구현 (
/app/blog/[id]/page.tsx)스타일링 (
app/globals.css)5️⃣ 에러 핸들링
지원하는 Notion 블록 타입
테스트 결과
파일 구조
다음 단계
/blog)