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
SHELL := /usr/bin/env bash
# Herramientas
PNPM := pnpm
CARGO := cargo
RUSTFMT := rustfmt
PRETTIER := $(shell command -v npx >/dev/null 2>&1 && echo "npx prettier" || echo "prettier")
# Root/workspace helpers
JS_WORKSPACE := $(PNPM) --filter agentsync
.PHONY: help all install js-install js-test js-build js-release \
rust-build rust-test rust-run fmt docs-dev docs-build docs-preview \
agents-sync agents-sync-clean clean verify-all
help:
@echo "Makefile for agentsync"
@echo ""
@echo "Main targets:"
@echo " make all -> install + build (js + rust)"
@echo " make verify-all -> run all tests and linters"
@echo " make install -> install dependencies (pnpm + cargo build deps)"
@echo " make js-install -> pnpm install (workspace root)"
@echo " make js-test -> run JS tests (pnpm test)"
@echo " make js-build -> build JS packages (if 'build' script exists)"
@echo " make js-release -> release JS (pnpm run release)"
@echo " make rust-build -> cargo build"
@echo " make rust-test -> cargo test"
@echo " make rust-run -> cargo run"
`@echo` " make fmt -> rustfmt + biome (if installed)"
@echo " make docs-dev -> start docs in dev mode"
@echo " make docs-build -> build docs"
@echo " make agents-sync -> pnpm run agents:sync"
@echo " make agents-sync-clean -> pnpm run agents:sync:clean"
@echo " make clean -> cleans common artifacts"
@echo ""
@echo "Examples:"
@echo " make js-test"
@echo " make rust-test"
all: install js-build
verify-all: js-test rust-test
@echo "All checks passed."
install: js-install rust-build
@echo "Instalación completa."
# JavaScript / pnpm targets
js-install:
@echo "Running pnpm install (workspace root)..."
$(PNPM) install
js-test:
@echo "Running JS tests..."
$(JS_WORKSPACE) run test
js-build:
@echo "Running JS build (workspace scripts if present)..."
$(JS_WORKSPACE) run --if-present build
js-release:
@echo "Running JS release (semantic-release)..."
$(PNPM) run release
# Rust targets
rust-build:
@echo "Building Rust workspace..."
$(CARGO) build
rust-test:
@echo "Running Rust tests..."
$(CARGO) test
rust-run:
@echo "Running Rust project..."
$(CARGO) run
# Formatting
fmt:
@echo "Formatting Rust + JS..."
`@command` -v rustfmt >/dev/null 2>&1 && $(CARGO) fmt || echo "rustfmt not found; skipping"
`@pnpm` exec biome format --write . 2>/dev/null || echo "biome not available; skipping"
# Docs
docs-dev:
@echo "Iniciando docs (dev)..."
$(PNPM) run docs:dev
docs-build:
@echo "Building docs..."
$(PNPM) run docs:build
docs-preview:
@echo "Preview docs..."
$(PNPM) run docs:preview
# Agentsync shortcuts (desde package.json)
agents-sync:
@echo "Running agents:sync..."
$(PNPM) run agents:sync
agents-sync-clean:
@echo "Running agents:sync:clean..."
$(PNPM) run agents:sync:clean
clean:
@echo "Limpiando artefactos..."
-$(CARGO) clean
-$(PNPM) run -w --silent clean 2>/dev/null || true
@rm -rf target
@echo "Listo."