Skip to content

Add CI: typecheck + relative-href sanity check#4

Merged
BGebken merged 1 commit intofix/broken-footer-doc-linksfrom
ci/add-typecheck-and-linkcheck
Apr 29, 2026
Merged

Add CI: typecheck + relative-href sanity check#4
BGebken merged 1 commit intofix/broken-footer-doc-linksfrom
ci/add-typecheck-and-linkcheck

Conversation

@BGebken
Copy link
Copy Markdown
Contributor

@BGebken BGebken commented Apr 18, 2026

Summary

  • Adds a verify job that runs on every PR and push to main: typecheck → href sanity check → build.
  • deploy now depends on verify passing, so a broken build can't ship to Pages.
  • Adds typescript, @types/react, @types/react-dom, @types/node as dev deps (project had a tsconfig.json but no compiler installed).
  • The href check is a simple grep that flags any href="..." in src/ whose value doesn't start with http(s)://, mailto:, tel:, #, or /. Would have caught the 13 broken footer links fixed in Fix broken footer doc links (argus.huntridgelabs.com/docs/*.md 404s) #3.

Why grep, not a link checker?

The site is a Vite SPA — hrefs live in the JS bundle after build, not in the built HTML, so tools like lychee that scan dist/**/*.html wouldn't see them. A source-level regex is the lowest-friction catch for this specific class of bug.

PR base

This PR is targeted at fix/broken-footer-doc-links (#3) so its own CI run passes. Once #3 merges, GitHub will auto-retarget this PR to main.

Test plan

  • Verify the verify job runs on this PR and passes
  • Temporarily push a commit with a bad href (e.g. href="test.md") to confirm the check fails
  • After merge, confirm deploy still runs successfully on push to main

🤖 Generated with Claude Code

Previously the deploy workflow ran only `npm run build` and pushed the
output straight to Pages. Type errors and broken relative href values
(like the footer docs links fixed in #3) could only be caught in
production.

- Add `typecheck` script (`tsc --noEmit`) and `typescript` + `@types/*`
  dev deps.
- Split workflow into `verify` (runs on push + PR) and `deploy` (runs
  only on push to main). Deploy now depends on verify passing.
- verify runs: npm ci → typecheck → href sanity check → build.
- The href check greps src/ for any `href="..."` whose value doesn't
  start with http(s):, mailto:, tel:, #, or /. This catches the exact
  class of bug where a relative path like "docs/foo.md" was shipped
  to a site that doesn't host those files.

Note: lychee/link-checkers weren't appropriate here — the site is a
Vite SPA, so hrefs live in the JS bundle, not in the built HTML.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@BGebken BGebken merged commit f5288ff into fix/broken-footer-doc-links Apr 29, 2026
2 checks passed
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