@@ -11,8 +11,8 @@ GO_MOD_OUTDATED=hack/bin/go-mod-outdated
11
11
GOLIST =go list -f "{{ .Dir }}" -m
12
12
13
13
export GO111MODULE =on
14
- undefine GOOS
15
14
undefine GOARCH
15
+ undefine GOOS
16
16
17
17
all :
18
18
@@ -25,12 +25,6 @@ $(PROTOC_GEN_GO):
25
25
-o ./bin/protoc-gen-go-lite \
26
26
github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite
27
27
28
- $(PROTOC_GEN_STARPC ) :
29
- cd ./hack; \
30
- go build -v \
31
- -o ./bin/protoc-gen-go-starpc \
32
- github.com/aperturerobotics/starpc/cmd/protoc-gen-go-starpc
33
-
34
28
$(GOIMPORTS ) :
35
29
cd ./hack; \
36
30
go build -v \
@@ -61,33 +55,40 @@ $(GO_MOD_OUTDATED):
61
55
-o ./bin/go-mod-outdated \
62
56
github.com/psampaz/go-mod-outdated
63
57
58
+ $(PROTOC_GEN_STARPC ) :
59
+ cd ./hack; \
60
+ go build -v \
61
+ -o ./bin/protoc-gen-go-starpc \
62
+ github.com/aperturerobotics/starpc/cmd/protoc-gen-go-starpc
63
+
64
+ node_modules :
65
+ yarn install
66
+
64
67
.PHONY : genproto
65
68
genproto : vendor node_modules $(GOIMPORTS ) $(PROTOWRAP ) $(PROTOC_GEN_GO ) $(PROTOC_GEN_STARPC )
66
69
shopt -s globstar; \
67
70
set -eo pipefail; \
68
71
export PROJECT=$$(go list -m ) ; \
69
72
export PATH=$$(pwd ) /hack/bin:$$ {PATH}; \
70
- mkdir -p $$(pwd ) /vendor/$$(dirname $${PROJECT} ) ; \
73
+ export OUT=$$(pwd ) /vendor; \
74
+ mkdir -p $$ {OUT}/$$(dirname $${PROJECT} ) ; \
71
75
rm $$(pwd ) /vendor/$$ {PROJECT} || true ; \
72
76
ln -s $$(pwd ) $$(pwd ) /vendor/$$ {PROJECT} ; \
73
77
protogen () { \
74
78
$(PROTOWRAP ) \
75
- -I $$(pwd ) /vendor \
76
- --plugin=./node_modules/.bin/protoc-gen-ts_proto \
77
- --go-lite_out=$$(pwd ) /vendor \
78
- --go-lite_opt=features=marshal+unmarshal+size+equal+clone+json+unmarshal_unsafe \
79
- --go-starpc_out=$$(pwd ) /vendor \
80
- --ts_proto_out=$$(pwd ) /vendor \
81
- --ts_proto_opt=esModuleInterop=true \
82
- --ts_proto_opt=fileSuffix=.pb \
83
- --ts_proto_opt=importSuffix=.js \
84
- --ts_proto_opt=forceLong=long \
85
- --ts_proto_opt=oneof=unions \
86
- --ts_proto_opt=outputServices=default,outputServices=generic-definitions \
87
- --ts_proto_opt=useAbortSignal=true \
88
- --ts_proto_opt=useAsyncIterable=true \
89
- --ts_proto_opt=useDate=true \
90
- --proto_path $$(pwd ) /vendor \
79
+ -I $$ {OUT} \
80
+ --plugin=./node_modules/.bin/protoc-gen-es \
81
+ --plugin=./node_modules/.bin/protoc-gen-es-starpc \
82
+ --go-lite_out=$$ {OUT} \
83
+ --go-lite_opt=features=marshal+unmarshal+size+equal+json+clone \
84
+ --go-starpc_out=$$ {OUT} \
85
+ --es_out=$$ {OUT} \
86
+ --es_opt target=ts \
87
+ --es_opt ts_nocheck=false \
88
+ --es-starpc_out=$$ {OUT} \
89
+ --es-starpc_opt target=ts \
90
+ --es-starpc_opt ts_nocheck=false \
91
+ --proto_path $$ {OUT} \
91
92
--print_structure \
92
93
--only_specified_files \
93
94
$$(\
@@ -101,9 +102,6 @@ genproto: vendor node_modules $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTO
101
102
$(GOIMPORTS ) -w ./
102
103
npm run format:js
103
104
104
- node_modules :
105
- yarn install
106
-
107
105
.PHONY : gen
108
106
gen : genproto
109
107
@@ -117,17 +115,17 @@ list: $(GO_MOD_OUTDATED)
117
115
118
116
.PHONY : lint
119
117
lint : $(GOLANGCI_LINT )
120
- $(GOLANGCI_LINT ) run --timeout=10m
118
+ $(GOLANGCI_LINT ) run
121
119
122
120
.PHONY : fix
123
121
fix : $(GOLANGCI_LINT )
124
- $(GOLANGCI_LINT ) run --fix --timeout=10m
122
+ $(GOLANGCI_LINT ) run --fix
123
+
124
+ .PHONY : test
125
+ test :
126
+ go test -v ./...
125
127
126
128
.PHONY : format
127
129
format : $(GOFUMPT ) $(GOIMPORTS )
128
130
$(GOIMPORTS ) -w ./
129
131
$(GOFUMPT ) -w ./
130
-
131
- .PHONY : test
132
- test :
133
- go test -v ./...
0 commit comments