Refactor: Consolidate duplicated BlogPost interface into a shared type#98
Refactor: Consolidate duplicated BlogPost interface into a shared type#98Atharva0506 wants to merge 1 commit intoStabilityNexus:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThe PR consolidates blog-related TypeScript type definitions from multiple files into a centralized Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 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 |
Addressed Issues:
Fixes #(TODO:issue number)
Screenshots/Recordings:
No visual changes. This is a pure codebase health/refactoring update.
Description:
This pull request addresses code duplication by consolidating the
BlogPostinterface, which was previously defined independently across 4 separate files, into a single central source of truth intypes/blog.ts.All component and utility consumers (
lib/blog.ts,lib/blog-server.ts,app/page.tsx,components/blog-card.tsx, andapp/a/[slug]/BlogPostClient.tsx) have been updated to utilize TypeScript'simport typeto import the sharedBlogPostandPaginatedPostsinterfaces. This change ensures type consistency, improves maintainability, and follows DRY principles.Additional Notes:
import typestandard for TypeScript imports.types/blog.tsto host global types.PaginatedDatainline type inlib/blog.tsandapp/page.tsxwas also extracted toPaginatedPostsin the new types file.AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit