From 0425ef708991cef540f23ac5d1dbe18329fa69e2 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 25 Mar 2020 20:41:26 -0700 Subject: [PATCH] fix(typescript): fix ts_library to allow deps with module_name but no module_root attrs --- WORKSPACE | 5 ++++- rules_typescript_pr_494.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 rules_typescript_pr_494.patch diff --git a/WORKSPACE b/WORKSPACE index 435f83bc62..826c846796 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -96,7 +96,10 @@ install_bazel_dependencies() git_repository( name = "build_bazel_rules_typescript", commit = "10a5a86885f95ab788fd841ade47b6a16e0c13d6", - patches = ["//:rules_typescript_pr_496.patch"], + patches = [ + "//:rules_typescript_pr_494.patch", + "//:rules_typescript_pr_496.patch", + ], remote = "http://github.com/bazelbuild/rules_typescript.git", shallow_since = "1582757372 -0800", ) diff --git a/rules_typescript_pr_494.patch b/rules_typescript_pr_494.patch new file mode 100644 index 0000000000..4f5d7617ea --- /dev/null +++ b/rules_typescript_pr_494.patch @@ -0,0 +1,13 @@ +diff --git internal/common/module_mappings.bzl internal/common/module_mappings.bzl +index b74e5b8..286c3b3 100644 +--- internal/common/module_mappings.bzl ++++ internal/common/module_mappings.bzl +@@ -76,7 +76,7 @@ def get_module_mappings(label, attrs, srcs = [], workspace_name = None, mappings + workspace_name or label.workspace_root, + label.package, + ] if p]) +- if attrs.module_root and attrs.module_root != ".": ++ if hasattr(attrs, "module_root") and attrs.module_root and attrs.module_root != ".": + mr = "%s/%s" % (mr, attrs.module_root) + if attrs.module_root.endswith(".ts"): + if workspace_name: