This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Development (runs server + Vite concurrently)
pnpm dev
# Build
pnpm build
# Run tests
pnpm test # Run tests once
pnpm test:watch # Watch mode
pnpm test:coverage # With coverage
# Linting and formatting
pnpm lint # ESLint + Stylelint
pnpm lint:fix # Auto-fix lint issues
pnpm fmt # Prettier format
pnpm fmt:check # Check formattingThis is a CLI tool for reviewing Markdown files with inline comments in the browser.
- CLI Mode (
md-review <file>): Single file preview usingCliModeApp - Dev Mode (
md-reviewormd-review <dir>): File browser with tree view usingDevModeApp
Mode detection happens in App.tsx via /api/files endpoint availability.
server/index.js: Hono-based Node.js server- Serves static files from
dist/ - API endpoints:
/api/markdown,/api/files,/api/watch(SSE) - File watching via chokidar for hot reload
- Serves static files from
bin/md-review.js: CLI entry point, spawns server processsrc/: React frontend (Vite)
MarkdownPreview: Main preview component with line-by-line renderingCommentList: Manages inline comments (persisted to localStorage)SelectionPopover: Text selection UI for adding commentsFileTree: Directory browser with search
- CLI parses args → sets
MARKDOWN_FILE_PATHorBASE_DIRenv vars - Server reads files from these paths
- SSE connection (
/api/watch) enables hot reload on file changes - Comments stored in localStorage, keyed by file path