Support split and consolidated upstream docs layouts#62
Support split and consolidated upstream docs layouts#62
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ 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 |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Cloudflare preview deployed.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Split-only link rewriting applied unconditionally breaks consolidated layout
- The flattened OSS link rewrite now runs only when a split docs layout is detected, preventing incorrect path shortening in consolidated docs.
Or push these changes by commenting:
@cursor push fa2cf87809
Preview (fa2cf87809)
diff --git a/scripts/prepare-docs.mjs b/scripts/prepare-docs.mjs
--- a/scripts/prepare-docs.mjs
+++ b/scripts/prepare-docs.mjs
@@ -591,7 +591,9 @@
}
await rewriteProLinks(path.join(docsRoot, "pro"));
- await rewriteFlattenedOssLinks(docsRoot);
+ if (layout === "split") {
+ await rewriteFlattenedOssLinks(docsRoot);
+ }
await injectProFriendlyNotice(docsRoot);
await fixKnownDocsIssues(docsRoot);
await normalizeCodeFences(docsRoot);| if (await exists(sourceAssetsRoot)) { | ||
| await fs.cp(sourceAssetsRoot, path.join(docsRoot, "assets"), { recursive: true }); | ||
| if (await exists(layoutPaths.assetsRoot)) { | ||
| await fs.cp(layoutPaths.assetsRoot, path.join(docsRoot, "assets"), { recursive: true }); |
There was a problem hiding this comment.
Split-only link rewriting applied unconditionally breaks consolidated layout
Medium Severity
rewriteFlattenedOssLinks is called unconditionally regardless of the detected layout, but its regex transformations (../../pro/ → ../pro/, ../../images/ → ../images/) are only correct for the split layout where the oss/ directory level has been removed. For the consolidated layout, two-level-deep docs like building-features/node-renderer/basics.md and upgrading/release-notes/*.md (confirmed in the sidebar) legitimately use ../../pro/ to reach the docs root — this function would incorrectly shorten those to ../pro/, producing broken links.



Closes #14
Summary
split(docs/oss+docs/pro) vsconsolidated(docs/*+docs/pro/*) layoutsoss/Verification
npm run test:docs-layoutnpm run prepare:subsetnpm run build:fullNote
Medium Risk
Moderate risk because it changes the docs sync/prepare file-copy logic and path assumptions; a wrong layout detection or exclusion set could lead to missing or mislocated docs in the generated Docusaurus site.
Overview
Adds a shared
scripts/docs-layout.mjshelper that auto-detects upstream docs structure ("split"oss/+pro/vs "consolidated" single tree +pro/) and centralizes subset path mapping.Updates
scripts/sync-docs.mjsandscripts/prepare-docs.mjsto use the detected layout for copying docs/assets and for building the docs subset (instead of hardcodedoss/paths), including excludingpro/,images/, andassets/when copying a consolidated root.Introduces
node --testcoverage (scripts/docs-layout.test.mjs) with fixtures and wires it via a newnpm run test:docs-layoutscript.Written by Cursor Bugbot for commit e892de2. This will update automatically on new commits. Configure here.