-
Notifications
You must be signed in to change notification settings - Fork 55
/
Makefile
78 lines (57 loc) · 1.75 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
73
74
75
76
77
78
BIN = $(PWD)/node_modules/.bin/
SASSDOC = $(PWD)/bin/sassdoc
all: lint dist test
# Compile ES6 from `src` to ES5 in `dist`
# =======================================
dist:
rm -rf $@
$(BIN)babel src -d $@
# Code quality
# ============
lint:
$(BIN)standard bin/sassdoc index.js src/**/*.js test/**/*.js
test: test/data/expected.stream.json dist
$(BIN)mocha test/**/*.test.js
$(SASSDOC) --parse test/data/test.scss | diff - test/data/expected.json
$(SASSDOC) --parse - < test/data/test.scss | diff - test/data/expected.stream.json
rm -rf sassdoc && $(SASSDOC) test/data/test.scss && [ -d sassdoc ]
rm -rf sassdoc && $(SASSDOC) - < test/data/test.scss && [ -d sassdoc ]
rm -rf sassdoc && $(SASSDOC) -c test/config.yaml test/data/test.scss && [ -d sassdoc ]
rm -rf sassdoc test/custom-sassdoc && $(SASSDOC) -c test/config-dest.yaml test/data/test.scss && [ -d test/custom-sassdoc ]
test/data/expected.stream.json: test/data/expected.json
test/data/stream $< > $@
cover:
rm -rf coverage
$(BIN)nyc $(BIN)mocha test/**/*.test.js
cover-browse: dist
rm -rf coverage
$(BIN)nyc --reporter=html $(BIN)mocha test/**/*.test.js
$(BIN)opn coverage/index.html
coveralls:
($(BIN)nyc report --reporter=text-lcov | $(BIN)coveralls) || exit 0
# Development
# ===========
develop:
$(BIN)babel-node $@
# Publish package to npm
# @see npm/npm#3059
# =======================
publish: all
npm publish
# Release, publish
# ================
# "patch", "minor", "major", "prepatch",
# "preminor", "premajor", "prerelease"
VERS ?= "patch"
TAG ?= "latest"
release: all
npm version $(VERS) -m "Release %s"
npm publish --tag $(TAG)
git push --follow-tags
# Tools
# =====
rebuild:
rm -rf node_modules
npm install
.PHONY: dist test develop
.SILENT: dist develop cover view-cover travis