forked from prometheusresearch-archive/react-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.24 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
BIN = ./node_modules/.bin
TESTS = $(shell find ./src -path '**/__tests__/*-test.js')
SRC = $(shell find ./src -name '*.js' -not -path '*/__tests__/*')
NODE = $(BIN)/babel-node $(BABEL_OPTIONS)
MOCHA_OPTIONS = --require ./src/__tests__/setup.js
MOCHA = $(BIN)/_mocha $(MOCHA_OPTIONS)
NYC_OPTIONS = --all --require babel-core/register
NYC = $(BIN)/nyc $(NYC_OPTIONS)
VERSION = $(shell node -e 'console.log(require("./package.json").version)')
build:
@$(BIN)/webpack --config webpack.build.config.js
watch:
@$(BIN)/webpack --config webpack.build.config.js --watch
lint::
@$(BIN)/eslint $(SRC)
test::
@NODE_ENV=test $(BIN)/babel-node $(MOCHA) -- $(TESTS)
test-cov::
@NODE_ENV=test $(NYC) --check-coverage $(MOCHA) -- $(TESTS)
report-cov::
@$(BIN)/nyc report --reporter html
report-cov-coveralls::
@$(BIN)/nyc report --reporter=text-lcov | $(BIN)/coveralls
ci:
@NODE_ENV=test $(BIN)/babel-node $(MOCHA) --watch -- $(TESTS)
version-major version-minor version-patch: lint test build
@npm version $(@:version-%=%)
_publish-git:
git tag $(VERSION)
git push --tags origin HEAD:develop
_publish-beta-npm: build
npm publish --tag beta
publish: _publish-git _publish-beta-npm
clean:
@rm -rf lib/