-
Couldn't load subscription status.
- Fork 94
Fixed: use grpc-tools protoc to restore --js_out on modern protoc #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,10 +78,15 @@ generateGrpc() { | |
| # npm install grpc_tools_node_protoc_ts --save-dev | ||
| PROTOC_GEN_TS_PATH="${PATH_ROOT}/node_modules/.bin/protoc-gen-ts" | ||
| PROTOC_GEN_GRPC_PATH="${PATH_ROOT}/node_modules/.bin/grpc_tools_node_protoc_plugin" | ||
| # Prefer the grpc-tools bundled protoc for JS generation support on newer protoc versions | ||
| PROTOC_BIN="${PATH_ROOT}/node_modules/.bin/grpc_tools_node_protoc" | ||
| if [ ! -x "$PROTOC_BIN" ]; then | ||
| PROTOC_BIN="protoc" | ||
| fi | ||
|
|
||
| # Note: we specify --proto_path to show where we should start searching from. If we use import it will start from this path | ||
| # this is why PATH_PROTO != PATH_PROTO_DAPR; PATH_PROTO_DAPR is where we save our proto files while the other is the namespace | ||
| protoc \ | ||
| "$PROTOC_BIN" \ | ||
| --proto_path="${PATH_PROTO}" \ | ||
| --plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \ | ||
| --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \ | ||
|
|
@@ -131,6 +136,8 @@ downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAM | |
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/internals/v1/apiversion.proto" "$PATH_ROOT/src/proto/dapr/proto/internals/v1/apiversion.proto" | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/internals/v1/service_invocation.proto" "$PATH_ROOT/src/proto/dapr/proto/internals/v1/service_invocation.proto" | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/internals/v1/status.proto" "$PATH_ROOT/src/proto/dapr/proto/internals/v1/status.proto" | ||
| # Missing import used by service_invocation.proto | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/internals/v1/reminders.proto" "$PATH_ROOT/src/proto/dapr/proto/internals/v1/reminders.proto" | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/operator/v1/operator.proto" "$PATH_ROOT/src/proto/dapr/proto/operator/v1/operator.proto" | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/placement/v1/placement.proto" "$PATH_ROOT/src/proto/dapr/proto/placement/v1/placement.proto" | ||
| downloadFile "https://raw.githubusercontent.com/$ORG_NAME/$REPO_NAME/$BRANCH_NAME/dapr/proto/runtime/v1/appcallback.proto" "$PATH_ROOT/src/proto/dapr/proto/runtime/v1/appcallback.proto" | ||
|
|
@@ -147,6 +154,8 @@ echo "" | |
| echo "Compiling gRPC files" | ||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/common/v1/common.proto" | ||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/internals/v1/apiversion.proto" | ||
| # Also generate code for reminders to satisfy imports | ||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/internals/v1/reminders.proto" | ||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/internals/v1/service_invocation.proto" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here - we shouldn't actually be using any of these except appcallback.proto, dapr.proto and common.proto as they're internal to the runtime and subject to change at any point. |
||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/internals/v1/status.proto" | ||
| generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/operator/v1/operator.proto" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove all of these except those actually used by the SDK:
dapr.proto
common.proto
appcallback.proto