-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (42 loc) · 1.49 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
all:
@echo You probably want to cd rn
.PHONY: all
clean.gen:
for api in $$(ls api); do rm -fr \
go/pkg/$${api}/$${api}_grpc.pb.go \
go/pkg/$${api}/$${api}.pb.go \
rn/src/api/$${api} \
; done
rm -f go/bind/labs/modules.go
rm -f rn/src/api/index.ts
.PHONY: clean.gen
generate:
$(MAKE) -C rn node_modules
buf generate api
set -e; for api in $$(ls api); do \
echo '/* eslint-disable no-dupe-class-members */' > rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
cat rn/src/api/$${api}/v1/$${api}_pb_service.d.ts >> rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
mv rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts rn/src/api/$${api}/v1/$${api}_pb_service.d.ts; \
\
echo '/* eslint-disable eslint-comments/no-unlimited-disable */' > rn/src/api/$${api}/v1/$${api}_pb.new.js; \
cat rn/src/api/$${api}/v1/$${api}_pb.js >> rn/src/api/$${api}/v1/$${api}_pb.new.js; \
mv rn/src/api/$${api}/v1/$${api}_pb.new.js rn/src/api/$${api}/v1/$${api}_pb.js; \
\
echo "export * from './$${api}_pb'" > rn/src/api/$${api}/v1/index.ts; \
echo "export * from './$${api}_pb_service'" >> rn/src/api/$${api}/v1/index.ts; \
\
echo "export * as $${api} from './$${api}/v1'" >> rn/src/api/index.ts; \
done
$(MAKE) -C rn lint.fix
cd rn && npx ts-node src/create-mod/gen-go-modules-list
.PHONY: generate
lint.proto:
buf lint api
buf breaking --against 'https://github.com/berty/labs.git'
.PHONY: lint.proto
lint: lint.proto
$(MAKE) -C rn lint
.PHONY: lint
regen: clean.gen
$(MAKE) generate
.PHONY: regen