Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,21 @@ archive_override(
urls = ["https://github.com/stackb/closure-templates/archive/9b100cf0d63d36086e00a0a8ca79dd8bf274408e.tar.gz"],
)

# Commit: 91b1fff21928815fb0b5ec3143ededde5711611c
# Date: 2025-10-06 20:16:43 +0000 UTC
# URL: https://github.com/protocolbuffers/protobuf-javascript/commit/91b1fff21928815fb0b5ec3143ededde5711611c
#
# Fix closure-js output
# Size: 401316 (401 kB)
# NOTE: cannot upgrade past protobuf editions...
#
# Commit: 263ee701cba6b75e1f8eddad5adcdf74718318b1
# Date: 2025-10-08 21:32:22 +0000 UTC
# URL: https://github.com/protocolbuffers/protobuf-javascript/commit/263ee701cba6b75e1f8eddad5adcdf74718318b1
#
# remove writeZigzagVarint64BigInt
# Size: 401599 (402 kB)
archive_override(
module_name = "protobuf_javascript",
sha256 = "6919eb403df3f1ae16932801b5667b5198a817cdf2d6a4490eb81121d2357891",
strip_prefix = "protobuf-javascript-91b1fff21928815fb0b5ec3143ededde5711611c",
urls = ["https://github.com/protocolbuffers/protobuf-javascript/archive/91b1fff21928815fb0b5ec3143ededde5711611c.tar.gz"],
sha256 = "8a50071fbca5e4a26361e6c9d81dd842207f0005f7cc1720226f20c25a231805",
strip_prefix = "protobuf-javascript-263ee701cba6b75e1f8eddad5adcdf74718318b1",
urls = ["https://github.com/protocolbuffers/protobuf-javascript/archive/263ee701cba6b75e1f8eddad5adcdf74718318b1.tar.gz"],
patches = ["closure/protobuf/protobuf_javascript.patch"],
patch_strip = 1,
)

# -------------------------------------------------------------------
Expand Down
113 changes: 113 additions & 0 deletions closure/protobuf/protobuf_javascript.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index 62355ce..f989623 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -2,10 +2,6 @@
#
# See also code generation logic under generator/

-load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix")
-load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_zip")
-load("//:protobuf_javascript_release.bzl", "package_naming")
-
config_setting(
name = "x64_x86_windows",
values = {"cpu": "x64_x86_windows"},
@@ -31,65 +27,38 @@ config_setting(
values = {"cpu": "darwin_x86_64"},
)

-package_naming(
- name = "protobuf_javascript_pkg_naming",
- platform = select({
- ":k8": "linux-x86_64", # currently the only supported build type in Github Actions
- ":x64_x86_windows": "win32",
- ":x64_windows": "win64",
- ":darwin_arm64": "osx-aarch_64",
- ":darwin_x86_64": "osx-x86_64",
- "//conditions:default": "" # continues with current behavior when no --cpu is specified allowing existing internal builds to function
- })
-)
-
-pkg_files(
- name = "plugin_files",
- srcs = ["//generator:protoc-gen-js"],
- attributes = pkg_attributes(mode = "0555"),
- prefix = "bin/",
-)
-
-pkg_files(
- name = "dist_files",
- srcs = glob([
- "google/protobuf/*.js",
- "google/protobuf/compiler/*.js"
- ]) + [
- "google-protobuf.js",
- "package.json",
- "README.md",
- "LICENSE.md",
- "LICENSE-asserts.md",
- ],
- strip_prefix = strip_prefix.from_root(""),
-)
-
-pkg_tar(
- name = "dist_tar",
- srcs = [
- ":dist_files",
- ":plugin_files",
- ],
- extension = "tar.gz",
- package_file_name = "protobuf-javascript-{version}-{platform}.tar.gz",
- package_variables = ":protobuf_javascript_pkg_naming",
-)
-
-pkg_zip(
- name = "dist_zip",
- srcs = [
- ":dist_files",
- ":plugin_files",
- ],
- package_file_name = "protobuf-javascript-{version}-{platform}.zip",
- package_variables = ":protobuf_javascript_pkg_naming",
-)
-
filegroup(
- name = "dist_all",
+ name = "javascript",
srcs = [
- ":dist_tar",
- ":dist_zip",
- ]
+ "asserts.js",
+ "binary/any_field_type.js",
+ "binary/arith.js",
+ "binary/binary_constants.js",
+ "binary/bytesource.js",
+ "binary/bytesource_alias.js",
+ "binary/decoder.js",
+ "binary/decoder_alias.js",
+ "binary/encoder.js",
+ "binary/encoder_alias.js",
+ "binary/errors.js",
+ "binary/internal_buffer.js",
+ "binary/reader.js",
+ "binary/reader_alias.js",
+ "binary/repeated_field_type.js",
+ "binary/scalar_field_type.js",
+ "binary/test_utils.js",
+ "binary/utf8.js",
+ "binary/utils.js",
+ "binary/writer.js",
+ "binary/writer_alias.js",
+ "bytestring.js",
+ "debug.js",
+ "internal_bytes.js",
+ "internal_options.js",
+ "internal_public.js",
+ "map.js",
+ "message.js",
+ "unsafe_bytestring.js",
+ ],
+ visibility = ["//visibility:public"],
)
Empty file removed closure/protobuf/protobuf_js.BUILD
Empty file.
15 changes: 0 additions & 15 deletions closure/templates/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,12 @@
# limitations under the License.

load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")

# load("@rules_java//java:defs.bzl", "java_library")
load("//closure:defs.bzl", "closure_js_library")

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

licenses(["notice"])

exports_files([
"javascript-BUILD.patch",
"required_by_soy.js.patch",
"soyutils_usegoog.js.patch",
"soyutils_usegoog.js-gbigint.patch",
"soyutils_usegoog.js-safehtml.patch",
])

# java_library(
# name = "templates",
# exports = ["@com_google_template_soy"],
# )

closure_js_library(
name = "soy_jssrc",
srcs = [
Expand Down
18 changes: 0 additions & 18 deletions closure/templates/javascript-BUILD.patch

This file was deleted.

40 changes: 0 additions & 40 deletions closure/templates/required_by_soy.js.patch

This file was deleted.

18 changes: 0 additions & 18 deletions closure/templates/soyutils_usegoog.js-gbigint.patch

This file was deleted.

39 changes: 0 additions & 39 deletions closure/templates/soyutils_usegoog.js-safehtml.patch

This file was deleted.

38 changes: 0 additions & 38 deletions closure/templates/soyutils_usegoog.js.patch

This file was deleted.

Loading