-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 1.56 KB
/
Makefile
File metadata and controls
69 lines (58 loc) · 1.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
.PHONY: all test clean setup-js-tests generate-vectors
# Default target
all:
@echo "Y-Go Build System"
@echo ""
@echo "Available targets:"
@echo " make test - Run all tests"
@echo " make test-go - Run Go tests only"
@echo " make test-js - Run JS integration tests (requires ENABLE_JS_TESTS=1)"
@echo " make setup-js - Setup JS test environment"
@echo " make vectors - Generate test vectors from Yjs"
@echo " make clean - Clean build artifacts"
@echo ""
# Run all tests (excluding JS tests unless enabled)
test:
go test ./... -v
# Run Go tests only
test-go:
go test ./... -v -tags=!js_tests
# Run JS integration tests
test-js:
ENABLE_JS_TESTS=1 go test -tags js_tests ./tests/js/... -v
# Setup JS test environment
setup-js:
cd tests/js && npm install
# Generate test vectors from Yjs
vectors:
cd tests/js && npm run generate-vectors
# Format code
fmt:
go fmt ./...
gofmt -s -w .
# Run linter
lint:
golangci-lint run ./...
# Clean build artifacts
clean:
go clean ./...
rm -f tests/vectors/*.json
# Initialize git repo (if not already initialized)
init-git:
@if [ ! -d .git ]; then \
git init; \
git add .; \
git commit -m "Initial commit: Y-Go project structure"; \
echo "Git repository initialized"; \
else \
echo "Git repository already exists"; \
fi
# Create initial commit
commit-init:
@if git diff --quiet && git diff --cached --quiet; then \
echo "Nothing to commit"; \
else \
git add .; \
git commit -m "feat: implement project structure and test framework"; \
echo "✓ Initial commit created"; \
fi