# DocuMCP Makefile
# Provides convenient commands for building, testing, and coverage analysis
.PHONY: help install build test test-watch coverage coverage-html clean lint format check-types dev benchmark
# Default target
help:
@echo "DocuMCP Development Commands"
@echo "============================"
@echo ""
@echo "Setup & Installation:"
@echo " install Install dependencies"
@echo " clean Clean build artifacts and node_modules"
@echo ""
@echo "Development:"
@echo " build Build TypeScript to JavaScript"
@echo " dev Start development mode with watch"
@echo " lint Run ESLint"
@echo " format Format code with Prettier"
@echo " check-types Run TypeScript type checking"
@echo ""
@echo "Testing:"
@echo " test Run all tests"
@echo " test-watch Run tests in watch mode"
@echo " coverage Run tests with coverage report"
@echo " coverage-html Generate HTML coverage report"
@echo " benchmark Run performance benchmarks"
@echo ""
@echo "Quality Assurance:"
@echo " qa Run full QA suite (lint, types, test, coverage)"
@echo " ci Run CI pipeline locally"
# Installation
install:
@echo "π¦ Installing dependencies..."
npm install
# Build
build:
@echo "π¨ Building TypeScript..."
npm run build
# Development
dev:
@echo "π Starting development mode..."
npm run dev
# Linting and formatting
lint:
@echo "π Running ESLint..."
npm run lint
format:
@echo "β¨ Formatting code..."
npm run format
check-types:
@echo "π Checking TypeScript types..."
npx tsc --noEmit
# Testing
test:
@echo "π§ͺ Running tests..."
npm test
test-watch:
@echo "π Running tests in watch mode..."
npm run test:watch
coverage:
@echo "π Running test coverage..."
npm run test:coverage
coverage-html:
@echo "π Generating HTML coverage report..."
npm run test:coverage -- --coverageReporters=html
@echo "π Coverage report generated in coverage/lcov-report/index.html"
@echo "π Open coverage/lcov-report/index.html in your browser"
benchmark:
@echo "β‘ Running performance benchmarks..."
npm run benchmark
# Quality Assurance
qa: lint check-types test coverage
@echo "β
Quality assurance complete!"
ci: install build qa
@echo "π― CI pipeline complete!"
# Cleanup
clean:
@echo "π§Ή Cleaning up..."
rm -rf node_modules
rm -rf dist
rm -rf coverage
rm -rf .nyc_output
@echo "β¨ Clean complete!"
# Development helpers
quick-test:
@echo "β‘ Running quick tests (no coverage)..."
npm test -- --passWithNoTests
test-specific:
@echo "π― Running specific test file..."
@echo "Usage: make test-specific FILE=path/to/test.ts"
npm test -- $(FILE)
coverage-specific:
@echo "π Running coverage for specific file..."
@echo "Usage: make coverage-specific FILE=path/to/test.ts"
npm run test:coverage -- $(FILE)
# Git helpers
git-status:
@echo "π Git status..."
git status
git-push: qa
@echo "π Running QA before push..."
git push
# Documentation
docs-validate:
@echo "π Validating documentation..."
npm run test:docs
# Epic #9 Coverage Check
coverage-check:
@echo "π― Checking Epic #9 coverage targets..."
@echo "Target: 85% across all metrics"
@echo "Running coverage analysis..."
npm run test:coverage | grep -E "(All files|% Stmts|% Branch|% Funcs|% Lines)"
# Show current coverage for specific files
coverage-files:
@echo "π Current coverage by file..."
npm run test:coverage -- --verbose
# Run only failing tests
test-failed:
@echo "π₯ Running only failed tests..."
npm test -- --onlyFailures
# Watch mode for specific test file
test-watch-file:
@echo "π Watching specific test file..."
@echo "Usage: make test-watch-file FILE=path/to/test.ts"
npm test -- --watch $(FILE)