forked from kodyl/react-flexr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.36 KB
/
Makefile
File metadata and controls
56 lines (43 loc) · 1.36 KB
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
PATH := $(BIN):$(PATH)
LIB = $(shell find lib -name "*.js")
DIST = $(patsubst lib/%.js,dist/%.js,$(LIB))
dist: $(DIST)
dist/%.js: lib/%.js
@ mkdir -p $(@D)
$(BIN)/babel $< -o $@
clean:
@rm -rf ./dist
build: clean dist extract-styles
dev:
@node ./example/server.js
extract-styles:
@node -p "var s = require('stilr'); var b = require('./dist'); s.render({}, b.stylesheet)" > ./styles.css
test:
@echo "\nTesting source files, hang on..."
@NODE_ENV=test $(BIN)/mocha \
--compilers js:babel-core/register \
--require lib/__tests__/testdom \
./lib/__tests__/*.test.js
test-build:
@echo "\nTesting build files, almost there..!"
@NODE_ENV=test $(BIN)/mocha \
--require dist/__tests__/testdom \
./dist/__tests__/*.test.js
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
git flow release start $$NEXT_VERSION && \
make build && \
npm --no-git-tag-version version $(1) -m 'release %s' && \
git add . && \
git commit -m 'make build and release' && \
git flow release finish -m $$NEXT_VERSION $$NEXT_VERSION
endef
release-patch:
$(call release,patch)
release-minor:
$(call release,minor)
release-major:
$(call release,major)
.PHONY: install test test-build dev release-major release-minor release-patch