Skip to content

Add automated local link and asset checker#317

Merged
GsCommand merged 1 commit into
mainfrom
codex/add-local-link-and-asset-checker-script
May 23, 2026
Merged

Add automated local link and asset checker#317
GsCommand merged 1 commit into
mainfrom
codex/add-local-link-and-asset-checker-script

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Provide a repeatable, repo-local audit to catch broken internal HTML links and missing static assets before releases.
  • Keep checks lightweight and dependency-free by using a small Node script with only built-in fs/path modules.

Description

  • Add scripts/check-local-links.mjs which scans public/**/*.html, extracts local refs from href, src, content (when starting with /), and url(...) inside inline <style> blocks, and resolves them against public/ using static resolution rules.
  • Add check:links npm script in package.json to run the checker via node scripts/check-local-links.mjs.
  • The checker ignores external schemes (http(s)://, mailto:, tel:, javascript:), hash-only links, and allowlisted dynamic routes /api/verify, /api/examples/coinbase-webhook, /api/examples/x402-paid-action, and /verify/r.
  • The script fails with a non-zero exit code if any referenced local target is missing or if any file in the repository contains the forbidden icon2.png token.

Testing

  • Ran npm test which passed all automated tests (95 passed, 0 failed).
  • Ran npm run check:links iteratively during development, fixed self-reference and allowlist issues, and the final npm run check:links invocation succeeded with the message All local links/assets resolved across 24 HTML files..
  • Verified there are no occurrences of the forbidden token with grep -RIn "icon2.png" . 2>/dev/null which returned no matches (exit code indicates none found).

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 23, 2026 11:43pm
commandlayer-org Ready Ready Preview, Comment May 23, 2026 11:43pm
commandlayer-org111 Ready Ready Preview, Comment May 23, 2026 11:43pm

Request Review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant