-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
72 lines (52 loc) · 1.91 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
68
69
70
71
72
PATH := ./node_modules/.bin:${PATH}
NPM_PACKAGE := $(shell node support/getGlobalName.js package)
NPM_VERSION := $(shell node support/getGlobalName.js version)
GLOBAL_NAME := $(shell node support/getGlobalName.js global)
BUNDLE_NAME := $(shell node support/getGlobalName.js microbundle)
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//camelaissani//markdown-it-include
build: report-config lintfix bundle test coverage todo
lint:
eslint .
lintfix:
eslint --fix .
bundle:
-rm -rf ./dist
-mkdir dist
microbundle --no-compress --target node --strict --name ${GLOBAL_NAME}
node support/prependHeader.js
test:
mocha
coverage:
-rm -rf coverage
-rm -rf .nyc_output
cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary mocha
report-coverage: lint coverage
todo:
@echo ""
@echo "TODO list"
@echo "---------"
@echo ""
grep 'TODO' -n -r ./ --exclude-dir=node_modules --exclude-dir=unicode-homographs --exclude-dir=.nyc_output --exclude-dir=dist --exclude-dir=coverage --exclude=Makefile 2>/dev/null || test true
clean:
-rm -rf ./coverage/
-rm -rf ./dist/
-rm -rf ./.nyc_output/
superclean: clean
-rm -rf ./node_modules/
-rm -f ./package-lock.json
prep: superclean
-ncu -a --packageFile=package.json
-npm install
-npm audit fix
prep-ci: clean
-rm -rf ./node_modules/
-npm ci
-npm audit fix
report-config:
-echo "NPM_PACKAGE=${NPM_PACKAGE} NPM_VERSION=${NPM_VERSION} GLOBAL_NAME=${GLOBAL_NAME} BUNDLE_NAME=${BUNDLE_NAME} TMP_PATH=${TMP_PATH} REMOTE_NAME=${REMOTE_NAME} REMOTE_REPO=${REMOTE_REPO} CURR_HEAD=${CURR_HEAD}"
.PHONY: clean superclean prep prep-ci report-config publish lint lintfix test todo coverage report-coverage doc build gh-doc bundle
.SILENT: help todo report-config