-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (69 loc) · 2.53 KB
/
Makefile
File metadata and controls
82 lines (69 loc) · 2.53 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
73
74
75
76
77
78
79
80
81
82
SHELL := /bin/bash
# Variables from project configuration and git
PROJECT_NAME ?= $(shell (jq -r '.name' package.json || echo "Unknown Project"))
PROJECT_VERSION ?= $(shell (jq -r '.version' package.json || echo "Unknown Version"))
GIT_BRANCH ?= $(shell (git rev-parse --abbrev-ref HEAD || echo "Unknown Branch"))
GIT_COMMIT_SHA ?= $(shell (git rev-parse --verify HEAD || echo "Unknown SHA"))
GIT_COMMIT_SHORT_SHA ?= $(shell (git rev-parse --verify --short HEAD || echo "Unknown Short SHA"))
.PHONY: help
help: ## Show this help message
@echo ======================================================================
@echo
@echo "Project: $(PROJECT_NAME) || Version: $(PROJECT_VERSION)"
@echo
@echo "Git Branch: $(GIT_BRANCH) || SHA: $(GIT_COMMIT_SHA)"
@echo
@echo ======================================================================
@echo
@echo "Commands Description"
@echo ======================================================================
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ====================================================================
.PHONY: make-executable
make-executable: ## Make scripts executable
@echo "Setting executable permission for dev scripts"
chmod +x "$(CURDIR)/scripts/utils/install-pnpm.sh"
chmod +x "$(CURDIR)/scripts/utils/install-jq.sh"
@echo
.PHONY: setup-dev
setup-dev: make-executable ## Set up your development environment
@echo "Setting up the development environment..."
chmod +x "$(CURDIR)/scripts/dev/setup.sh"
"$(CURDIR)/scripts/dev/setup.sh"
@echo
.PHONY: setup-dep
setup-dep: make-executable ## Set up your development environment
@echo "Setting up the development environment..."
"$(CURDIR)/scripts/dep/setup.sh"
@echo
.PHONY: install
install: setup-dev ## Install dependencies
pnpm install
.PHONY: lint
lint: install ## Run linters to check code quality
@echo "Running linter..."
pnpm run lint
.PHONY: dev
dev: install ## Start the development environment
@echo "Starting development environment..."
pnpm run dev
.PHONY: build
build: install ## Build the project
@echo "Building the project..."
pnpm run build
.PHONY: start
start: build ## Start the application
@echo "Starting the application..."
pnpm run start
.PHONY: test
test: install ## Run all tests
@echo "Running tests..."
pnpm run test
.PHONY: clean
clean: ## Clean files
pnpm cache clean
.PHONY: deep-clean
deep-clean: clean ## Delete all node_modules and re-install them
pnpm cache clean --force
rm -rf node_modules
pnpm install