fix by reducing scope
diff --git a/packages/typescript/index.bzl b/packages/typescript/index.bzl index 7cc9586..3a1761d 100644 --- a/packages/typescript/index.bzl +++ b/packages/typescript/index.bzl
@@ -371,7 +371,9 @@ # Detect how we are being called. # If we are in our starlark module, then we load typescript from the ts_repositories fetch. # Otherwise, we are being called with in the @npm external repo - if native.repository_name() != "build_bazel_rules_nodejs" and native.repository_name() != "@": + if native.repository_name() == "build_bazel_rules_nodejs" or native.repository_name() == "@": + tsc = Label("@npm//typescript/bin:tsc") + else: tsc = Label("//typescript/bin:tsc") if type(extends) == type([]):
diff --git a/packages/typescript/internal/ts_project.bzl b/packages/typescript/internal/ts_project.bzl index fe92110..c622c6a 100644 --- a/packages/typescript/internal/ts_project.bzl +++ b/packages/typescript/internal/ts_project.bzl
@@ -28,7 +28,7 @@ # that compiler might allow more sources than tsc does. "srcs": attr.label_list(allow_files = True, mandatory = True), "supports_workers": attr.bool(default = False), - "tsc": attr.label(default = Label("@npm//typescript/bin:tsc"), executable = True, cfg = "exec"), + "tsc": attr.label(executable = True, cfg = "exec"), "transpile": attr.bool(doc = "whether tsc should be used to produce .js outputs"), "tsconfig": attr.label(mandatory = True, allow_single_file = [".json"]), }