From 95fbb7d675d43e6d9954a3f8efb051fcf2f1f58a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 19 Jan 2018 13:32:39 -0800 Subject: [PATCH] build: Update to latest rules_typescript. (#21675) Fixes #21481 PR Close #21675 --- WORKSPACE | 8 ++------ integration/bazel/WORKSPACE | 8 ++------ packages/bazel/src/ngc-wrapped/index.ts | 11 +++++++---- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 5a3099e55b..b0f78c0bbb 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,12 +15,8 @@ node_repositories(package_json = ["//:package.json"]) git_repository( name = "build_bazel_rules_typescript", - # Use alexeagle's branch temporarily to allow a green build in the middle of - # the tsconfig refactoring. - # TODO(alexeagle): after the change lands in google3, push it to bazelbuild - # mirror and point this back to upstream. - remote = "https://github.com/alexeagle/rules_typescript.git", - commit = "5ccf967a393d94f53b5b1a97760eb1e18367faa3" + remote = "https://github.com/bazelbuild/rules_typescript.git", + commit = "c4ea003acd7d42269b81a2d25eb832972cd24912" ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/integration/bazel/WORKSPACE b/integration/bazel/WORKSPACE index 2c66d3b75f..676089908e 100644 --- a/integration/bazel/WORKSPACE +++ b/integration/bazel/WORKSPACE @@ -13,12 +13,8 @@ node_repositories(package_json = ["//:package.json"]) git_repository( name = "build_bazel_rules_typescript", - # Use alexeagle's branch temporarily to allow a green build in the middle of - # the tsconfig refactoring. - # TODO(alexeagle): after the change lands in google3, push it to bazelbuild - # mirror and point this back to upstream. - remote = "https://github.com/alexeagle/rules_typescript.git", - commit = "5ccf967a393d94f53b5b1a97760eb1e18367faa3" + remote = "https://github.com/bazelbuild/rules_typescript.git", + commit = "c4ea003acd7d42269b81a2d25eb832972cd24912" ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/packages/bazel/src/ngc-wrapped/index.ts b/packages/bazel/src/ngc-wrapped/index.ts index 1b5dde203c..0250c981d5 100644 --- a/packages/bazel/src/ngc-wrapped/index.ts +++ b/packages/bazel/src/ngc-wrapped/index.ts @@ -189,15 +189,18 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true, } return bazelOpts.workspaceName + '/' + result; }; - ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) => - relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, ''); + ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) => path.join( + bazelOpts.workspaceName, + relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, '')); if (allDepsCompiledWithBazel) { // Note: The default implementation would work as well, // but we can be faster as we know how `toSummaryFileName` works. // Note: We can't do this if some deps have been compiled with the command line, // as that has a different implementation of fromSummaryFileName / toSummaryFileName - ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) => - path.resolve(bazelBin, fileName) + '.d.ts'; + ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) => { + const workspaceRelative = fileName.split('/').splice(1).join('/'); + return path.resolve(bazelBin, workspaceRelative) + '.d.ts'; + }; } const emitCallback: ng.TsEmitCallback = ({