Skip to content

Commit f704b22

Browse files
committed
Merge branch 'main' of github.com:protocolbuffers/protobuf-javascript
� Conflicts: � gulpfile.js
2 parents d936c51 + cb8c3ab commit f704b22

30 files changed

+159
-76
lines changed

BUILD

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

BUILD.bazel

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Protobuf JS runtime
2+
#
3+
# See also code generation logic under generator/
4+
5+
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix")
6+
load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_zip")
7+
load("//:protobuf_javascript_release.bzl", "package_naming")
8+
9+
package_naming(
10+
name = "protobuf_javascript_pkg_naming",
11+
)
12+
13+
pkg_files(
14+
name = "plugin_files",
15+
srcs = ["//generator:protoc-gen-js"],
16+
attributes = pkg_attributes(mode = "0555"),
17+
prefix = "bin/",
18+
)
19+
20+
pkg_files(
21+
name = "dist_files",
22+
srcs = glob([
23+
"google/protobuf/*.js",
24+
"google/protobuf/compiler/*.js"
25+
]) + [
26+
"google-protobuf.js",
27+
"package.json",
28+
"README.md",
29+
"LICENSE.md",
30+
],
31+
strip_prefix = strip_prefix.from_root(""),
32+
)
33+
34+
pkg_tar(
35+
name = "dist_tar",
36+
srcs = [
37+
":dist_files",
38+
":plugin_files",
39+
],
40+
extension = "tar.gz",
41+
package_file_name = "protobuf-javascript-{version}-{platform}.tar.gz",
42+
package_variables = ":protobuf_javascript_pkg_naming",
43+
)
44+
45+
pkg_zip(
46+
name = "dist_zip",
47+
srcs = [
48+
":dist_files",
49+
":plugin_files",
50+
],
51+
package_file_name = "protobuf-javascript-{version}-{platform}.zip",
52+
package_variables = ":protobuf_javascript_pkg_naming",
53+
)
54+
55+
filegroup(
56+
name = "dist_all",
57+
srcs = [
58+
":dist_tar",
59+
":dist_zip",
60+
]
61+
)

LICENSE renamed to LICENSE.md

File renamed without changes.

WORKSPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ http_archive(
1111
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
1212

1313
protobuf_deps()
14+
15+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
16+
rules_pkg_dependencies()

binary/proto_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ goog.require('goog.testing.asserts');
3535
goog.require('jspb.BinaryWriter');
3636
goog.require('jspb.Message');
3737

38-
// CommonJS-LoadFromFile: ../testbinary_pb proto.jspb.test
38+
// CommonJS-LoadFromFile: ../protos/testbinary_pb proto.jspb.test
3939
goog.require('proto.jspb.test.ExtendsWithMessage');
4040
goog.require('proto.jspb.test.ForeignEnum');
4141
goog.require('proto.jspb.test.ForeignMessage');

commonjs/strict_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ var global = Function('return this')();
3939
// Bring asserts into the global namespace.
4040
googleProtobuf.object.extend(global, asserts);
4141

42-
var test9_pb = require('./test9_pb');
43-
var test10_pb = require('./test10_pb');
42+
var test9_pb = require('./protos/test9_pb');
43+
var test10_pb = require('./protos/test10_pb');
4444

4545
describe('Strict test suite', function() {
4646
it('testImportedMessage', function() {

generator/BUILD renamed to generator/BUILD.bazel

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ cc_binary(
99
],
1010
visibility = ["//visibility:public"],
1111
deps = [
12-
#"@com_google_absl//absl/base:core_headers",
13-
#"@com_google_absl//absl/container:flat_hash_map",
14-
#"@com_google_absl//absl/container:flat_hash_set",
15-
#"@com_google_absl//absl/strings",
1612
"@com_google_protobuf//:protobuf",
1713
"@com_google_protobuf//:protoc_lib",
1814
],
1915
)
16+

gulpfile.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ const wellKnownTypes = [
2828
wellKnownTypes.forEach((path) => protocInc + '/' + path);
2929

3030
const group1Protos = [
31-
'data.proto',
32-
'test3.proto',
33-
'test5.proto',
31+
'protos/data.proto',
32+
'protos/test3.proto',
33+
'protos/test5.proto',
3434
'commonjs/test6/test6.proto',
35-
'test8.proto',
36-
'test11.proto',
37-
'test12.proto',
38-
'test13.proto',
39-
'test14.proto',
40-
'test15.proto',
41-
'testbinary.proto',
42-
'testempty.proto',
43-
'test.proto',
44-
'testlargenumbers.proto',
35+
'protos/test8.proto',
36+
'protos/test11.proto',
37+
'protos/test12.proto',
38+
'protos/test13.proto',
39+
'protos/test14.proto',
40+
'protos/test15.proto',
41+
'protos/testbinary.proto',
42+
'protos/testempty.proto',
43+
'protos/test.proto',
44+
'protos/testlargenumbers.proto',
4545
];
4646

4747
const group2Protos = [
48-
'proto3_test.proto',
49-
'test2.proto',
50-
'test4.proto',
48+
'protos/proto3_test.proto',
49+
'protos/test2.proto',
50+
'protos/test4.proto',
5151
'commonjs/test7/test7.proto',
5252
];
5353

5454
const group3Protos = [
55-
'test9.proto',
56-
'test10.proto'
55+
'protos/test9.proto',
56+
'protos/test10.proto'
5757
];
5858

5959
function make_exec_logging_callback(cb) {

maps_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ goog.require('goog.testing.asserts');
3232
goog.require('goog.testing.TestCase');
3333
goog.require('goog.userAgent');
3434

35-
// CommonJS-LoadFromFile: testbinary_pb proto.jspb.test
35+
// CommonJS-LoadFromFile: protos/testbinary_pb proto.jspb.test
3636
goog.require('proto.jspb.test.MapValueEnum');
3737
goog.require('proto.jspb.test.MapValueMessage');
3838
goog.require('proto.jspb.test.TestMapFields');
@@ -50,7 +50,7 @@ goog.require('proto.jspb.test.MapEntryOptionalValuesDoubleValue');
5050
goog.require('proto.jspb.test.MapEntryOptionalValuesEnumValue');
5151
goog.require('proto.jspb.test.MapEntryOptionalValuesMessageValue');
5252

53-
// CommonJS-LoadFromFile: test_pb proto.jspb.test
53+
// CommonJS-LoadFromFile: protos/test_pb proto.jspb.test
5454
goog.require('proto.jspb.test.MapValueMessageNoBinary');
5555
goog.require('proto.jspb.test.TestMapFieldsNoBinary');
5656

message_test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ goog.require('goog.testing.asserts');
3737
goog.require('goog.testing.TestCase');
3838
goog.require('goog.userAgent');
3939

40-
// CommonJS-LoadFromFile: google-protobuf jspb
40+
// CommonJS-LoadFromFile: protos/google-protobuf jspb
4141
goog.require('jspb.Message');
4242

43-
// CommonJS-LoadFromFile: test15_pb proto.jspb.filenametest.package1
43+
// CommonJS-LoadFromFile: protos/test15_pb proto.jspb.filenametest.package1
4444
goog.require('proto.jspb.filenametest.package1.b');
4545

46-
// CommonJS-LoadFromFile: test14_pb proto.jspb.filenametest.package2
46+
// CommonJS-LoadFromFile: protos/test14_pb proto.jspb.filenametest.package2
4747
goog.require('proto.jspb.filenametest.package2.TestMessage');
4848

49-
// CommonJS-LoadFromFile: test13_pb proto.jspb.filenametest.package1
49+
// CommonJS-LoadFromFile: protos/test13_pb proto.jspb.filenametest.package1
5050
goog.require('proto.jspb.filenametest.package1.a');
5151
goog.require('proto.jspb.filenametest.package1.TestMessage');
5252

53-
// CommonJS-LoadFromFile: test12_pb proto.jspb.circulartest
53+
// CommonJS-LoadFromFile: protos/test12_pb proto.jspb.circulartest
5454
goog.require('proto.jspb.circulartest.ExtensionContainingType1');
5555
goog.require('proto.jspb.circulartest.ExtensionContainingType2');
5656
goog.require('proto.jspb.circulartest.ExtensionField1');
@@ -67,25 +67,25 @@ goog.require('proto.jspb.circulartest.NestedMessage2');
6767
goog.require('proto.jspb.circulartest.RepeatedMessageField1');
6868
goog.require('proto.jspb.circulartest.RepeatedMessageField2');
6969

70-
// CommonJS-LoadFromFile: test11_pb proto.jspb.exttest.reverse
70+
// CommonJS-LoadFromFile: protos/test11_pb proto.jspb.exttest.reverse
7171
goog.require('proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage1');
7272
goog.require('proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage2');
7373
goog.require('proto.jspb.exttest.reverse.c');
7474

75-
// CommonJS-LoadFromFile: test8_pb proto.jspb.exttest.nested
75+
// CommonJS-LoadFromFile: protos/test8_pb proto.jspb.exttest.nested
7676
goog.require('proto.jspb.exttest.nested.TestNestedExtensionsMessage');
7777
goog.require('proto.jspb.exttest.nested.TestOuterMessage');
7878

79-
// CommonJS-LoadFromFile: test5_pb proto.jspb.exttest.beta
79+
// CommonJS-LoadFromFile: protos/test5_pb proto.jspb.exttest.beta
8080
goog.require('proto.jspb.exttest.beta.floatingStrField');
8181

82-
// CommonJS-LoadFromFile: test3_pb proto.jspb.exttest
82+
// CommonJS-LoadFromFile: protos/test3_pb proto.jspb.exttest
8383
goog.require('proto.jspb.exttest.floatingMsgField');
8484

85-
// CommonJS-LoadFromFile: test4_pb proto.jspb.exttest
85+
// CommonJS-LoadFromFile: protos/test4_pb proto.jspb.exttest
8686
goog.require('proto.jspb.exttest.floatingMsgFieldTwo');
8787

88-
// CommonJS-LoadFromFile: test_pb proto.jspb.test
88+
// CommonJS-LoadFromFile: protos/test_pb proto.jspb.test
8989
goog.require('proto.jspb.test.BooleanFields');
9090
goog.require('proto.jspb.test.CloneExtension');
9191
goog.require('proto.jspb.test.Complex');
@@ -114,12 +114,12 @@ goog.require('proto.jspb.test.TestMessageWithOneof');
114114
goog.require('proto.jspb.test.TestReservedNames');
115115
goog.require('proto.jspb.test.TestReservedNamesExtension');
116116

117-
// CommonJS-LoadFromFile: test2_pb proto.jspb.test
117+
// CommonJS-LoadFromFile: protos/test2_pb proto.jspb.test
118118
goog.require('proto.jspb.test.ExtensionMessage');
119119
goog.require('proto.jspb.test.TestExtensionsMessage');
120120

121121
goog.require('proto.jspb.test.TestAllowAliasEnum');
122-
// CommonJS-LoadFromFile: testlargenumbers_pb proto.jspb.test
122+
// CommonJS-LoadFromFile: protos/testlargenumbers_pb proto.jspb.test
123123
goog.require('proto.jspb.test.MessageWithLargeFieldNumbers');
124124

125125
goog.require('proto.jspb.test.simple1');

0 commit comments

Comments
 (0)