-
-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (57 loc) · 2.25 KB
/
Copy pathMakefile
File metadata and controls
72 lines (57 loc) · 2.25 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
.PHONY: build clean compress-images format check update-deps serve watch deploy firebase-preview reviews test-ui test-debug help
help: ## Show available commands
@./scripts/help.sh
build: ## Build the project
@echo "→ Building project..."
@go run ./cmd/build/
@echo "✓ Build complete"
clean: ## Clean public/ directory
@echo "→ Cleaning public/..."
@go run ./cmd/build/ -clean-only
@echo "✓ Cleaned"
format: ## Format Go source, templates, and tidy modules
@echo "→ Formatting..."
@gofmt -w cmd/build/*.go tools/reviews-page-generator/*.go
@gotmplfmt -w src/tpl/*.html
@go mod tidy
@echo "✓ Format complete"
check: node_modules ## Run Go, golden, and Playwright checks
@echo "→ Running checks..."
@go vet ./...
@go build ./...
@npx playwright install chromium
@npx playwright test
@echo "✓ All checks passed"
compress-images: ## Compress images in public/images
@echo "→ Compressing images..."
@./scripts/compress_images.sh
@echo "✓ Images compressed"
update-deps: ## Update Go dependencies
@echo "→ Updating dependencies..."
@./scripts/update_deps.sh
@echo "✓ Dependencies updated"
serve: ## Build and serve locally || Example: make serve PORT="9090"
@echo "→ Starting server..."
@./scripts/serve.sh $(if $(PORT),$(PORT))
watch: ## Watch for changes and rebuild
@echo "→ Watching for changes..."
@go run ./cmd/build/ -watch
firebase-preview: ## Build and preview via Firebase local server
@echo "→ Starting Firebase preview..."
@./scripts/firebase_local_preview.sh
@echo "✓ Preview running"
deploy: ## Deploy to Firebase Hosting || Example: make deploy VERSION="3.0.9"
@echo "→ Deploying to Firebase..."
@./scripts/firebase_deploy.sh $(VERSION)
@echo "✓ Deployed"
reviews: ## Generate reviews page || Example: make reviews FORCE="true"
@echo "→ Generating reviews page..."
@if [ "$(FORCE)" = "true" ]; then ./scripts/gen_reviews_page.sh -f; else ./scripts/gen_reviews_page.sh; fi
@echo "✓ Reviews page generated"
test-ui: node_modules ## Run Playwright tests in UI mode
@npx playwright test --ui
test-debug: node_modules ## Run Playwright tests in debug mode
@npx playwright test --debug
node_modules: package-lock.json package.json
@echo "→ Installing Playwright dependencies..."
@npm ci --no-audit --no-fund