This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
63 lines (45 loc) · 1.43 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
bin = $(shell npm bin)
lsc = $(bin)/lsc
browserify = $(bin)/browserify
jsdoc = $(bin)/jsdoc
uglify = $(bin)/uglifyjs
VERSION = $(shell node -e 'console.log(require("./package.json").version)')
dist:
mkdir -p dist
dist/data.maybe.umd.js: dist
$(browserify) lib/index.js --standalone folktale.data.Maybe > $@
dist/data.maybe.umd.min.js: dist/data.maybe.umd.js
$(uglify) --mangle - < $^ > $@
# ----------------------------------------------------------------------
bundle: dist/data.maybe.umd.js
minify: dist/data.maybe.umd.min.js
dev-tools:
npm install
documentation:
$(jsdoc) --configure jsdoc.conf.json
ABSPATH=$(shell cd "$(dirname "$0")"; pwd) $(MAKE) clean-docs
clean-docs:
perl -pi -e "s?$$ABSPATH/??g" ./docs/*.html
clean:
rm -rf dist build
test:
$(lsc) test/tap.ls
package: documentation bundle minify
mkdir -p dist/data.maybe-$(VERSION)
cp -r docs dist/data.maybe-$(VERSION)
cp -r lib dist/data.maybe-$(VERSION)
cp dist/*.js dist/data.maybe-$(VERSION)
cp package.json dist/data.maybe-$(VERSION)
cp README.md dist/data.maybe-$(VERSION)
cp LICENCE dist/data.maybe-$(VERSION)
cd dist && tar -czf data.maybe-$(VERSION).tar.gz data.maybe-$(VERSION)
publish: clean
npm install
npm publish
bump:
node tools/bump-version.js $$VERSION_BUMP
bump-feature:
VERSION_BUMP=FEATURE $(MAKE) bump
bump-major:
VERSION_BUMP=MAJOR $(MAKE) bump
.PHONY: test bump bump-major bump-feature documentation publish clean