Skip to content

Add automated local link and asset checker#321

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

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

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Provide a lightweight, repeatable repo script to catch broken internal links and missing local assets before releases.
  • Ensure release audits detect accidental references like /icon2.png and missing page or asset targets in public/**/*.html without requiring network access.

Description

  • Add scripts/check-local-links.mjs, a small Node script that scans public/**/*.html, extracts local references from href, src, content (when it begins with /), and url(...) inside inline <style> blocks and normalizes them for resolution.
  • Resolve local routes so / => public/index.html, /page => public/page.html or public/page/index.html, and treat direct paths (e.g. /favicon.ico) as files under public; external schemes and anchors are ignored.
  • Allowlist known dynamic runtime routes including /verify/r, /api/verify, /api/agents/verifyagent, /api/examples/coinbase-webhook, /api/examples/x402-paid-action, /api/auth/nonce, /api/auth/verify, and /api/ens/owned so UI references to runtime APIs do not fail the check.
  • Enforce a forbidden-token check for accidental references to icon2.png (obfuscated inside the script to avoid self-detection), and exit with non-zero status when missing targets or forbidden tokens are found, otherwise print a concise success message.
  • Add/verify an npm script entry check:links to run the checker via node scripts/check-local-links.mjs (exists in package.json).

Testing

  • Ran npm test and all tests passed (103 tests, 0 failures) so existing test suite is unchanged and green.
  • Ran npm run check:links and it completed successfully with the message All local links/assets resolved across 25 HTML files..
  • Ran grep -RIn "icon2.png" . and confirmed no matches found after obfuscating the forbidden token inside the checker, so the forbidden-token enforcement did not produce false positives.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 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 24, 2026 12:01am
commandlayer-org Ready Ready Preview, Comment May 24, 2026 12:01am
commandlayer-org111 Ready Ready Preview, Comment May 24, 2026 12:01am

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