-
Notifications
You must be signed in to change notification settings - Fork 139
/
Makefile
67 lines (60 loc) · 1.85 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
57
58
59
60
61
62
63
64
65
66
67
bin = node_modules/.bin
coveralls = $(bin)/coveralls
wdio = $(bin)/wdio
eslint = $(bin)/eslint ./lib
karma = $(bin)/karma start
server = $(bin)/webpack serve --hot --port 8020
webpack = $(bin)/webpack
tsc = $(bin)/tsc
dtslint = $(bin)/dtslint
src = index.js $(shell find . -type f -name '*.js' ! -path './build/*' -o -name '*.css' ! -path './build/*')
tests = $(shell find test -type f -name '*.js')
ifdef RECURLY_JS_CERT
server_opts = --server-type https --server-options-cert $(RECURLY_JS_CERT) --server-options-key $(RECURLY_JS_KEY)
else
server_opts = --server-type http
endif
server: build
@$(server) $(server_opts)
server-http: build
@$(server)
build: build/recurly.min.js
build/recurly.js: index.js $(src) node_modules
@mkdir -p $(@D)
@$(webpack)
build/recurly.min.js: build/recurly.js
@$(webpack) --mode production
build/test-unit.js: $(src) $(tests)
@$(webpack) --config webpack.test.config.js
test: test-unit test-e2e
test-ci: test-unit-ci test-e2e-ci
test-unit: build build/test-unit.js
@$(karma) karma.conf.js
test-unit-debug: build build/test-unit.js
BROWSER=ChromeDebug $(karma) karma.conf.js
test-unit-ci: build build/test-unit.js
@$(karma) karma.ci.conf.js
test-unit-cov-ci: export REPORT_COVERAGE = true
test-unit-cov-ci: test-unit-ci
@cat ./build/reports/coverage/lcov.info | $(coveralls)
@rm -rf ./build/reports
test-e2e: build $(src) $(tests)
@$(wdio) wdio.conf.js
test-e2e-debug: build $(src) $(tests)
DEBUG=1 $(wdio) wdio.conf.js
test-e2e-ci: build $(src) $(tests)
@$(wdio) wdio.ci.conf.js
test-types: types
@$(dtslint) test/types
@$(dtslint) types
lint: build
@$(eslint)
lint-fix: build
@$(eslint) --fix
node_modules: package.json
@npm install --silent --no-audit
clean:
@rm -rf node_modules build tmp
.PHONY: server server-http
.PHONY: test-ci test-unit test-unit-ci test-unit-cov-ci test-e2e test-e2e-ci test-types
.PHONY: lint lint-fix clean