.DEFAULT_GOAL := help

.PHONY: help install env-sync start serve build build-dev watch test clean

help:
	@echo "SparkGuardian"
	@echo "  make install     Установить зависимости (npm install)"
	@echo "  make env-sync    Сгенерировать src/environments/environment.ts из .env"
	@echo "  make start       Dev-сервер (ng serve + прокси, перед стартом — env:sync)"
	@echo "  make serve       то же, что start"
	@echo "  make build       Production-сборка (перед сборкой — env:sync)"
	@echo "  make build-dev   Сборка в режиме development"
	@echo "  make watch       ng build --watch (development)"
	@echo "  make test        Unit-тесты (ng test)"
	@echo "  make clean       Удалить dist, out-tsc, кэш Angular"

install:
	npm install

env-sync:
	npm run env:sync

start serve:
	npm start

build:
	npm run build

build-dev:
	npm run env:sync
	npx ng build --configuration development

watch:
	npm run watch

test:
	npm test

clean:
	rm -rf dist out-tsc .angular/cache
