forked from jonschlinkert/remarkable
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (47 loc) · 1.81 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
PATH := ./node_modules/.bin:${PATH}
NPM_PACKAGE := $(shell node -e 'process.stdout.write(require("./package.json").name)')
NPM_VERSION := $(shell node -e 'process.stdout.write(require("./package.json").version)')
TMP_PATH := /tmp/${NPM_PACKAGE}-$(shell date +%s)
REMOTE_NAME ?= origin
REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)
CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master)
GITHUB_PROJ := https://github.com/jonschlinkert/${NPM_PACKAGE}
demo:
./support/demodata.js > demo/example.json
jade demo/index.jade -P --obj demo/example.json
stylus -u autoprefixer-stylus demo/assets/index.styl
rm -rf demo/example.json
lint:
eslint --reset ./bin ./lib ./support ./test
test:
NODE_ENV=test mocha -r esm -R spec
echo "CommonMark stat:\n"
./support/specsplit.js test/fixtures/commonmark/spec.txt
gh-pages:
if [ "git branch --list gh-pages" ]; then \
git branch -D gh-pages ; \
fi
git branch gh-pages
git push origin gh-pages -f
publish:
@if test 0 -ne `git status --porcelain | wc -l` ; then \
echo "Unclean working tree. Commit or stash changes first." >&2 ; \
exit 128 ; \
fi
@if test 0 -ne `git fetch ; git status | grep '^# Your branch' | wc -l` ; then \
echo "Local/Remote history differs. Please push/pull changes." >&2 ; \
exit 128 ; \
fi
@if test 0 -ne `git tag -l ${NPM_VERSION} | wc -l` ; then \
echo "Tag ${NPM_VERSION} exists. Update package.json" >&2 ; \
exit 128 ; \
fi
git tag ${NPM_VERSION} && git push origin ${NPM_VERSION}
npm publish ${GITHUB_PROJ}/tarball/${NPM_VERSION}
rollup:
rm -rf ./dist
rollup -c --banner "/*! ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} @license MIT */"
todo:
grep 'TODO' -n -r ./lib 2>/dev/null || test true
.PHONY: publish lint test gh-pages todo demo coverage
.SILENT: help lint test todo