-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
52 lines (41 loc) · 1.03 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
NPM ?= npm
.PHONY: all
all: build
.PHONY: build
## build: build the app
build: node_modules
$(NPM) run build
.PHONY: run
## run: runs the service
run:# build
$(NPM) run start
.PHONY: test
## test: runs all tests
test: node_modules
$(NPM) run test
.PHONY: lint
## lint: Run eslint and check types
lint: node_modules
$(NPM) run lint
$(NPM) run check-types
.PHONY: dist
## dist: creates the bundle file
dist: build
cp -r node_modules dist; cd dist; zip -qr js-function *; cp ../src/manifest.json .; cp -r ../static .; zip -r bundle.zip js-function.zip manifest.json static/
## build: build the app when changed
.PHONY: watch
watch: node_modules
$(NPM) run build:watch
.PHONY: clean
## clean: deletes all
clean:
$(NPM) run clean
## node_modules: ensures NPM dependencies are installed without having to run this all the time
node_modules: $(wildcard package.json)
$(NPM) install
touch $@
.PHONY: help
## help: prints this help message
help:
@echo "Usage:"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'