-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
55 lines (43 loc) · 1.87 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
SRC_FILES := $(shell find src -name '*.ts')
lib: ${SRC_FILES} package.json tsconfig.json node_modules rollup.config.js
@./node_modules/.bin/rollup -c && touch lib
.PHONY: test
test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' ./node_modules/.bin/mocha -u tdd -r ts-node/register --extension ts test/*.ts --grep '$(grep)'
.PHONY: coverage
coverage: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' ./node_modules/.bin/nyc --reporter=html ./node_modules/.bin/mocha -u tdd -r ts-node/register --extension ts test/*.ts -R nyan && open coverage/index.html
.PHONY: lint
lint: node_modules
@./node_modules/.bin/eslint src --ext .ts --fix
.PHONY: ci-test
ci-test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' ./node_modules/.bin/nyc --reporter=text ./node_modules/.bin/mocha -u tdd -r ts-node/register --extension ts test/*.ts -R list
.PHONY: ci-lint
ci-lint: node_modules
@./node_modules/.bin/eslint src --ext .ts --max-warnings 0 --format unix && echo "Ok"
docs: $(SRC_FILES) node_modules
./node_modules/.bin/typedoc \
--excludeInternal \
--excludePrivate --excludeProtected \
--name "Anchor Link" --includeVersion --readme none \
--out docs \
src/index-module.ts
.PHONY: deploy-site
deploy-site: docs
cp -r ./examples ./docs/examples/
./node_modules/.bin/gh-pages -d docs
node_modules:
yarn install --non-interactive --frozen-lockfile --ignore-scripts
.PHONY: publish
publish: | distclean node_modules
@git diff-index --quiet HEAD || (echo "Uncommitted changes, please commit first" && exit 1)
@git fetch origin && git diff origin/master --quiet || (echo "Changes not pushed to origin, please push first" && exit 1)
@yarn config set version-tag-prefix "" && yarn config set version-git-message "Version %s"
@yarn publish && git push && git push --tags
.PHONY: clean
clean:
rm -rf lib/ coverage/ docs/
.PHONY: distclean
distclean: clean
rm -rf node_modules/