-
Notifications
You must be signed in to change notification settings - Fork 94
Using a genrule as dep of ts_library #201
Comments
it's because There ought to be some way to make a TS -> JS dependency edge, but we need to think about that some more. For this particular use case, maybe what you want is a dependency on a ts_proto_library? http://tsetse.info/api/protobufjs/ts_proto_library.html#ts_proto_library OR, the grpc codegen could generate TypeScript instead. @mrmeku is working on a grpc layer for TS, maybe he can give some guidance. |
Yes, |
No, |
@prestonvanloon have you figured out a way to do this? |
@kalbasit I was able to use So I wasn't able to use the genrule, but I did find another way to achieve what I wanted to do: A typescript gRPC node.js server. |
Thanks @prestonvanloon |
I can't use
|
As a follow-up attempt, I tried to "trick" I wrote my own rule (which I assume would not work at runtime, but it looks like it's failing during the analysis phase): JsInfo=provider(fields=["js"])
def _js_library(ctx):
ctx.action(
command = "true",
inputs = ctx.files.srcs,
outputs = [ctx.outputs.js]
)
return [JsInfo(
js=True
)]
js_library = rule(
implementation = _js_library,
attrs = {
"srcs": attr.label_list(allow_files = True),
"js": attr.bool(default=True),
},
outputs = {
"js": "%{name}",
}
) I tried (in succession) to add a |
Why is it enforced that JS files generated by genrule cannot be used as a dep in ts_library?
rules_typescript/internal/common/compilation.bzl
Line 68 in a8479b3
I'm specifically trying to build a workaround for bazel-contrib/rules_nodejs#201
BUILD.bazel
The text was updated successfully, but these errors were encountered: