Validate links against the built site; retire starlight-links-validator#359
Draft
atovpeko wants to merge 1 commit into
Draft
Validate links against the built site; retire starlight-links-validator#359atovpeko wants to merge 1 commit into
atovpeko wants to merge 1 commit into
Conversation
Replaces the markdown-AST link validator with scripts/check-built-links.mjs, which checks rendered HTML in dist/: it resolves relative links and partial-sourced anchors correctly and resolves Astro + Vercel redirects, eliminating ~63 false positives while catching real breaks the AST checker missed. Rewires pnpm lint:links to build + check, adds lint:links:local and check:links, removes the starlight-links-validator plugin and dependency, and adds a key-free CI workflow.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Checklist CompleteThank you for taking the time to properly review your PR! All checklist items are complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Replaces
starlight-links-validator(which checks the markdown AST) with a checker that validates the built HTML (scripts/check-built-links.mjs), and wires it into CI.Why: the AST validator had structural blind spots — it flagged ~63 false positives (relative links in shared AWS/Azure partials, and anchors whose heading comes from an imported partial) while missing real broken links (e.g. links inside custom components, and broken changelog permalinks). Checking rendered HTML fixes both: relative links are already absolute, partial-sourced anchors are real IDs, and it resolves Astro + Vercel redirects so legitimately-redirected links don't false-positive.
scripts/check-built-links.mjs: walksdist/, validates every internal<a href>resolves to a real page (or an Astro/Vercel redirect source) and that anchors exist. Base-path aware; skips the auto-generated REST reference (absent without Stainless); clear "run a build first" guard.package.json:lint:linksnow builds then runs the checker; addslint:links:local(no Stainless key) andcheck:links(check an existingdist/). Drops thestarlight-links-validatordependency.astro.config.ts: removes the validator plugin..github/workflows/links.yml: runspnpm lint:links:localon relevant PRs — key-free, so it works on forks.AGENTS.md: documents the new commands and behavior.Affected pages
No content pages affected by this PR. Open the preview to confirm the build deployed successfully.
Related Issues
If there is a related issue, please add it below (just put the number after the # below, and GitHub will automatically create a link):
Issue: #number
Checklist before requesting a review