fix: separate blog and component doc surfaces#803
fix: separate blog and component doc surfaces#803sabraman wants to merge 2 commits intoncdai:mainfrom
Conversation
|
@sabraman is attempting to deploy a commit to the React Wheel Picker OSS Program Team on Vercel. A member of the Team first needs to authorize it. |
|
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)
📝 WalkthroughWalkthroughReplaced calls to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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.
🧹 Nitpick comments (1)
src/features/doc/data/documents.ts (1)
64-66: Add an explicit return type for exportedgetBlogDocs.This is part of the public data-layer API; declaring
: Doc[]makes the contract stable and clearer for downstream callers.Proposed diff
-export function getBlogDocs() { +export function getBlogDocs(): Doc[] { return getAllDocs().filter((doc) => doc.metadata.category !== "components") }As per coding guidelines "Use TypeScript strict mode with explicit types when necessary in TypeScript files".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/features/doc/data/documents.ts` around lines 64 - 66, Add an explicit return type to the exported function getBlogDocs by declaring it as returning Doc[] (i.e., change the signature of getBlogDocs to include : Doc[]); also ensure the Doc type is imported or defined in this module so the signature compiles. This makes the public data-layer API contract explicit and satisfies TypeScript strict-mode guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/features/doc/data/documents.ts`:
- Around line 64-66: Add an explicit return type to the exported function
getBlogDocs by declaring it as returning Doc[] (i.e., change the signature of
getBlogDocs to include : Doc[]); also ensure the Doc type is imported or defined
in this module so the signature compiles. This makes the public data-layer API
contract explicit and satisfies TypeScript strict-mode guidelines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 67ffc4e7-d1b8-4b0f-8f36-20bf178d91da
📒 Files selected for processing (6)
src/app/(app)/(docs)/blog/[slug]/page.tsxsrc/app/(app)/(docs)/blog/page.tsxsrc/app/(app)/(docs)/blog/rss/route.tssrc/app/sitemap.tssrc/features/doc/data/documents.tssrc/features/portfolio/components/blog.tsx
Summary
This PR separates blog-only surfaces from component documentation surfaces.
Several blog entry points were sourcing data from
getAllDocs(), which includes both uncategorized blog posts and docs withcategory: "components". As a result, component docs could leak into the blog index, the homepage blog panel, the blog RSS feed, and blog URLs in the sitemap.Changes
getBlogDocs()to return only non-component docsgetBlogDocs()for the blog indexgetBlogDocs()for blog RSS generationgetBlogDocs()for the homepage blog panelnotFound()for component docs under/blog/[slug]getBlogDocs()for blog URLs in the sitemapVerification
pnpm check-typesSummary by CodeRabbit