-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
72 lines (52 loc) · 1.79 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
NAME = holo_hosting_comb
build/index.js: src/index.ts
yarn run compile
dist/$(NAME).js: build/index.js webpack.config.js
yarn run bundle
docs/index.html: build/index.js
npx jsdoc --verbose -c ./docs/.jsdoc.json --private --destination ./docs build/index.js
yarn.lock: package.json
yarn install
touch $@
node_modules: yarn.lock
.PHONY: src build dist docs docs-watch dist-watch preview-package publish-docs publish-package
build: node_modules build/index.js
dist: node_modules dist/$(NAME).js
docs: node_modules docs/index.html
MOCHA_OPTS = --timeout 5000
test: dist
npx mocha $(MOCHA_OPTS) --recursive ./tests
test-debug: dist
LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) --recursive ./tests
test-unit: dist
LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) ./tests/unit/
test-integration: dist
LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) ./tests/integration/
docs-watch:
npx chokidar -d 3000 'src/**/*.ts' -c "make --no-print-directory docs" 2> /dev/null
dist-watch:
npx chokidar -d 3000 'src/**/*.ts' -c "make --no-print-directory dist" 2> /dev/null
clean-docs:
git clean -df ./docs
static-servers:
cd ./html/happ/; python3 -m http.server 8001 &
cd ./html/chaperone/; python3 -m http.server 8002
preview-package: dist
npm pack --dry-run .
publish-package: test
npm publish --access public .
CURRENT_BRANCH = $(shell git branch | grep \* | cut -d ' ' -f2)
publish-docs:
git branch -D gh-pages || true
git checkout -b gh-pages
echo "\nBuilding docs"
make docs
ln -s docs v$$( cat package.json | jq -r .version )
@echo "\nAdding docs..."
git add -f docs
git add v$$( cat package.json | jq -r .version )
@echo "\nCreating commit..."
git commit -m "JSdocs v$$( cat package.json | jq -r .version )"
@echo "\nForce push to gh-pages"
git push -f origin gh-pages
git checkout $(CURRENT_BRANCH)