fix(docs): Normalize example link paths on Windows - #11187
Conversation
Normalize platform-specific separators before applying the slash-based example mapping so test:docs validates framework example links consistently on Windows. Add a cross-platform integration regression for the example link path.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe link verifier now normalizes platform-specific path separators before matching documentation example paths. A cross-platform integration test creates a temporary fixture, runs verification, checks successful output, and cleans up afterward. ChangesCross-platform link verification
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change is localized to Windows path handling and regression coverage, with no actionable merge-blocking risk remaining after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Summary
Fixes #11177.
verify-links.tsuses forward-slash checks when it maps framework example links fromdocs/framework/{framework}/examples/toexamples/{framework}/. Windows resolves the intermediate path with backslashes, so valid example links are treated as missing Markdown files.This change normalizes platform separators only for the existing example-path matching and rewrite, while keeping native paths for filesystem checks. It also adds an integration regression that runs the link verifier against a temporary framework-example fixture.
Verification
node --experimental-strip-types --test scripts/verify-links.test.tson Linuxnode --experimental-strip-types --test scripts/verify-links.test.tson Windows Node 22.22.0prettier --config prettier.config.js --check scripts/verify-links.ts scripts/verify-links.test.tsThe unmodified script reproduces the reported broken link on Windows; the patched script passes the same fixture.
Summary by CodeRabbit
Bug Fixes
Tests