-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·86 lines (67 loc) · 2.12 KB
/
Makefile
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
86
#!/usr/bin/env -S make -f
MAKEFLAGS += --warn-undefined-variable
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --silent
-include Makefile.*
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
.DEFAULT_GOAL := help
help: Makefile ## Show help
for makefile in $(MAKEFILE_LIST)
do
@echo "$${makefile}"
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' "$${makefile}" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
done
# =============================================================================
# Common
# =============================================================================
install: ## Install deps and tools
yarn install
yarn run playwright install --with-deps
pre-commit install --install-hooks
.PHONY: install
update: ## Update deps and tools
yarn upgrade
pre-commit autoupdate
.PHONY: update
run: ## Run development application
yarn run dev $$([ -z "$$CONTAINER" ] && echo '' || echo '--host')
.PHONY: run
preview: ## Preview build
yarn run build && yarn run preview $$([ -z "$$CONTAINER" ] && echo '' || echo '--host')
.PHONY: preview
# =============================================================================
# CI
# =============================================================================
ci: generate lint test e2e-test ## Run CI tasks
.PHONY: ci
generate: ## Generate stubs
yarn run svelte-kit sync
.PHONY: generate
format: ## Run autoformatters
yarn run prettier --list-different --write .
yarn run eslint --fix .
.PHONY: format
lint: generate ## Run linters
yarn run prettier --check .
yarn run eslint .
yarn run tsc --noEmit
.PHONY: lint
test: generate ## Run tests
yarn run test
.PHONY: test
e2e-test: ## Run e2e tests
yarn run e2e
.PHONY: e2e-test
build: generate ## Build application
yarn run build
.PHONY: build
# =============================================================================
# Handy Scripts
# =============================================================================
clean: ## Remove temporary files
rm -rf build/ coverage/ playwright-report/
find . -path '*.log*' -delete
.PHONY: clean