Skip to content

fix(docs): Normalize example link paths on Windows - #11187

Open
Gujiassh wants to merge 1 commit into
TanStack:mainfrom
Gujiassh:fix/windows-example-links-11177-clean
Open

fix(docs): Normalize example link paths on Windows#11187
Gujiassh wants to merge 1 commit into
TanStack:mainfrom
Gujiassh:fix/windows-example-links-11177-clean

Conversation

@Gujiassh

@Gujiassh Gujiassh commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Fixes #11177.

verify-links.ts uses forward-slash checks when it maps framework example links from docs/framework/{framework}/examples/ to examples/{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.ts on Linux
  • node --experimental-strip-types --test scripts/verify-links.test.ts on Windows Node 22.22.0
  • prettier --config prettier.config.js --check scripts/verify-links.ts scripts/verify-links.test.ts

The unmodified script reproduces the reported broken link on Windows; the patched script passes the same fixture.

Summary by CodeRabbit

  • Bug Fixes

    • Improved documentation link verification across operating systems by consistently handling different path separators.
    • Preserved accurate filesystem checks while matching example and documentation paths.
  • Tests

    • Added automated coverage using temporary documentation fixtures to confirm link verification succeeds across platforms.
    • Temporary test files are reliably cleaned up after each run.

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.
@Gujiassh
Gujiassh requested a review from a team as a code owner August 14, 2026 07:43
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22985602-25ce-454b-b2d0-3a5491f4694e

📥 Commits

Reviewing files that changed from the base of the PR and between 159982c and 61c4df9.

📒 Files selected for processing (2)
  • scripts/verify-links.test.ts
  • scripts/verify-links.ts

📝 Walkthrough

Walkthrough

The 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.

Changes

Cross-platform link verification

Layer / File(s) Summary
Normalize example paths and validate verification
scripts/verify-links.ts, scripts/verify-links.test.ts
The verifier converts resolved paths to forward-slash form before detecting and rewriting example paths. The integration test runs the verifier against a temporary fixture and removes the fixture in a finally block.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 61c4d

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: alemtuzlak

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the Windows path normalization fix for documentation example links.
Description check ✅ Passed The description explains the issue, implementation, verification, and linked issue, but omits the template checklist and release-impact sections.
Linked Issues check ✅ Passed The changes address issue #11177 by normalizing Windows separators for example-path matching and adding a regression test.
Out of Scope Changes check ✅ Passed The path normalization and integration regression test are directly related to the linked issue and stated pull request objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm test:docs reports 27 broken links on Windows because verify-links.ts assumes forward slashes

1 participant