-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (64 loc) · 2.52 KB
/
Makefile
File metadata and controls
85 lines (64 loc) · 2.52 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
83
84
85
# Executables
DOCKER_COMPOSE?=docker compose
DOCKER_EXEC?=$(DOCKER_COMPOSE) exec -it
PNPM?=$(DOCKER_EXEC) node pnpm
# Misc
default: help
##
## —— Docker ———————————————————————————————————————————————————————————————————
.PHONY: build
build: ## Build and start containers.
@$(DOCKER_COMPOSE) up --build --no-recreate -d
.PHONY: rebuild
rebuild: ## Force rebuild and start containers.
@$(DOCKER_COMPOSE) up --build --force-recreate --remove-orphans -d
.PHONY: up
up: ## Start containers without building.
@$(DOCKER_COMPOSE) up -d
.PHONY: down
down: ## Stop and remove containers.
@$(DOCKER_COMPOSE) down --remove-orphans
##
## —— Executables ——————————————————————————————————————————————————————————————
.PHONY: pnpm
pnpm: ## Run a PNPM command (e.g. make pnpm c="update").
@$(PNPM) $(c)
##
## —— Build, lint and tests ————————————————————————————————————————————————————
.PHONY: package
package: ## Package lib.
@$(PNPM) build
.PHONY: typedoc
typedoc: ## Generate API reference docs.
@$(PNPM) docs:typedoc
.PHONY: dev
dev: ## Run dev docs.
@$(PNPM) docs:dev --host
.PHONY: preview
preview: ## Run preview docs.
@$(PNPM) docs:build
@$(PNPM) docs:preview --host --port 5173
.PHONY: lint
lint: ## Lint.
@$(PNPM) lint
.PHONY: lint-write
lint-write: ## Lint and autofix.
@$(PNPM) lint --write
.PHONY: test-unit
test-unit: ## Run unit tests.
@$(PNPM) test
.PHONY: test-e2e
test-e2e: ## Run E2E tests.
@docker run -it -v ./:/e2e -w /e2e --name cypress-tests --rm --network host --entrypoint cypress cypress/included:15.6.0 run --component
.PHONY: test
test: ## Run all tests.
@$(MAKE) --no-print-directory test-unit
@$(MAKE) --no-print-directory test-e2e
##
## —— Utilities ————————————————————————————————————————————————————————————————
.PHONY: sh
sh: ## Run sh on test container.
@$(DOCKER_EXEC) node sh
.PHONY: help
help: ## Show help for each of the Makefile recipes.
@grep -E '(^[a-zA-Z0-9\./_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'