Skip to content

Commit e06a5cd

Browse files
authored
Merge pull request #3 from stackb/pcj/protobuf-javascript-patch
Update to use patched protobuf-javascript
2 parents 1d036a2 + 1b0e75d commit e06a5cd

File tree

9 files changed

+125
-177
lines changed

9 files changed

+125
-177
lines changed

MODULE.bazel

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,21 @@ archive_override(
4343
urls = ["https://github.com/stackb/closure-templates/archive/9b100cf0d63d36086e00a0a8ca79dd8bf274408e.tar.gz"],
4444
)
4545

46-
# Commit: 91b1fff21928815fb0b5ec3143ededde5711611c
47-
# Date: 2025-10-06 20:16:43 +0000 UTC
48-
# URL: https://github.com/protocolbuffers/protobuf-javascript/commit/91b1fff21928815fb0b5ec3143ededde5711611c
49-
#
50-
# Fix closure-js output
51-
# Size: 401316 (401 kB)
5246
# NOTE: cannot upgrade past protobuf editions...
47+
#
48+
# Commit: 263ee701cba6b75e1f8eddad5adcdf74718318b1
49+
# Date: 2025-10-08 21:32:22 +0000 UTC
50+
# URL: https://github.com/protocolbuffers/protobuf-javascript/commit/263ee701cba6b75e1f8eddad5adcdf74718318b1
51+
#
52+
# remove writeZigzagVarint64BigInt
53+
# Size: 401599 (402 kB)
5354
archive_override(
5455
module_name = "protobuf_javascript",
55-
sha256 = "6919eb403df3f1ae16932801b5667b5198a817cdf2d6a4490eb81121d2357891",
56-
strip_prefix = "protobuf-javascript-91b1fff21928815fb0b5ec3143ededde5711611c",
57-
urls = ["https://github.com/protocolbuffers/protobuf-javascript/archive/91b1fff21928815fb0b5ec3143ededde5711611c.tar.gz"],
56+
sha256 = "8a50071fbca5e4a26361e6c9d81dd842207f0005f7cc1720226f20c25a231805",
57+
strip_prefix = "protobuf-javascript-263ee701cba6b75e1f8eddad5adcdf74718318b1",
58+
urls = ["https://github.com/protocolbuffers/protobuf-javascript/archive/263ee701cba6b75e1f8eddad5adcdf74718318b1.tar.gz"],
59+
patches = ["closure/protobuf/protobuf_javascript.patch"],
60+
patch_strip = 1,
5861
)
5962

6063
# -------------------------------------------------------------------
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
diff --git a/BUILD.bazel b/BUILD.bazel
2+
index 62355ce..f989623 100644
3+
--- a/BUILD.bazel
4+
+++ b/BUILD.bazel
5+
@@ -2,10 +2,6 @@
6+
#
7+
# See also code generation logic under generator/
8+
9+
-load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix")
10+
-load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_zip")
11+
-load("//:protobuf_javascript_release.bzl", "package_naming")
12+
-
13+
config_setting(
14+
name = "x64_x86_windows",
15+
values = {"cpu": "x64_x86_windows"},
16+
@@ -31,65 +27,38 @@ config_setting(
17+
values = {"cpu": "darwin_x86_64"},
18+
)
19+
20+
-package_naming(
21+
- name = "protobuf_javascript_pkg_naming",
22+
- platform = select({
23+
- ":k8": "linux-x86_64", # currently the only supported build type in Github Actions
24+
- ":x64_x86_windows": "win32",
25+
- ":x64_windows": "win64",
26+
- ":darwin_arm64": "osx-aarch_64",
27+
- ":darwin_x86_64": "osx-x86_64",
28+
- "//conditions:default": "" # continues with current behavior when no --cpu is specified allowing existing internal builds to function
29+
- })
30+
-)
31+
-
32+
-pkg_files(
33+
- name = "plugin_files",
34+
- srcs = ["//generator:protoc-gen-js"],
35+
- attributes = pkg_attributes(mode = "0555"),
36+
- prefix = "bin/",
37+
-)
38+
-
39+
-pkg_files(
40+
- name = "dist_files",
41+
- srcs = glob([
42+
- "google/protobuf/*.js",
43+
- "google/protobuf/compiler/*.js"
44+
- ]) + [
45+
- "google-protobuf.js",
46+
- "package.json",
47+
- "README.md",
48+
- "LICENSE.md",
49+
- "LICENSE-asserts.md",
50+
- ],
51+
- strip_prefix = strip_prefix.from_root(""),
52+
-)
53+
-
54+
-pkg_tar(
55+
- name = "dist_tar",
56+
- srcs = [
57+
- ":dist_files",
58+
- ":plugin_files",
59+
- ],
60+
- extension = "tar.gz",
61+
- package_file_name = "protobuf-javascript-{version}-{platform}.tar.gz",
62+
- package_variables = ":protobuf_javascript_pkg_naming",
63+
-)
64+
-
65+
-pkg_zip(
66+
- name = "dist_zip",
67+
- srcs = [
68+
- ":dist_files",
69+
- ":plugin_files",
70+
- ],
71+
- package_file_name = "protobuf-javascript-{version}-{platform}.zip",
72+
- package_variables = ":protobuf_javascript_pkg_naming",
73+
-)
74+
-
75+
filegroup(
76+
- name = "dist_all",
77+
+ name = "javascript",
78+
srcs = [
79+
- ":dist_tar",
80+
- ":dist_zip",
81+
- ]
82+
+ "asserts.js",
83+
+ "binary/any_field_type.js",
84+
+ "binary/arith.js",
85+
+ "binary/binary_constants.js",
86+
+ "binary/bytesource.js",
87+
+ "binary/bytesource_alias.js",
88+
+ "binary/decoder.js",
89+
+ "binary/decoder_alias.js",
90+
+ "binary/encoder.js",
91+
+ "binary/encoder_alias.js",
92+
+ "binary/errors.js",
93+
+ "binary/internal_buffer.js",
94+
+ "binary/reader.js",
95+
+ "binary/reader_alias.js",
96+
+ "binary/repeated_field_type.js",
97+
+ "binary/scalar_field_type.js",
98+
+ "binary/test_utils.js",
99+
+ "binary/utf8.js",
100+
+ "binary/utils.js",
101+
+ "binary/writer.js",
102+
+ "binary/writer_alias.js",
103+
+ "bytestring.js",
104+
+ "debug.js",
105+
+ "internal_bytes.js",
106+
+ "internal_options.js",
107+
+ "internal_public.js",
108+
+ "map.js",
109+
+ "message.js",
110+
+ "unsafe_bytestring.js",
111+
+ ],
112+
+ visibility = ["//visibility:public"],
113+
)

closure/protobuf/protobuf_js.BUILD

Whitespace-only changes.

closure/templates/BUILD

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,12 @@
1313
# limitations under the License.
1414

1515
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
16-
17-
# load("@rules_java//java:defs.bzl", "java_library")
1816
load("//closure:defs.bzl", "closure_js_library")
1917

2018
package(default_visibility = ["//visibility:public"])
2119

2220
licenses(["notice"])
2321

24-
exports_files([
25-
"javascript-BUILD.patch",
26-
"required_by_soy.js.patch",
27-
"soyutils_usegoog.js.patch",
28-
"soyutils_usegoog.js-gbigint.patch",
29-
"soyutils_usegoog.js-safehtml.patch",
30-
])
31-
32-
# java_library(
33-
# name = "templates",
34-
# exports = ["@com_google_template_soy"],
35-
# )
36-
3722
closure_js_library(
3823
name = "soy_jssrc",
3924
srcs = [

closure/templates/javascript-BUILD.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

closure/templates/required_by_soy.js.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.

closure/templates/soyutils_usegoog.js-gbigint.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

closure/templates/soyutils_usegoog.js-safehtml.patch

Lines changed: 0 additions & 39 deletions
This file was deleted.

closure/templates/soyutils_usegoog.js.patch

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)