forked from wheresrhys/fetch-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (43 loc) · 1.5 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
export PATH := $(PATH):./node_modules/.bin
.PHONY: test docs
SHELL := env "PATH=$(PATH)" /bin/bash
NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest")
TEST_BROWSER := $(shell [ -z $(TEST_BROWSER) ] && echo "Chrome" || echo ${TEST_BROWSER})
# intended for local dev
test:
mocha --file test/server-setup.js test/{server-specs,specs}/*.test.js test/specs/**/*.test.js
test-browser:
@if [ -z $(CI) ]; \
then karma start --browsers=${TEST_BROWSER}; \
else karma start --single-run --browsers=${TEST_BROWSER}; \
fi
test-es5:
node test/es5.js
test-esm:
FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs
typecheck:
dtslint --expectOnly types
lint-ci:
eslint --ext .js,.mjs --ignore-pattern test/fixtures/* src test
prettier *.md docs/*.md docs/**/*.md
lint:
eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test
prettier --cache --write *.md docs/*.md docs/**/*.md
verify: lint
coverage:
nyc --reporter=lcovonly --reporter=text make test
cat ./coverage/lcov.info | coveralls
transpile:
babel src --out-dir es5
build: transpile
if [ ! -d "cjs" ]; then mkdir cjs; fi
cp -r src/* cjs
rollup -c rollup.config.js
cp types/index.d.ts esm/client.d.ts
cp types/index.d.ts esm/server.d.ts
docs:
cd docs; jekyll serve build --watch
publish:
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
npm version --no-git-tag-version $(CIRCLE_TAG)
npm publish --access public --tag $(NPM_PUBLISH_TAG)