UNPKG

1.12 kBPlain TextView Raw
1SHELL := /usr/bin/env bash
2TYPESCRIPT_SOURCE_FILES = $(shell find src test -type f -name "*.ts")
3
4default: .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
25package-lock.json: package.json
26 npm install
27 touch $@
28
29update-dependencies:
30 npx npm-check-updates --upgrade
31.PHONY: update-dependencies
32
33update-version:
34ifdef NEW_VERSION
35 npm --no-git-tag-version --allow-same-version version "$(NEW_VERSION)"
36else
37 @echo -e "\033[0;31mNEW_VERSION is not defined. Can't update version :-(\033[0m"
38 exit 1
39endif
40.PHONY: update-version
41
42publish: .deps
43 npm publish
44.PHONY: publish
45
46post-release:
47 @echo "No post-release needed for javascript"
48.PHONY: post-release
49
50clean: clean-javascript
51.PHONY: clean
52
53clean-javascript:
54 rm -rf .codegen .built .tested .linted package-lock.json node_modules coverage dist
55.PHONY: clean-javascript