-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1007 Bytes
/
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
VERSION=0.3.4
CD=cd
CAT=cat
NPM=npm
RM=rm
GIT=git
URL=`git config --get remote.origin.url`
TEST=test
MKDIR=mkdir
ifdef SYSTEMROOT
UGLIFY=.\node_modules\.bin\uglifyjs
JEST=.\node_modules\.bin\jest
ESLINT=.\node_modules\.bin\eslint
else
UGLIFY=./node_modules/.bin/uglifyjs
JEST=./node_modules/.bin/jest
ESLINT=./node_modules/.bin/eslint
endif
skip_re="[xfi]it\\(|[fdx]describe\\("
all: dist/ascidec.min.js
.PHONY: publish test lint
publish:
$(GIT) clone $(URL) --depth 1 npm
$(CD) npm && $(NPM) publish
$(RM) -rf npm
test:
$(JEST) --coverage --testMatch '**/__test__/*.spec.js'
.$(VERSION): Makefile
touch .$(VERSION)
skipped_tests:
@! grep -E $(skip_re) __test__/ansidec.spec.js
coveralls:
$(CAT) ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
lint:
$(ESLINT) index.js
dist:
$(MKDIR) dist
dist/ascidec.min.js: dist .$(VERSION) index.js
$(UGLIFY) -o dist/ascidec.min.js --comments --mangle --source-map "includeSources,url='ascidec.min.js.map'" -- index.js