feat(llms): add related links to raw markdown endpoint#3724
feat(llms): add related links to raw markdown endpoint#3724
Conversation
HugoRCD
commented
Feb 17, 2026
|
@HugoRCD is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughAdds a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/features/llms/runtime/server/routes/raw/[...slug].md.get.ts (1)
47-47: Consider narrowing the fallback lookup forlinks.
(page as unknown as Record<string, unknown>).linkswill match anylinksproperty on the page object, including potential future collisions. This is acceptable for now given the custom schema, but worth a note: ifPageCollectionItemBaseever adds its ownlinksfield with different semantics, this would silently pick it up.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/features/llms/runtime/server/routes/raw/`[...slug].md.get.ts at line 47, Narrow the lookup for links by preferring page.meta?.links and only falling back to page.links when it matches the expected shape: replace the current expression with logic that first reads (page as Record<string, unknown>)?.meta?.links and, if absent, checks (page as any).links but only uses it when it has the expected type/structure (e.g., Array.isArray(...) or has the expected keys). This keeps the variable links limited to the schema you expect and prevents silently picking up unrelated future page.links properties.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@playground/content.config.ts`:
- Around line 39-43: The schema currently requires links: z.array(z.object({
label: z.string(), icon: z.string(), to: z.string() })), which forces every page
to provide links and every link to include icon; change the schema so links is
optional or defaults to an empty array and make the icon field optional: update
the links definition (the z.array/z.object block) to use either
z.optional(z.array(...)) or z.array(...).default([]) and change icon to
z.string().optional() so pages without links or link icons validate correctly.
In `@playground/nuxt.config.ts`:
- Around line 8-11: The llms config block is out of order and triggers
nuxt/nuxt-config-keys-order; move the llms object so it appears after the core
Nuxt keys (e.g., after the hub key or at the end of the exported config) rather
than between modules and content; locate the llms block in nuxt.config.ts and
cut/paste it below the core keys (or to the file end) to restore the expected
key ordering while keeping the llms object contents unchanged.
---
Nitpick comments:
In `@src/features/llms/runtime/server/routes/raw/`[...slug].md.get.ts:
- Line 47: Narrow the lookup for links by preferring page.meta?.links and only
falling back to page.links when it matches the expected shape: replace the
current expression with logic that first reads (page as Record<string,
unknown>)?.meta?.links and, if absent, checks (page as any).links but only uses
it when it has the expected type/structure (e.g., Array.isArray(...) or has the
expected keys). This keeps the variable links limited to the schema you expect
and prevents silently picking up unrelated future page.links properties.
commit: |