-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathMakefile
More file actions
153 lines (118 loc) · 5.17 KB
/
Copy pathMakefile
File metadata and controls
153 lines (118 loc) · 5.17 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.PHONY: help sync build check test lint format format-check format-fix manifest generate api-action-catalog \
check-api-action-catalog server-manifests skill-references check-skill-references check-generated \
pre-commit ci core-test shared-test catalog-test protocol-smoke \
docs-test relay-test worker-install worker-test worker-typecheck worker-build worker-check docker-relay \
docker-build docker-up docker-down docker-logs
help:
@echo "UniFi MCP Ecosystem — Top-Level Commands"
@echo ""
@echo " make sync Sync uv workspace (install/update all packages)"
@echo " make build Build all deployable artifacts"
@echo " make check Run full lint + drift + test checks"
@echo " make test Run all tests (core + shared + all apps)"
@echo " make lint Lint the full workspace"
@echo " make format Format the full workspace"
@echo " make format-check Check full-workspace formatting"
@echo " make format-fix Auto-fix lint issues in the full workspace"
@echo " make generate Regenerate committed generated artifacts"
@echo " make manifest Regenerate tool manifests + skill references"
@echo " make api-action-catalog Regenerate the API action catalog"
@echo " make check-generated Check generated artifacts for drift"
@echo " make ci Lint + generated drift checks + tests"
@echo " make server-manifests Regenerate server.json for all apps (MCP Registry)"
@echo " make skill-references Update skill tool tables from manifests"
@echo " make pre-commit Format + generate + lint + test + drift checks"
@echo " make docs-test Run documentation site contract tests"
@echo ""
@echo " make docker-build Build all Docker images"
@echo " make docker-up Start all servers (docker compose)"
@echo " make docker-down Stop all servers"
@echo " make docker-logs Tail logs from all servers"
@echo ""
@echo " make core-test Run unifi-core tests only"
@echo " make shared-test Run unifi-mcp-shared tests only"
@echo " make catalog-test Run generated-catalog and live-harness contract tests"
@echo " make protocol-smoke Run MCP protocol conformance smoke tests"
@echo " make worker-build Install worker deps + typecheck Worker app"
@echo " make worker-check Run worker CLI tests + TypeScript checks"
sync: worker-install
uv sync --all-packages
build: docker-build worker-build
check: format-check lint check-generated test worker-typecheck
core-test:
# --all-extras, not a named extra: the suite spans tests/network (aiounifi),
# tests/protect (uiprotect) and tests/access (py-unifi-access), and naming one
# installs that extra's deps while leaving the others' collection to fail.
uv run --package unifi-core --all-extras pytest packages/unifi-core/tests -v
shared-test:
uv run --package unifi-mcp-shared pytest packages/unifi-mcp-shared/tests -v
catalog-test:
uv run pytest tests/test_community_issue_triage_workflow.py tests/test_generate_api_action_catalog.py tests/test_live_smoke_harness.py -v
docs-test:
uv run python -m unittest discover -s tests/docs -p 'test_*.py' -v
test: core-test shared-test catalog-test docs-test relay-test protocol-smoke worker-test
$(MAKE) -C apps/network test
$(MAKE) -C apps/protect test
$(MAKE) -C apps/access test
$(MAKE) -C apps/api test
lint:
uv run ruff check .
format:
uv run ruff format .
format-check:
uv run ruff format --check .
format-fix:
uv run ruff format .
uv run ruff check . --fix
generate: manifest
manifest:
$(MAKE) -C apps/network manifest
$(MAKE) -C apps/protect manifest
$(MAKE) -C apps/access manifest
$(MAKE) api-action-catalog
$(MAKE) skill-references
$(MAKE) server-manifests
api-action-catalog:
uv run python scripts/generate_api_action_catalog.py
check-api-action-catalog:
uv run python scripts/generate_api_action_catalog.py --check
server-manifests:
$(MAKE) -C apps/network server-manifest
$(MAKE) -C apps/protect server-manifest
$(MAKE) -C apps/access server-manifest
skill-references:
python3 scripts/generate_skill_references.py
check-skill-references:
python3 scripts/generate_skill_references.py --check
check-generated: check-skill-references check-api-action-catalog
relay-test:
uv run --package unifi-mcp-relay pytest packages/unifi-mcp-relay/tests -v
protocol-smoke:
uv run --package unifi-network-mcp python scripts/smoke_mcp_metadata.py --server all --registration-mode all
worker-install:
npm ci --prefix apps/worker
npm ci --prefix apps/worker/worker
worker-typecheck: worker-install
npm run --prefix apps/worker/worker typecheck
worker-test: worker-install
npm run --prefix apps/worker test:all
worker-build: worker-typecheck
worker-check: worker-typecheck worker-test
docker-relay:
docker build -f packages/unifi-mcp-relay/Dockerfile -t unifi-mcp-relay .
pre-commit:
$(MAKE) format
$(MAKE) generate
$(MAKE) lint
$(MAKE) test
$(MAKE) check-generated
$(MAKE) worker-typecheck
ci: check
docker-build:
docker compose -f docker/docker-compose.yml build
docker-up:
docker compose -f docker/docker-compose.yml up --build -d
docker-down:
docker compose -f docker/docker-compose.yml down
docker-logs:
docker compose -f docker/docker-compose.yml logs -f