generated from curveball/starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (32 loc) · 942 Bytes
/
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
SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
MIGRATION_FILES:=$(shell find src/migrations -type f -name '*.ts')
all: build
build: src/db-types.ts dist/build package-lock.json
test:
node_modules/.bin/nyc node_modules/.bin/mocha
lint:
node_modules/.bin/eslint --quiet 'src/*.ts'
lint-fix: fix
fix:
node_modules/.bin/eslint --quiet 'src/**/*.ts' --fix
watch:
node_modules/.bin/tsc --watch
start: build
node dist/index.js
start-dev:
npm run start:watch
knex-migrate:
cd src; npx knex migrate:latest
knex-make-migration:
cd src; npx knex migrate:make migration_name -x ts
src/db-types.ts: ${MIGRATION_FILES}
node bin/generate-db-types.mjs
dist/build: $(SOURCE_FILES)
node_modules/.bin/tsc
@# Creating a small file to keep track of the last build time
touch dist/build
package-lock.json: package.json
npm i
clean:
rm -r dist
.PHONY:all build test lint lint-fix fix watch start knex-migrate docker-build clean