-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (84 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
107 lines (84 loc) · 2.26 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
export ASAR?=true
export MAC_SIGN?=false
PLANTUML_FILES=$(wildcard doc/images/*.puml)
DIAGRAM_FILES=$(subst .puml,.png,$(PLANTUML_FILES))
JS?=bun
PM?=bun
#PM_OPTIONS?=--ignore-scripts
RUN?=bunx
#RUN_OPTIONS?=--bun
SHELL:=/bin/bash
DEPENDENCY_UPDATER=dependabot[bot]
all: dist doc check
clean:
rm -rf coverage out testdata
rm -rf node_modules/.tmp
distclean: clean
rm -rf dist
rm -rf node_modules
dist: build
$(PM) run $(RUN_OPTIONS) build:electron
# $(PM) run $(RUN_OPTIONS) build:mac
# $(PM) run $(RUN_OPTIONS) build:win
# $(PM) run $(RUN_OPTIONS) build:linux
start: prepare
$(PM) run $(RUN_OPTIONS) start
doc: $(DIAGRAM_FILES)
domain:
esdm view
domain-detailed:
esdm view --with-details
check: test
esdm lint
$(RUN) $(RUN_OPTIONS) eslint .
$(RUN) $(RUN_OPTIONS) stylelint "**/*.scss" --ignore-path .gitignore
$(RUN) $(RUN_OPTIONS) prettier --check .
$(RUN) $(RUN_OPTIONS) sheriff verify
format:
$(RUN) $(RUN_OPTIONS) eslint --fix .
$(RUN) $(RUN_OPTIONS) stylelint "**/*.scss" --fix --ignore-path .gitignore
$(RUN) $(RUN_OPTIONS) prettier --write .
dev: prepare
$(PM) run $(RUN_OPTIONS) dev
test: prepare
$(PM) run $(RUN_OPTIONS) test
watch: prepare
$(PM) run $(RUN_OPTIONS) watch
unit-tests: prepare
$(RUN) $(RUN_OPTIONS) vitest run unit
integration-tests: prepare
$(RUN) $(RUN_OPTIONS) vitest run integration
e2e-tests: prepare
$(RUN) $(RUN_OPTIONS) vitest run e2e
docker-build:
docker compose run --rm build
build: prepare
$(PM) run $(RUN_OPTIONS) build
prepare: version
ifdef CI
ifeq ($(findstring $(DEPENDENCY_UPDATER), $(GITHUB_ACTOR)), $(DEPENDENCY_UPDATER))
@echo "dependency updater detected, run $(PM) install"
$(PM) install $(PM_OPTIONS)
else
@echo "CI detected, run $(PM) ci"
$(PM) ci $(PM_OPTIONS)
endif
else
$(PM) install $(PM_OPTIONS)
endif
version:
@echo "Using runtime $(JS) version $(shell $(JS) --version)"
@echo "Using package manager $(PM) version $(shell $(PM) --version)"
@echo "Using package runner $(RUN) version $(shell $(RUN) --version)"
$(DIAGRAM_FILES): %.png: %.puml
# Skip on CI because changes will not be committed
ifndef CI
plantuml $^
endif
.PHONY: \
all clean distclean dist \
start doc domain domain-detailed \
check format \
dev test watch unit-tests integration-tests e2e-tests \
docker-build \
build prepare version