-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (61 loc) · 1.4 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
SHELL = bash
DIST_NAME = identicons.bundled.js
#
# Runtime Setup
#
build: dist/$(DIST_NAME)
dist/$(DIST_NAME): src/*.js webpack.config.js Makefile package.json
OUTPUT=$(DIST_NAME) npx webpack
touch $@
#
# Testing
#
test: test-unit
test-debug: test-unit-debug
build-watch:
OUTPUT=$(DIST_NAME) npx webpack --watch
test-unit: build
npx mocha --recursive ./tests/unit
test-unit-debug: build
LOG_LEVEL=silly npx mocha --recursive ./tests/unit
test-integration: build
npx mocha --recursive ./tests/integration
test-integration-debug: build
LOG_LEVEL=silly npx mocha --recursive ./tests/integration
test-e2e: build
npx mocha --recursive ./tests/e2e
test-e2e-debug: build
LOG_LEVEL=silly npx mocha --recursive ./tests/e2e/test_basic.js
#
# Project
#
package-lock.json: package.json
npm install
touch $@
node_modules: package-lock.json
npm install
touch $@
#
# Repository
#
clean-remove-chaff:
@find . -name '*~' -exec rm {} \;
clean-files: clean-remove-chaff
git clean -nd
clean-files-force: clean-remove-chaff
git clean -fd
clean-files-all: clean-remove-chaff
git clean -ndx
clean-files-all-force: clean-remove-chaff
git clean -fdx
#
# NPM
#
prepare-package: build
gzip -kf dist/*.js
preview-package: clean-files test prepare-package
npm pack --dry-run .
create-package: clean-files test prepare-package
npm pack .
publish-package: clean-files test prepare-package
npm publish --access public .