forked from viamrobotics/viam-typescript-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (68 loc) · 1.94 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
81
82
83
84
85
86
87
88
89
90
91
92
node_modules := $(shell npm root)
buf := npm exec --offline -- buf
# common targets
.PHONY: all
all: clean build lint test
.PHONY: setup
setup: $(node_modules)
.PHONY: teardown
teardown:
rm -rf node_modules
.PHONY: build
build: build-buf build-js build-docs
.PHONY: clean
clean: clean-js clean-buf clean-docs
.PHONY: test
test: $(node_modules) build-buf
npm run test
.PHONY: test-watch
test-watch: $(node_modules) build-buf
npm run test:watch
.PHONY: lint
lint: $(node_modules) build-buf
npm run lint
npm run typecheck
npm run check
.PHONY: format
format: $(node_modules)
npm run format
# development dependencies
$(node_modules): package-lock.json
npm ci --audit=false
# protobuf targets
.PHONY: clean-buf
clean-buf:
rm -rf src/gen
.PHONY: update-buf
update-buf: $(node_modules)
$(buf) mod update
.PHONY: build-buf
build-buf: $(node_modules) clean-buf
$(buf) generate $$(./scripts/get-buf-lock-version.js buf.build/googleapis/googleapis)
$(buf) generate $$(./scripts/get-buf-lock-version.js buf.build/viamrobotics/api) --path common,component,robot,service,app,provisioning,tagger
$(buf) generate $$(./scripts/get-buf-lock-version.js buf.build/erdaniels/gostream)
$(buf) generate $$(./scripts/get-buf-lock-version.js buf.build/viamrobotics/goutils)
# js targets
.PHONY: clean-js
clean-js:
rm -rf dist
.PHONY: build-js
build-js: $(node_modules) clean-js build-buf
npm run build
# build and create a tarball from a package - useful for local testing,
# inspecting what is included in the final distribution, and local publishing.
.PHONY: pack
pack: build
npm pack
# bump to the next pre-release version on the `next` distribution tag -
# run this command if you need to publish an off-cycle release of the sdk
.PHONY: bump-next-version
bump-next-version:
npm version --no-git-tag-version prerelease --preid=next
# docs targets
.PHONY: clean-docs
clean-docs:
rm -rf docs/dist
.PHONY: build-docs
build-docs: clean-docs build-buf
npm run doc