-
Notifications
You must be signed in to change notification settings - Fork 49
/
Makefile
60 lines (42 loc) · 1.18 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
SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
TEST_FILES:=$(shell find test/ -type f -name '*.ts')
DOCKER_IMAGE_NAME:=a12n-server
.PHONY:start run build test lint fix lint-fix start-dev watch inspect deploy
start: build
node dist/app.js
run: start
build: dist/build
docker-build: build
docker build -t $(DOCKER_IMAGE_NAME) .
docker-run:
docker run -it --rm --name $(DOCKER_IMAGE_NAME)-01 $(DOCKER_IMAGE_NAME)
test:
ls -lA node_modules/.bin
npx tsx --test ${TEST_FILES}
lint:
npx tsc --noemit
npx eslint --quiet 'src/**/*.ts' 'test/**/*.ts'
fix:
npx eslint --quiet 'src/**/*.ts' 'test/**/*.ts' --fix
lint-fix: fix
knex-migrate: dist/build
cd dist; npx knex migrate:latest
knex-make-migration:
cd src; npx knex migrate:make migration_name -x ts
start-dev:
npx tsc-watch --onSuccess 'node --inspect=9339 dist/app.js'
watch:
./node_modules/.bin/tsc --watch
.PHONY:clean
clean:
rm -r node_modules dist
dist/build: $(SOURCE_FILES)
./node_modules/.bin/tsc
@# Touching this file so Makefile knows when it was last built.
touch dist/build
inspect: build
node --inspect dist/app.js
inspect-brk: build
node --inspect-brk dist/app.js
src/db-types.js:
./bin/generate-db-types.mjs