-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (70 loc) · 1.77 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
79
80
#
# Project
#
package-lock.json: package.json
touch $@
node_modules: package-lock.json
npm install
touch $@
build: node_modules
use-local-%:
npm uninstall @whi/$*
npm install ../$*
use-npm-%:
npm uninstall @whi/$*
npm install @whi/$*
use-local-serious-error-types:
use-npm-serious-error-types:
use-local-authentic-codecs:
use-npm-authentic-codecs:
use-local-http:
use-npm-http:
use-local: use-local-serious-error-types use-local-authentic-codecs use-local-http
use-npm: use-npm-serious-error-types use-npm-authentic-codecs use-npm-http
#
# Testing
#
TEST_SQLITE = tests/testing.sqlite
TEST_COLLECTION = tests/collection.json
test: build test-setup
npx mocha --recursive ./tests
test-debug: build test-setup
LOG_LEVEL=silly npx mocha --recursive ./tests
test-unit: build test-setup
npx mocha ./tests/unit
test-unit-debug: build test-setup
LOG_LEVEL=silly npx mocha ./tests/unit
test-integration: build test-setup
npx mocha ./tests/integration
test-integration-debug: build test-setup
LOG_LEVEL=silly npx mocha ./tests/integration
test-setup: $(TEST_COLLECTION) $(TEST_SQLITE)
$(TEST_COLLECTION):
curl -X POST "http://localhost:2884/collections" | jq . > $@
$(TEST_SQLITE): tests/build.sql
rm -f $@
nix-shell --command "sqlite3 $@ < tests/build.sql"
sqlite-interactive:
sqlite3 -header -column $(TEST_SQLITE)
#
# 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
#
preview-package: clean-files test
npm pack --dry-run .
create-package: clean-files test
npm pack .
publish-package: clean-files test
npm publish --access public .