This repository has been archived by the owner on May 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.44 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
help:
@echo ""
@echo "AVAILABLE TASKS"
@echo ""
@echo " compile ................ Compiles the project."
@echo " clean .................. Removes build artifacts."
@echo " test ................... Runs the tests for the project."
@echo " test-watch ............. Runs the tests on every change."
@echo " lint ................... Lints all source files."
@echo " documentation .......... Generates static API documentation."
@echo ""
# ----------------------------------------------------------------------
bin := $(shell npm bin)
babel := $(bin)/babel
eslint := $(bin)/eslint
mocha := $(bin)/mocha
# -- [ TASKS ] ---------------------------------------------------------
.PHONY: help compile compile-test clean test lint test-watch
node_modules: package.json
npm install
compile:
$(babel) src --source-map inline \
--out-dir lib \
$(BABEL_OPTIONS)
compile-test:
$(babel) test/src --source-map inline \
--out-dir test/spec \
$(BABEL_OPTIONS)
clean:
rm -rf lib test/spec
test: compile compile-test
$(mocha) test/spec --reporter spec \
--ui bdd
test-watch: compile compile-test
BABEL_OPTIONS=--watch $(MAKE) compile &
BABEL_OPTIONS=--watch $(MAKE) compile-test &
$(mocha) test/spec --reporter min \
--ui bdd \
--watch
lint:
$(eslint) src
documentation: compile
node tools/generate-docs.js