This repository has been archived by the owner on Sep 18, 2020. It is now read-only.
forked from STRML/react-router-component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (41 loc) · 1.58 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
.DELETE_ON_ERROR:
BIN = ./node_modules/.bin
PATH := $(BIN):$(PATH)
install link:
@npm $@
lint:
@./node_modules/.bin/eslint index.js `find lib tests \( -iname \*.js -o -iname \*.jsx \)`
test: test-unit test-server
@echo "The browser test suite should be run before commit. Run 'make test-local' to run it."
test-unit:
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel-register -b tests/unit/*.js
test-server:
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel-register -b tests/server/*.js
test-local:
@env NODE_ENV=test ./node_modules/.bin/babel -f tests/browser/browser-jsx.jsx tests/browser/browser-jsx.jsx -o tests/browser/browser-jsx.js
@env NODE_ENV=test DEBUG=zuul:* ./node_modules/.bin/zuul --debug --local -- tests/browser/*.js
test-cloud:
@env NODE_ENV=test ./node_modules/.bin/zuul -- tests/browser/*.js
release-patch: test lint
@$(call release,patch)
release-minor: test lint
@$(call release,minor)
release-major: test lint
@$(call release,major)
publish:
git push --tags origin HEAD:master
npm publish
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
['./package.json'].forEach(function(fileName) {\
var j = require(fileName);\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync(fileName, s);\
});" && \
git add package.json CHANGELOG.md && \
git commit -m "release v$$NEXT_VERSION" && \
git tag "v$$NEXT_VERSION" -m "release v$$NEXT_VERSION"
endef