fix: replace broken check-links script with working tool#525
Conversation
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
✅ Deploy Preview for project-hami ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe ChangesLink Checker Update
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
package.json (2)
26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider pinning
linkinatoras a devDependency.This script now relies on
npx linkinatorresolving an unpinned, latest published version at run time. Given the exact failure this PR fixes was caused by relying on an npx-resolved package name that no longer existed, pinninglinkinatorindevDependencies(and invoking it without npx, or with a version-locked npx call) would reduce the chance of a similar future breakage and make CI/local runs reproducible.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 26, The check-links script currently uses npx linkinator, which can resolve an unpinned version at runtime and makes CI/local runs non-reproducible. Update the package.json script to use a version-pinned linkinator from devDependencies, and adjust the check-links command to invoke the locally installed binary (or a version-locked npx call) so the behavior stays stable; reference the check-links script entry and the linkinator package declaration when making the change.
26-26: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAlign flags with the CI linkinator invocation.
The
.github/workflows/docs-health.ymlstep invoking linkinator uses--skip "^https?://"to avoid checking external links: the docs-health workflow runs a “Broken Internal Link Check” step that invokesnpx --yes linkinator ./build --recurseand fails the workflow whenBROKENappears in output. This local script omits--skip, so it will also probe every external URL. Since linkinator's default request timeout is0(no timeout), an unresponsive external site can make this "instant" local check hang indefinitely rather than failing fast.Consider mirroring the CI flags (at least
--skip "^https?://", and optionally--yesto skip the npx install-confirmation prompt for first-time runs):♻️ Suggested alignment
- "check-links": "npm run build && npx linkinator ./build --recurse || true", + "check-links": "npm run build && npx --yes linkinator ./build --recurse --skip \"^https?://\" || true",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 26, The check-links script is not aligned with the CI Linkinator invocation and may hang on external URLs. Update the package.json check-links command to match the docs-health workflow behavior by adding the same skip pattern used with linkinator (for example in the check-links script that runs npm run build and npx linkinator ./build --recurse), and consider using the no-prompt npx form as well so local runs behave consistently and avoid probing external links.Source: Linked repositories
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package.json`:
- Line 26: The check-links script currently uses npx linkinator, which can
resolve an unpinned version at runtime and makes CI/local runs non-reproducible.
Update the package.json script to use a version-pinned linkinator from
devDependencies, and adjust the check-links command to invoke the locally
installed binary (or a version-locked npx call) so the behavior stays stable;
reference the check-links script entry and the linkinator package declaration
when making the change.
- Line 26: The check-links script is not aligned with the CI Linkinator
invocation and may hang on external URLs. Update the package.json check-links
command to match the docs-health workflow behavior by adding the same skip
pattern used with linkinator (for example in the check-links script that runs
npm run build and npx linkinator ./build --recurse), and consider using the
no-prompt npx form as well so local runs behave consistently and avoid probing
external links.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mesutoezdil, windsonsea The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
check-links called npx html-link-checker, a package that does not exist on npm. The script always failed with a 404 for anyone who ran it. Swapped in linkinator, which is real and actively maintained.