Skip to content

Commit b0aae84

Browse files
authored
🤖 fix: add mdbook linkcheck to static-check, rename docs targets (#833)
_Generated with `mux`_ - **docs** now builds documentation (was docs-build) - **docs-server** serves docs locally with browser (was docs) - **check-docs-links** runs mdbook-linkcheck after building - **static-check** now includes check-docs-links
1 parent b3be437 commit b0aae84

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ include fmt.mk
4949
.PHONY: test test-unit test-integration test-watch test-coverage test-e2e smoke-test
5050
.PHONY: dist dist-mac dist-win dist-linux
5151
.PHONY: vscode-ext vscode-ext-install
52-
.PHONY: docs docs-build docs-watch
52+
.PHONY: docs docs-server docs-watch check-docs-links
5353
.PHONY: storybook storybook-build test-storybook chromatic
5454
.PHONY: benchmark-terminal
5555
.PHONY: ensure-deps rebuild-native
@@ -213,7 +213,7 @@ build/icon.png: docs/img/logo.webp scripts/generate-icons.ts
213213
@bun scripts/generate-icons.ts png
214214

215215
## Quality checks (can run in parallel)
216-
static-check: lint typecheck fmt-check check-eager-imports check-bench-agent ## Run all static checks (includes startup performance checks)
216+
static-check: lint typecheck fmt-check check-eager-imports check-bench-agent check-docs-links ## Run all static checks (includes startup performance checks)
217217

218218
check-bench-agent: ## Verify terminal-bench agent configuration and imports
219219
@./scripts/check-bench-agent.sh
@@ -337,15 +337,24 @@ vscode-ext-install: ## Build and install VS Code extension locally
337337
@$(MAKE) -C vscode install
338338

339339
## Documentation
340-
docs: ## Serve documentation locally
341-
@./scripts/docs.sh
342-
343-
docs-build: ## Build documentation
340+
docs: ## Build documentation
344341
@./scripts/docs_build.sh
345342

343+
docs-server: ## Serve documentation locally (opens browser)
344+
@./scripts/docs.sh
345+
346346
docs-watch: ## Watch and rebuild documentation
347347
@cd docs && mdbook watch
348348

349+
check-docs-links: ## Check documentation for broken links (requires mdbook tools via nix)
350+
@if command -v mdbook >/dev/null 2>&1 && command -v mdbook-linkcheck >/dev/null 2>&1; then \
351+
$(MAKE) docs && \
352+
echo "🔗 Checking documentation links..." && \
353+
cd docs && mdbook-linkcheck --standalone .; \
354+
else \
355+
echo "⏭️ Skipping docs link check (mdbook tools not installed - use 'nix develop' for full checks)"; \
356+
fi
357+
349358
## Storybook
350359
storybook: node_modules/.installed ## Start Storybook development server
351360
$(check_node_version)

docs/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ gh pr view <number> --json mergeable,mergeStateStatus | jq '.'
4949
- Package manager: bun only. Use `bun install`, `bun add`, `bun run` (which proxies to Make when relevant). Run `bun install` if modules/types go missing.
5050
- Makefile is source of truth (new commands land there, not `package.json`).
5151
- Primary targets: `make dev|start|build|lint|lint-fix|fmt|fmt-check|typecheck|test|test-integration|clean|help`.
52+
- Full `static-check` includes docs link checking which requires mdbook tools. Use `nix develop` to get them, or the check gracefully skips if unavailable.
5253

5354
## Refactoring & Runtime Etiquette
5455

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This directory contains the source for mux documentation built with [mdbook](htt
55
## Quick Start
66

77
```bash
8-
# Serve docs with hot reload (opens in browser)
8+
# Build docs
99
bun docs
1010

11-
# Build docs
12-
bun docs:build
11+
# Serve docs with hot reload (opens in browser)
12+
bun docs:serve
1313

1414
# Watch for changes (no server)
1515
bun docs:watch

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
mdbook
135135
mdbook-mermaid
136136
mdbook-linkcheck
137+
mdbook-pagetoc
137138

138139
# Terminal bench
139140
uv

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dist:win": "make dist-win",
3838
"dist:linux": "make dist-linux",
3939
"docs": "make docs",
40-
"docs:build": "make docs-build",
40+
"docs:serve": "make docs-server",
4141
"docs:watch": "make docs-watch",
4242
"storybook": "make storybook",
4343
"storybook:build": "make storybook-build",

0 commit comments

Comments
 (0)