-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (101 loc) · 3.56 KB
/
Makefile
File metadata and controls
125 lines (101 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Chrome DevTools MCP - Build Automation
.PHONY: install test lint format clean build package check dev help pre-commit
# Default target
help:
@echo "Chrome DevTools MCP - Build Commands"
@echo ""
@echo "Development:"
@echo " install Install dependencies with uv"
@echo " dev Install in development mode"
@echo " test Run full test suite"
@echo " test-quick Run quick smoke tests"
@echo " test-dom Run DOM manipulation tests"
@echo " test-console Run console and JavaScript tests"
@echo " test-network Run network monitoring tests"
@echo " lint Run linting checks"
@echo " format Format code with ruff"
@echo " check Run all checks (lint + type check + test)"
@echo " pre-commit Run pre-commit hooks"
@echo ""
@echo "Distribution:"
@echo " package Build DXT extension package"
@echo " clean Remove build artifacts"
@echo ""
@echo "CI/CD:"
@echo " ci-test Run full CI test suite"
# Development setup
install:
uv sync
dev: install install-pre-commit
uv run mcp install server.py -n "Chrome DevTools MCP" --with-editable .
# Code quality
lint:
uv run ruff check .
format:
uv run ruff format .
typecheck:
uv run mypy src/
# Pre-commit hooks
pre-commit:
uv run pre-commit run --all-files
install-pre-commit:
uv run pre-commit install
# Testing
test:
uv run python -m pytest test_devtools_server.py -v
test-quick:
uv run python -m pytest test_devtools_server.py::test_chrome_detection test_devtools_server.py::test_javascript_execution -v
test-dom:
uv run python -m pytest test_devtools_server.py -k "test_get_document or test_query_selector or test_element" -v
test-console:
uv run python -m pytest test_devtools_server.py -k "test_javascript or test_console" -v
test-network:
uv run python -m pytest test_devtools_server.py -k "test_network" -v
# All checks
check: pre-commit
# CI test suite
ci-test: install check
# Packaging
package: clean
@echo "Building DXT extension package..."
@VERSION=$$(jq -r '.version' manifest.json) && \
npx @anthropic-ai/dxt pack . chrome-devtools-protocol-$$VERSION.dxt && \
echo "✅ Extension packaged: chrome-devtools-protocol-$$VERSION.dxt"
# Cleanup
clean:
rm -f chrome-devtools-protocol-*.dxt
rm -rf .ruff_cache/
rm -rf __pycache__/
rm -rf src/__pycache__/
rm -rf src/tools/__pycache__/
rm -rf .pytest_cache/
rm -rf chrome_devtools_mcp.egg-info/
# Installation helpers
install-tools:
npm install -g @anthropic-ai/dxt
pip install uv
# Development server (for testing)
dev-server:
uv run python server.py
# Version management
version-patch:
@echo "Current version: $$(jq -r '.version' manifest.json)"
@echo "Bumping patch version..."
@jq '.version = (.version | split(".") | .[0] + "." + .[1] + "." + (.[2] | tonumber + 1 | tostring))' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
@echo "New version: $$(jq -r '.version' manifest.json)"
version-minor:
@echo "Current version: $$(jq -r '.version' manifest.json)"
@echo "Bumping minor version..."
@jq '.version = (.version | split(".") | .[0] + "." + (.[1] | tonumber + 1 | tostring) + ".0")' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
@echo "New version: $$(jq -r '.version' manifest.json)"
# Quick development workflow
quick-build: format lint package
@echo "✅ Quick build complete!"
# Full release workflow
release: clean check package
@echo "✅ Release build complete!"
@echo "📦 Extension: chrome-devtools-protocol-*.dxt"
@echo ""
@echo "To release:"
@echo "1. git tag v$$(jq -r '.version' manifest.json)"
@echo "2. git push origin v$$(jq -r '.version' manifest.json)"