Skip to content

Commit 0b5ad2a

Browse files
authored
fix(typescript): fix ts_library to allow deps with module_name but no module_root attrs (#1738)
1 parent a6e29c2 commit 0b5ad2a

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

WORKSPACE

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ install_bazel_dependencies()
9696
git_repository(
9797
name = "build_bazel_rules_typescript",
9898
commit = "10a5a86885f95ab788fd841ade47b6a16e0c13d6",
99-
patches = ["//:rules_typescript_pr_496.patch"],
99+
patches = [
100+
"//:rules_typescript_pr_494.patch",
101+
"//:rules_typescript_pr_496.patch",
102+
],
100103
remote = "https://github.com/bazelbuild/rules_typescript.git",
101104
shallow_since = "1582757372 -0800",
102105
)

rules_typescript_pr_494.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git internal/common/module_mappings.bzl internal/common/module_mappings.bzl
2+
index b74e5b8..286c3b3 100644
3+
--- internal/common/module_mappings.bzl
4+
+++ internal/common/module_mappings.bzl
5+
@@ -76,7 +76,7 @@ def get_module_mappings(label, attrs, srcs = [], workspace_name = None, mappings
6+
workspace_name or label.workspace_root,
7+
label.package,
8+
] if p])
9+
- if attrs.module_root and attrs.module_root != ".":
10+
+ if hasattr(attrs, "module_root") and attrs.module_root and attrs.module_root != ".":
11+
mr = "%s/%s" % (mr, attrs.module_root)
12+
if attrs.module_root.endswith(".ts"):
13+
if workspace_name:

0 commit comments

Comments
 (0)