-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (53 loc) · 1.2 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
# Remove auto-generated folders
install:
npm install
# Remove auto-generated folders
clean:
rm -rf coverage dist
# Compile TypeScript files to JS
compile:
rm -rf ./dist
npx tsc --skipLibCheck
# Starts aplication. Use this on production.
run: compile
node ./dist/src/cluster
# Starts application in development mode.
dev:
npx nodemon --watch src --ext ts --exec "make run || exit 1"
# Lint and format code
lint:
# Lint with tslint
npx eslint . --ext .ts
# Format with prettier
npx prettier --write './src/**/*.ts' --loglevel=error
# Run all tests
test:
npx jest --forceExit
# Run tests and coverage
coverage:
npx jest --coverage --forceExit
# Compile and run checks before starting application
# Used on Procfile
release: compile
# First run of the app
bootstrap:
# Install dependencies
make install
# If no .env is found, clone and rename ".env.example"
( ls .env -R 2>/dev/null && echo "=> Skipping .env file creation" ) \
|| mv .env.example .env && cp .env .env.example
# Start local databases and application
make dev
# ---
rules := all \
dev \
run \
test \
lint \
clean \
release \
compile \
coverage \
bootstrap \
.PHONY: $(rules)
.SILENT: $(rules)