-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (56 loc) · 2.17 KB
/
Copy pathMakefile
File metadata and controls
72 lines (56 loc) · 2.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
IMAGE_NAME ?= docfoundry-dev
CONTAINER_CMD = docker run --rm -it -v "$(PWD):/workspace" -w /workspace $(IMAGE_NAME)
.PHONY: help setup setup-deps container-build container-shell install dev lint format test package package-linux package-mac package-win clean
help:
@echo "Targets:"
@echo " make setup - Detect OS, verify Docker, and install deps in container"
@echo " make setup-deps - Install project dependencies in container only"
@echo " make container-build - Build the developer container image"
@echo " make container-shell - Open an interactive shell in the dev container"
@echo " make install - Install npm dependencies in container"
@echo " make dev - Run app locally on host (requires Node + GUI)"
@echo " make lint - Run ESLint in container"
@echo " make format - Run Prettier in container"
@echo " make test - Run Vitest tests in container"
@echo " make package - Build installable artifacts for current host OS"
@echo " make package-linux - Build Linux artifacts in container"
@echo " make package-mac - Build macOS artifacts on macOS host"
@echo " make package-win - Build Windows artifacts (best in Windows CI)"
@echo " make clean - Remove build outputs"
setup:
bash scripts/setup.sh
$(MAKE) setup-deps
setup-deps:
@if ! command -v docker >/dev/null 2>&1; then \
echo "[setup] Docker is required for container-only setup."; \
exit 1; \
fi
@echo "[setup] Docker detected, installing dependencies in container..."
$(MAKE) install
container-build:
docker build -f Dockerfile.dev -t $(IMAGE_NAME) .
container-shell: container-build
$(CONTAINER_CMD) bash
install: container-build
$(CONTAINER_CMD) npm install
dev:
npm run dev
lint: container-build
$(CONTAINER_CMD) npm run lint
format: container-build
$(CONTAINER_CMD) npm run format
test: container-build
$(CONTAINER_CMD) npm test
package:
npm run dist
package-linux: container-build
$(CONTAINER_CMD) npm install
$(CONTAINER_CMD) npm run dist:linux
package-mac:
npm install
npm run dist:mac
package-win:
npm install
npm run dist:win
clean:
rm -rf node_modules dist release out