-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 1.01 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
BIN = ./node_modules/.bin
TESTS = $(shell find ./src -name '*-test.js')
SRC = $(shell find ./src -name '*.js')
LIB = $(SRC:./src/%=lib/%)
BABEL_OPTS = \
--presets=es2015 \
--plugins=transform-decorators-legacy
build:: $(LIB)
build-test:: build
@$(BIN)/mochify \
--phantomjs $(BIN)/phantomjs \
$(TESTS:./src/%=./lib/%)
test::
@$(BIN)/mochify \
--transform [ babelify $(BABEL_OPTS) ] \
--phantomjs $(BIN)/phantomjs \
$(TESTS)
ci::
@$(BIN)/mochify \
--watch \
--transform [ babelify $(BABEL_OPTS) ] \
--phantomjs $(BIN)/phantomjs \
$(TESTS)
lint::
@$(BIN)/eslint $(SRC)
release-patch: clean build build-test lint
@$(call release,patch)
release-minor: clean build build-test lint
@$(call release,minor)
release-major: clean build build-test lint
@$(call release,major)
publish:
git push --tags origin HEAD:master
npm publish
lib/%.js: src/%.js
@echo "building $@"
@mkdir -p $(@D)
@$(BIN)/babel $(BABEL_OPTS) --source-maps-inline -o $@ $<
clean:
@rm -rf lib/
define release
npm version $(1)
endef