This repository was archived by the owner on May 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (48 loc) · 1.33 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
66
SYSTEM=$(shell uname)
ifeq ($(SYSTEM),Linux)
YARN_ENV=GYP_DEFINES="LLVM_CONFIG=/usr/bin/llvm-config-4.0"
endif
ifeq ($(SYSTEM),Darwin)
YARN_ENV=GYP_DEFINES="LLVM_CONFIG=/usr/bin/opt/llvm/bin/llvm-config"
endif
default: build
ci: type lint test
init:
echo $(YARN_ENV) yarn install
$(YARN_ENV) yarn install
./node_modules/.bin/flow-typed install
node_modules:
$(YARN_ENV) yarn install
flow-typed: node_modules
./node_modules/.bin/flow-typed install
build: node_modules
./node_modules/.bin/babel src --out-dir dist/src --source-maps inline
cp ./package.json ./dist/.
@for bin_file in ./dist/src/bin/*.js; do \
echo "#!$$(which env) node\n$$(cat $$bin_file)" > $$bin_file; \
chmod +x $$bin_file; \
done
test: node_modules
./node_modules/.bin/jest
type: node_modules
./node_modules/.bin/flow status
lint: node_modules
./node_modules/.bin/eslint src test
docs: node_modules
./node_modules/.bin/documentation build \
src/** src/* -f html -o docs \
--document-exported \
--infer-private \
--name jo-script
watch:
@which watchman-make > /dev/null || ( echo 'install watchman' && exit 1 )
watchman-make -p 'src/**/*.js' 'src/*.js' 'test/**/*.js' 'test/*.js' -t ci
reset:
rm -rf flow-typed
rm -rf node_modules
rm -rf dist
rm -rf docs
make init
clean:
rm -rf dist
.PHONY: default watch ci init build clean docs type lint test