-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into grpc-web
- Loading branch information
Showing
18 changed files
with
210 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Debug where options came from | ||
build --announce_rc | ||
|
||
build --noshow_progress | ||
|
||
# Don't rely on test logs being easily accessible from the test runner, | ||
# though it makes the log noisier. | ||
test --test_output=errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This directory is configured in GitHub actions to be persisted between runs. | ||
build --disk_cache=~/.cache/bazel | ||
build --repository_cache=~/.cache/bazel-repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
startup --output_user_root=C:/tmp | ||
build --noshow_progress | ||
test --test_output=errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") | ||
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
copy_to_bin( | ||
name = "copy_entrypoint", | ||
srcs = ["protoc-gen-ts.js"] | ||
) | ||
|
||
nodejs_binary( | ||
name = "bin", | ||
data = [ | ||
":protoc-gen-ts.js", | ||
"//src", | ||
], | ||
entry_point = ":protoc-gen-ts.js", | ||
# See: https://github.com/bazelbuild/rules_nodejs/issues/2600 | ||
templated_args = ["--bazel_patch_module_resolver"], | ||
entry_point = ":copy_entrypoint", | ||
) | ||
|
||
exports_files(["protoc-gen-ts.js"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env node | ||
require('../src/index') | ||
require("../src/index.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax = "proto3"; | ||
|
||
enum E { | ||
One = 0; | ||
Two = 1; | ||
} | ||
|
||
message Test { | ||
repeated E Enums = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* Generated by the protoc-gen-ts. DO NOT EDIT! | ||
* compiler version: 3.19.1 | ||
* source: test/_/issues/171.proto | ||
* git: https://github.com/thesayyn/protoc-gen-ts */ | ||
import * as pb_1 from "google-protobuf"; | ||
export enum E { | ||
One = 0, | ||
Two = 1 | ||
} | ||
export class Test extends pb_1.Message { | ||
#one_of_decls: number[][] = []; | ||
constructor(data?: any[] | { | ||
Enums?: E[]; | ||
}) { | ||
super(); | ||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); | ||
if (!Array.isArray(data) && typeof data == "object") { | ||
if ("Enums" in data && data.Enums != undefined) { | ||
this.Enums = data.Enums; | ||
} | ||
} | ||
} | ||
get Enums() { | ||
return pb_1.Message.getFieldWithDefault(this, 1, []) as E[]; | ||
} | ||
set Enums(value: E[]) { | ||
pb_1.Message.setField(this, 1, value); | ||
} | ||
static fromObject(data: { | ||
Enums?: E[]; | ||
}): Test { | ||
const message = new Test({}); | ||
if (data.Enums != null) { | ||
message.Enums = data.Enums; | ||
} | ||
return message; | ||
} | ||
toObject() { | ||
const data: { | ||
Enums?: E[]; | ||
} = {}; | ||
if (this.Enums != null) { | ||
data.Enums = this.Enums; | ||
} | ||
return data; | ||
} | ||
serialize(): Uint8Array; | ||
serialize(w: pb_1.BinaryWriter): void; | ||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { | ||
const writer = w || new pb_1.BinaryWriter(); | ||
if (this.Enums.length) | ||
writer.writePackedEnum(1, this.Enums); | ||
if (!w) | ||
return writer.getResultBuffer(); | ||
} | ||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Test { | ||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Test(); | ||
while (reader.nextField()) { | ||
if (reader.isEndGroup()) | ||
break; | ||
switch (reader.getFieldNumber()) { | ||
case 1: | ||
message.Enums = reader.readPackedEnum(); | ||
break; | ||
default: reader.skipField(); | ||
} | ||
} | ||
return message; | ||
} | ||
serializeBinary(): Uint8Array { | ||
return this.serialize(); | ||
} | ||
static deserializeBinary(bytes: Uint8Array): Test { | ||
return Test.deserialize(bytes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") | ||
load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
load("@npm//@bazel/typescript:index.bzl", "ts_project") | ||
|
||
write_source_files( | ||
name = "diff", | ||
files = { | ||
"171.ts": "//test/_/issues:171.ts" | ||
} | ||
) | ||
|
||
ts_project( | ||
name = "default", | ||
srcs = glob(["*.ts"]), | ||
tsconfig = { | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "CommonJS" | ||
}, | ||
}, | ||
deps = [ | ||
"@npm//@types/jasmine", | ||
"@npm//@types/node", | ||
"@npm//@types/google-protobuf", | ||
"@npm//google-protobuf", | ||
"@npm//@grpc/grpc-js", | ||
], | ||
) | ||
|
||
build_test( | ||
name = "build_test", | ||
targets = [":default"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.