1 | SHELL := /usr/bin/env bash
|
2 | TYPESCRIPT_SOURCE_FILES = $(shell find src test -type f -name "*.ts")
|
3 |
|
4 | default: .tested .built
|
5 | .PHONY: default
|
6 |
|
7 | .deps: package-lock.json
|
8 | touch $@
|
9 |
|
10 | .codegen:
|
11 | touch $@
|
12 |
|
13 | .built: .deps .codegen $(TYPESCRIPT_SOURCE_FILES)
|
14 | npm run build
|
15 | touch $@
|
16 |
|
17 | .tested: .deps .codegen $(TYPESCRIPT_SOURCE_FILES)
|
18 | TS_NODE_TRANSPILE_ONLY=1 npm run test
|
19 | touch $@
|
20 |
|
21 | .linted: .deps .codegen $(TYPESCRIPT_SOURCE_FILES)
|
22 | npm run lint-fix
|
23 | touch $@
|
24 |
|
25 | package-lock.json: package.json
|
26 | npm install
|
27 | touch $@
|
28 |
|
29 | update-dependencies:
|
30 | npx npm-check-updates --upgrade
|
31 | .PHONY: update-dependencies
|
32 |
|
33 | update-version:
|
34 | ifdef NEW_VERSION
|
35 | npm --no-git-tag-version --allow-same-version version "$(NEW_VERSION)"
|
36 | else
|
37 | @echo -e "\033[0;NEW_VERSION is not defined. Can't update version :-(\033[0m"
|
38 | exit 1
|
39 | endif
|
40 | .PHONY: update-version
|
41 |
|
42 | publish: .deps
|
43 | npm publish
|
44 | .PHONY: publish
|
45 |
|
46 | clean: clean-javascript
|
47 | .PHONY: clean
|
48 |
|
49 | clean-javascript:
|
50 | rm -rf .codegen .built .tested .linted package-lock.json node_modules coverage dist
|
51 | .PHONY: clean-javascript
|