Skip to content

Commit 9e970a1

Browse files
committed
Merge branch 'master' of github.com:rules-proto-grpc/rules_proto_grpc
2 parents 3bed84a + ee245a8 commit 9e970a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2129
-1
lines changed

.bazelci/presubmit.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,32 @@ tasks:
1111
- "//examples/routeguide:cpp_cpp"
1212
- "//examples/routeguide:cpp_go"
1313
- "//examples/routeguide:cpp_java"
14+
- "//examples/routeguide:cpp_js"
1415
- "//examples/routeguide:cpp_python"
1516
- "//examples/routeguide:go_cpp"
1617
- "//examples/routeguide:go_go"
1718
- "//examples/routeguide:go_java"
19+
- "//examples/routeguide:go_js"
1820
- "//examples/routeguide:go_python"
1921
- "//examples/routeguide:java_cpp"
2022
- "//examples/routeguide:java_go"
2123
- "//examples/routeguide:java_java"
24+
- "//examples/routeguide:java_js"
2225
- "//examples/routeguide:java_python"
26+
- "//examples/routeguide:js_cpp"
27+
- "//examples/routeguide:js_go"
28+
- "//examples/routeguide:js_java"
29+
- "//examples/routeguide:js_js"
30+
- "//examples/routeguide:js_python"
2331
- "//examples/routeguide:python_cpp"
2432
- "//examples/routeguide:python_go"
2533
- "//examples/routeguide:python_java"
34+
- "//examples/routeguide:python_js"
2635
- "//examples/routeguide:python_python"
2736
- "//examples/routeguide:scala_cpp"
2837
- "//examples/routeguide:scala_go"
2938
- "//examples/routeguide:scala_java"
39+
- "//examples/routeguide:scala_js"
3040
- "//examples/routeguide:scala_python"
3141

3242
main_macos:
@@ -40,22 +50,32 @@ tasks:
4050
- "//examples/routeguide:cpp_cpp"
4151
- "//examples/routeguide:cpp_go"
4252
- "//examples/routeguide:cpp_java"
53+
- "//examples/routeguide:cpp_js"
4354
- "//examples/routeguide:cpp_python"
4455
- "//examples/routeguide:go_cpp"
4556
- "//examples/routeguide:go_go"
4657
- "//examples/routeguide:go_java"
58+
- "//examples/routeguide:go_js"
4759
- "//examples/routeguide:go_python"
4860
- "//examples/routeguide:java_cpp"
4961
- "//examples/routeguide:java_go"
5062
- "//examples/routeguide:java_java"
63+
- "//examples/routeguide:java_js"
5164
- "//examples/routeguide:java_python"
65+
- "//examples/routeguide:js_cpp"
66+
- "//examples/routeguide:js_go"
67+
- "//examples/routeguide:js_java"
68+
- "//examples/routeguide:js_js"
69+
- "//examples/routeguide:js_python"
5270
- "//examples/routeguide:python_cpp"
5371
- "//examples/routeguide:python_go"
5472
- "//examples/routeguide:python_java"
73+
- "//examples/routeguide:python_js"
5574
- "//examples/routeguide:python_python"
5675
- "//examples/routeguide:scala_cpp"
5776
- "//examples/routeguide:scala_go"
5877
- "//examples/routeguide:scala_java"
78+
- "//examples/routeguide:scala_js"
5979
- "//examples/routeguide:scala_python"
6080

6181
main_macos_arm64:
@@ -287,6 +307,34 @@ tasks:
287307
- make java_java_proto_compile_example
288308
- make java_java_proto_library_example
289309

310+
js_ubuntu2204_examples:
311+
name: JavaScript
312+
platform: ubuntu2204
313+
environment:
314+
BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"
315+
shell_commands:
316+
- set -x
317+
- make js_js_proto_compile_example
318+
- make js_js_grpc_compile_example
319+
- make js_js_grpc_web_compile_example
320+
- make js_js_proto_library_example
321+
- make js_js_grpc_library_example
322+
- make js_js_grpc_web_library_example
323+
324+
js_macos_examples:
325+
name: JavaScript
326+
platform: macos
327+
environment:
328+
BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"
329+
shell_commands:
330+
- set -x
331+
- make js_js_proto_compile_example
332+
- make js_js_grpc_compile_example
333+
- make js_js_grpc_web_compile_example
334+
- make js_js_proto_library_example
335+
- make js_js_grpc_library_example
336+
- make js_js_grpc_web_library_example
337+
290338
python_ubuntu2204_examples:
291339
name: Python
292340
platform: ubuntu2204

.bazelignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ examples/java/java_grpc_compile
2929
examples/java/java_proto_library
3030
examples/java/java_grpc_library
3131

32+
examples/js/js_proto_compile
33+
examples/js/js_grpc_compile
34+
examples/js/js_grpc_web_compile
35+
examples/js/js_proto_library
36+
examples/js/js_grpc_library
37+
examples/js/js_grpc_web_library
38+
3239
examples/objc/objc_proto_compile
3340
examples/objc/objc_grpc_compile
3441
examples/objc/objc_proto_library

.github/renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@
7171
],
7272
"draftPR": true,
7373
"prBodyNotes": "> [!CAUTION]\n> This PR is marked as draft, as Renovate will not update Package.resolved. See renovatebot/renovate#6924"
74+
},
75+
{
76+
"description": "Ensure JS plugins are updated",
77+
"matchManagers": [
78+
"npm"
79+
],
80+
"matchPackageNames": [
81+
"@grpc/grpc-js",
82+
"google-protobuf",
83+
"grpc-web"
84+
],
85+
"draftPR": true,
86+
"prBodyNotes": "> [!CAUTION]\n> This PR is marked as draft, as the JS plugins need to be updated in sync in modules/js/module_extensions.bzl"
7487
}
7588
],
7689
"postUpdateOptions": [

BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load("@rules_proto_grpc_js_npm//:defs.bzl", "npm_link_all_packages")
2+
3+
npm_link_all_packages(name = "node_modules")

MODULE.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ local_path_override(
8282
path = "modules/java",
8383
)
8484

85+
# JavaScript
86+
bazel_dep(name = "rules_proto_grpc_js", version = "0.0.0.rpg.version.placeholder")
87+
local_path_override(
88+
module_name = "rules_proto_grpc_js",
89+
path = "modules/js",
90+
)
91+
92+
bazel_dep(name = "aspect_rules_js", version = "2.3.7")
93+
94+
# Allow npm_link_all_packages of rules_proto_grpc_js_npm from rules_proto_grpc_js
95+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
96+
use_repo(npm, "rules_proto_grpc_js_npm")
97+
8598
# Objective-C
8699
bazel_dep(name = "rules_proto_grpc_objc", version = "0.0.0.rpg.version.placeholder")
87100
local_path_override(

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ buildifier:
2424
bazel run //tools:buildifier
2525

2626

27+
# Run pnpm to upgrade JS dependencies
28+
.PHONY: js_resolve
29+
js_resolve:
30+
cd modules/js && bazel run -- @pnpm --dir $$PWD install --lockfile-only
31+
32+
2733
# Run pip-compile to upgrade python dependencies
2834
.PHONY: pip_compile
2935
pip_compile:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Full documentation for the current and previous versions [can be found here](htt
9898
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/java.html#java-grpc-compile) | Generates a Java protobuf and gRPC srcjar file ([example](/examples/java/java_grpc_compile)) |
9999
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_proto_library](https://rules-proto-grpc.com/en/latest/lang/java.html#java-proto-library) | Generates a Java protobuf library using ``java_library`` ([example](/examples/java/java_proto_library)) |
100100
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_grpc_library](https://rules-proto-grpc.com/en/latest/lang/java.html#java-grpc-library) | Generates a Java protobuf and gRPC library using ``java_library`` ([example](/examples/java/java_grpc_library)) |
101+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_proto_compile](https://rules-proto-grpc.com/en/latest/lang/js.html#js-proto-compile) | Generates JavaScript protobuf ``.js`` and ``.d.ts`` files ([example](/examples/js/js_proto_compile)) |
102+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/js.html#js-grpc-compile) | Generates JavaScript protobuf and gRPC-js ``.js`` and ``.d.ts`` files ([example](/examples/js/js_grpc_compile)) |
103+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_grpc_web_compile](https://rules-proto-grpc.com/en/latest/lang/js.html#js-grpc-web-compile) | Generates JavaScript protobuf and gRPC-Web ``.js`` and ``.d.ts`` files ([example](/examples/js/js_grpc_web_compile)) |
104+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_proto_library](https://rules-proto-grpc.com/en/latest/lang/js.html#js-proto-library) | Generates a JavaScript protobuf library using ``js_library`` from ``aspect_rules_js`` ([example](/examples/js/js_proto_library)) |
105+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_grpc_library](https://rules-proto-grpc.com/en/latest/lang/js.html#js-grpc-library) | Generates a Node.js protobuf + gRPC-js library using ``js_library`` from ``aspect_rules_js`` ([example](/examples/js/js_grpc_library)) |
106+
| [JavaScript](https://rules-proto-grpc.com/en/latest/lang/js.html) | [js_grpc_web_library](https://rules-proto-grpc.com/en/latest/lang/js.html#js-grpc-web-library) | Generates a JavaScript protobuf + gRPC-Web library using ``js_library`` from ``aspect_rules_js`` ([example](/examples/js/js_grpc_web_library)) |
101107
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_proto_compile](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-proto-compile) | Generates Objective-C protobuf ``.m`` & ``.h`` files ([example](/examples/objc/objc_proto_compile)) |
102108
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-grpc-compile) | Generates Objective-C protobuf and gRPC ``.m`` & ``.h`` files ([example](/examples/objc/objc_grpc_compile)) |
103109
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_proto_library](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-proto-library) | Generates an Objective-C protobuf library using ``objc_library`` ([example](/examples/objc/objc_proto_library)) |

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ Supported Languages and Tools
107107
* - Java
108108
- ✔
109109
- ✔
110+
* - JavaScript
111+
- ✔
112+
- ✔
110113
* - Objective-C
111114
- ✔
112115
- ✔
@@ -167,6 +170,7 @@ Supported Languages and Tools
167170
lang/go
168171
lang/grpc_gateway
169172
lang/java
173+
lang/js
170174
lang/objc
171175
lang/python
172176
lang/scala

0 commit comments

Comments
 (0)