-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 894 Bytes
/
Makefile
File metadata and controls
42 lines (31 loc) · 894 Bytes
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
SHELL := /bin/bash
PATH := $(shell echo $${PATH//\.\/node_modules\/\.bin:/}):node_modules/.bin
SRC = $(wildcard src/*.js)
LIB = $(SRC:src/%.js=lib/%.js)
TST = $(wildcard test/*.js) $(wildcard test/**/*.js)
NPM = @npm install --local && touch node_modules
OPT = --plugins transform-es2015-modules-umd --copy-files --source-maps
v ?= patch
build: node_modules $(LIB)
lib/%.js: src/%.js
@mkdir -p $(@D)
@babel $(OPT) -o $@ $<
node_modules: package.json
$(NPM)
node_modules/%:
$(NPM)
test: build
@tape $(TST)
.nyc_output: node_modules
@nyc $(MAKE) test
coverage: .nyc_output
@nyc report --reporter=text-lcov | coveralls
dev: node_modules
@nodemon -q -x "(clear; nyc $(MAKE) test | tap-dot && nyc report) || true"
release: clean build test
@npm version $(v)
@npm publish
@git push --follow-tags
clean:
@rm -rf $$(cat .gitignore)
.PHONY: build test coverage dev release clean