Skip to content

ci: Add path and link validators#1070

Merged
louis-pre merged 6 commits into
mainfrom
add-cross-site-link-validator
Apr 22, 2026
Merged

ci: Add path and link validators#1070
louis-pre merged 6 commits into
mainfrom
add-cross-site-link-validator

Conversation

@louis-pre
Copy link
Copy Markdown
Member

@louis-pre louis-pre commented Apr 20, 2026

Summary

  • Add validate-paths script that checks SUMMARY.md file paths match their ## section headings
  • Add validate-links script that checks all absolute docs.seam.co URLs and relative markdown links resolve to existing files
  • Both run as CI steps in the generate workflow after codegen

Usage

npm run validate-paths   # SUMMARY.md path/section consistency
npm run validate-links   # broken absolute + relative links

How they work

validate-paths: Parses SUMMARY.md, tracks the current ## group heading, and verifies that each file path starts with the slugified heading (e.g., files under ## Developer Tools must start with developer-tools/).

validate-links: Scans all .md files under docs/, extracts https://docs.seam.co/latest/... URLs and relative markdown links, maps them to the correct site section directory, and checks that the target file exists on disk.

Current state

🤖 Generated with Claude Code

@louis-pre louis-pre requested review from a team as code owners April 20, 2026 23:48
@louis-pre louis-pre force-pushed the add-cross-site-link-validator branch 8 times, most recently from 8c324a6 to db743fb Compare April 21, 2026 17:37
@louis-pre louis-pre changed the title Add cross-site link validator ci: Add cross-site link validator Apr 21, 2026
@louis-pre louis-pre force-pushed the add-cross-site-link-validator branch 9 times, most recently from 862ad6a to f352cbf Compare April 21, 2026 20:16
@louis-pre louis-pre changed the title ci: Add cross-site link validator ci: Add self-link validator Apr 21, 2026
@louis-pre louis-pre force-pushed the add-cross-site-link-validator branch 2 times, most recently from 383972e to 857bed2 Compare April 21, 2026 20:59
@louis-pre louis-pre changed the title ci: Add self-link validator ci: Add path and link validators Apr 21, 2026
@louis-pre louis-pre force-pushed the add-cross-site-link-validator branch from 79ab453 to bf3c806 Compare April 22, 2026 00:20
louis-pre and others added 4 commits April 21, 2026 17:33
Scans all markdown files for broken links:
- Absolute docs.seam.co URLs: checks target exists in correct site section
- Relative links: resolves from file location and checks target exists

Skips images, anchors, GitBook templates, asset references, and file:// URIs.
Groups output by broken target for readability.

Run with: npm run validate-links
Runs in CI as part of the Generate workflow after codegen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validates that file paths in SUMMARY.md are consistent with their
section group heading. For example, a file listed under
"## Developer Tools" must have a path starting with "developer-tools/".

Usage: npm run validate-paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs the SUMMARY.md path validator after codegen, before link
validation. Ensures file paths stay in sync with their section headings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move site section definitions (name, root, urlPrefix) into config.ts
as the single source of truth. Both validate-paths and validate-links
now read from the shared config instead of defining their own lists.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
louis-pre and others added 2 commits April 21, 2026 17:33
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The catch-all Guides section (urlPrefix: '') was listed first, causing
all /api/... URLs to match Guides instead of API Reference. Reorder
so more-specific prefixes come first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@louis-pre louis-pre force-pushed the add-cross-site-link-validator branch from bf3c806 to 81a58e2 Compare April 22, 2026 00:33
@louis-pre louis-pre merged commit 3b66e1a into main Apr 22, 2026
9 checks passed
@louis-pre louis-pre deleted the add-cross-site-link-validator branch April 22, 2026 00:36
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.

1 participant