What happened?
The ts_proto_library rules does not have handling for strip_import_prefix (And probably not import_prefix?).
If you use strip_import_prefix the import statements in the generated js/d.ts files are wrong since the prefix also gets stripped from the relative import paths. The import paths should not be stripped since the real source files are not moved when using strip_import_prefix but bazel just creates a virtual folder structure that makes it possible for the protoc compiler to resolve proto imports that have stripped prefixes.
I'm not sure how to solve this but I'm fairly sure that this has to be handled in ts_proto_library since strip_import_prefix is just a Bazel-ism.
Version
Development (host) and target OS/architectures: MacOS
Output of bazel --version: 8.3.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
Latest rules_js/rules_ts
Language(s) and/or frameworks involved:
JavaScript, TypeScript, Protobuf
How to reproduce
Any other information?
No response
What happened?
The
ts_proto_libraryrules does not have handling forstrip_import_prefix(And probably notimport_prefix?).If you use
strip_import_prefixtheimportstatements in the generated js/d.ts files are wrong since the prefix also gets stripped from the relative import paths. The import paths should not be stripped since the real source files are not moved when usingstrip_import_prefixbut bazel just creates a virtual folder structure that makes it possible for the protoc compiler to resolve proto imports that have stripped prefixes.I'm not sure how to solve this but I'm fairly sure that this has to be handled in
ts_proto_librarysincestrip_import_prefixis just a Bazel-ism.Version
Development (host) and target OS/architectures: MacOS
Output of
bazel --version: 8.3.1Version of the Aspect rules, or other relevant rules from your
WORKSPACEorMODULE.bazelfile:Latest rules_js/rules_ts
Language(s) and/or frameworks involved:
JavaScript, TypeScript, Protobuf
How to reproduce
Any other information?
No response