Skip to content

Commit

Permalink
Removed services flag because of pull request improbable-eng#83
Browse files Browse the repository at this point in the history
  • Loading branch information
colton committed May 30, 2018
1 parent 3a42be9 commit c4e3a2b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ typescript_proto_library(
proto = ":proto",
)
```
For an example of how to generate gRPC Service Stubs, take a look at the root `BUILD.bazel` in this repo.

## Contributing
Contributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.
Expand Down
14 changes: 2 additions & 12 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ def proto_path(proto):
return path

def append_to_outputs(ctx, file_name, outputs, file_modifications):
generated_filenames = ["_pb.d.ts", "_pb.js"]

if file_name in ctx.attr.services:
generated_filenames += ["_pb_service.js", "_pb_service.d.ts"]
generated_filenames = ["_pb.d.ts", "_pb.js", "_pb_service.js", "_pb_service.d.ts"]

for f in generated_filenames:
outputs.append(declare_file(ctx, file_name + f, file_modifications))
Expand Down Expand Up @@ -57,9 +54,7 @@ def _typescript_proto_library_impl(ctx):

descriptor_sets = [desc.path for desc in ctx.attr.proto.proto.transitive_descriptor_sets]

ts_out = ""
if ctx.attr.services:
ts_out = "service=true:"
ts_out = "service=true:"

protoc_command = "%s --plugin=protoc-gen-ts=%s --ts_out=%s%s --js_out=import_style=commonjs,binary:%s --descriptor_set_in=%s %s" % (ctx.file._protoc.path, ctx.files._ts_protoc_gen[1].path, ts_out, ctx.var["BINDIR"], ctx.var["BINDIR"], ":".join(descriptor_sets), " ".join(proto_inputs))

Expand Down Expand Up @@ -88,11 +83,6 @@ typescript_proto_library = rule(
single_file = True,
providers = ["proto"],
),
"services": attr.string_list(
doc="An array of service names. Protoc-gen-ts can output additional files for grpc-web. Each element of this array should be the name of the service that will be generated. This is derived from the name of the service. If this proto service is named 'SimpleService', the correct value would be 'simple_service'.",
default = [],
allow_empty = True,
),
"remove_dependencies": attr.string_list(
doc = "Each string given will be grepped and removed from the generated files. This can be useful if your proto files are importing a dependency that the generated Typescript does not use.",
default = [],
Expand Down
3 changes: 0 additions & 3 deletions proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ proto_library(
typescript_proto_library(
name = "generate",
proto = ":proto",
services = [
"orphan",
],
)
3 changes: 0 additions & 3 deletions proto/examplecom/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ proto_library(
typescript_proto_library(
name = "generate",
proto = ":proto",
services = [
"simple_service",
],
)

0 comments on commit c4e3a2b

Please sign in to comment.