-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Edge case where ts_proto_library
depends on proto_library(strip_import_prefix=...)
#759
base: main
Are you sure you want to change the base?
Conversation
Test3 test targets passed Targets//examples/proto_grpc:main [k8-fastbuild] 201ms //examples/proto_grpc:status_ts_proto.copy_0_test [k8-fastbuild] 55ms //examples/proto_grpc:status_ts_proto.copy_1_test [k8-fastbuild] 52ms Total test execution time was 308ms. 160 tests (98.2%) were fully cached saving 15s. Buildifier Format |
EDIT: The tests failed b/c previously the comments from I've added the generated |
1b5bf74
to
ce58380
Compare
proto_library
targets that use strip_import_prefix
proto_library
targets that use strip_import_prefix
ts_proto_library
depends on proto_library(strip_import_prefix=...)
ts_proto_library
depends on proto_library(strip_import_prefix=...)
ts_proto_library
depends on proto_library(strip_import_prefix=...)
This PR fixes #476, an edge case where a
ts_proto_library
depends on aproto_library(strip_import_prefix=...)
.For example, the file
proto/myorg/routeguide/v1/route.proto
:myorg.routeguide.v1
instead ofproto.myorg.routeguide.v1
, andmyorg/routeguide/v1/route.proto
instead ofproto/routeguide/v1/route.proto
Previously,
ts_proto_library
was not providing a complete set of imports toprotoc
.After fixing the import problem, building failed b/c
.d.ts
and.js
files were being written to the wrong location.I needed helper functions from
@protobuf//bazel/common:proto_common.bzl
, but since this repository still depends on the deprecated@rules_protobuf
, I just copied them.However, they're governed by Google's BSD-like license. I would like to refactor it into a "third-party" directory, but none exists and I saw no documentation/guidelines about how to go about it. I also plan on adding an example after getting feedback on this.
Changes are visible to end-users: yes
Fixes edge case where
ts_proto_library
depends onproto_library(strip_import_prefix=...)
Test plan
For now, I've removed the test-case.