-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
69 lines (54 loc) · 1.61 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
# Paths
build := typescript/tsconfig.build.json
dev := typescript/tsconfig.dev.json
# NPX functions
tsc := node_modules/.bin/tsc
ts_node := node_modules/.bin/ts-node
mocha := node_modules/.bin/mocha
eslint := node_modules/.bin/eslint
main: dev
dev:
@echo "[INFO] Building for development"
@NODE_ENV=development $(tsc) --p $(dev)
build:
@echo "[INFO] Building for production"
@NODE_ENV=production $(tsc) --p $(build)
run-example:
@echo "[INFO] Running Example $(FILE)"
@NODE_ENV=development $(ts_node) --project $(dev) example/$(FILE).ts
tests:
@echo "[INFO] Testing with Mocha"
@NODE_ENV=test \
$(mocha) --config test/.mocharc.json
cov:
@echo "[INFO] Testing with Nyc and Mocha"
@NODE_ENV=test \
nyc $(mocha) --config test/.mocharc.json
lint:
@echo "[INFO] Linting"
@NODE_ENV=production \
$(eslint) . --ext .ts,.tsx \
--config ./typescript/.eslintrc.json
lint-fix:
@echo "[INFO] Linting and Fixing"
@NODE_ENV=development \
$(eslint) . --ext .ts,.tsx \
--config ./typescript/.eslintrc.json --fix
install:
@echo "[INFO] Installing dev Dependencies"
@yarn install --production=false
install-prod:
@echo "[INFO] Installing Dependencies"
@yarn install --production=true
license: clean
@echo "[INFO] Sign files"
@NODE_ENV=development $(ts_node) script/license.ts
clean:
@echo "[INFO] Cleaning release files"
@NODE_ENV=development $(ts_node) script/clean-app.ts
publish: install tests lint license build
@echo "[INFO] Publishing package"
@cd app && npm publish --access=public
publish-dry-run: install tests lint license build
@echo "[INFO] Publishing package"
@cd app && npm publish --access=public --dry-run