forked from greymass/buoy-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·39 lines (29 loc) · 981 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
SHELL := /bin/bash
PATH := ./node_modules/.bin:$(PATH)
SRC_FILES := $(shell find src -name '*.ts')
define VERSION_TEMPLATE
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = "$(shell node -p 'require("./package.json").version')-$(shell git rev-parse --short HEAD)";
endef
all: lib
export VERSION_TEMPLATE
lib: $(SRC_FILES) node_modules tsconfig.json
tsc -p tsconfig.json --outDir lib && \
echo "$$VERSION_TEMPLATE" > lib/version.js && \
touch lib
.PHONY: dev
dev: node_modules
@onchange -k -i 'src/**/*.ts' 'config/*' -- ts-node src/app.ts | bunyan -o short
.PHONY: lint
lint: node_modules
# make refuses to find this on $PATH, finds onchange in dev target above ¯\_(ツ)_/¯
./node_modules/.bin/tslint -p tsconfig.json -c tslint.json -t stylish --fix
node_modules: package.json
yarn install --non-interactive --frozen-lockfile
.PHONY: clean
clean:
rm -rf lib/
.PHONY: distclean
distclean: clean
rm -rf node_modules/