Skip to content

Commit

Permalink
build: update to latest Bazel rules_typescript (#27138)
Browse files Browse the repository at this point in the history
PR Close #27138
  • Loading branch information
alexeagle authored and mhevery committed Nov 17, 2018
1 parent 20ea5b5 commit 81e975a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 55 deletions.
4 changes: 2 additions & 2 deletions integration/bazel/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"@angular/bazel": "file:../angular/dist/packages-dist/bazel",
"@angular/compiler": "file:../angular/dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../angular/dist/packages-dist/compiler-cli",
"@bazel/karma": "0.20.3",
"@bazel/typescript": "0.20.3",
"@bazel/karma": "0.21.0",
"@bazel/typescript": "0.21.0",
"@types/jasmine": "2.8.8",
"@types/source-map": "0.5.1",
"protractor": "5.1.2",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@angular-devkit/core": "^7.0.4",
"@angular-devkit/schematics": "^7.0.4",
"@bazel/typescript": "0.20.3",
"@bazel/typescript": "0.21.0",
"@schematics/angular": "^7.0.4",
"@types/chokidar": "1.7.3",
"@types/convert-source-map": "^1.5.1",
Expand Down Expand Up @@ -90,7 +90,7 @@
"devDependencies": {
"@bazel/bazel": "^0.18.1",
"@bazel/ibazel": "^0.1.1",
"@bazel/karma": "0.20.3",
"@bazel/karma": "0.21.0",
"@types/angular": "^1.6.47",
"@types/base64-js": "1.2.5",
"@types/jasminewd2": "^2.0.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/bazel/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def rules_angular_dependencies():
_maybe(
http_archive,
name = "build_bazel_rules_typescript",
url = "https://github.com/bazelbuild/rules_typescript/archive/8ea1a55cf5cf8be84ddfeefc0940769b80da792f.zip",
strip_prefix = "rules_typescript-8ea1a55cf5cf8be84ddfeefc0940769b80da792f",
url = "https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip",
strip_prefix = "rules_typescript-0.21.0",
)

# Needed for Remote Execution
Expand Down
2 changes: 1 addition & 1 deletion packages/bazel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@angular-devkit/core": "^7.0.4",
"@angular-devkit/schematics": "^7.0.4",
"@bazel/typescript": "^0.20.3",
"@bazel/typescript": "^0.21.0",
"@schematics/angular": "^7.0.4",
"@types/node": "6.0.84",
"shelljs": "0.8.2",
Expand Down
14 changes: 4 additions & 10 deletions packages/bazel/src/ngc-wrapped/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const NGC_ASSETS = /\.(css|html|ngsummary\.json)$/;

const BAZEL_BIN = /\b(blaze|bazel)-out\b.*?\bbin\b/;

// TODO(alexeagle): probably not needed, see
// https://github.com/bazelbuild/rules_typescript/issues/28
const ALLOW_NON_HERMETIC_READS = true;
// Note: We compile the content of node_modules with plain ngc command line.
const ALL_DEPS_COMPILED_WITH_BAZEL = false;

Expand Down Expand Up @@ -58,7 +55,6 @@ export function runOneBuild(args: string[], inputs?: {[path: string]: string}):
const compilerOpts = ng.createNgCompilerOptions(basePath, config, tsOptions);
const tsHost = ts.createCompilerHost(compilerOpts, true);
const {diagnostics} = compile({
allowNonHermeticReads: ALLOW_NON_HERMETIC_READS,
allDepsCompiledWithBazel: ALL_DEPS_COMPILED_WITH_BAZEL,
compilerOpts,
tsHost,
Expand All @@ -84,9 +80,8 @@ export function relativeToRootDirs(filePath: string, rootDirs: string[]): string
return filePath;
}

export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true, compilerOpts,
tsHost, bazelOpts, files, inputs, expectedOuts, gatherDiagnostics}: {
allowNonHermeticReads: boolean,
export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
inputs, expectedOuts, gatherDiagnostics}: {
allDepsCompiledWithBazel?: boolean,
compilerOpts: ng.CompilerOptions,
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
Expand All @@ -104,7 +99,7 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
}

if (inputs) {
fileLoader = new CachedFileLoader(fileCache, allowNonHermeticReads);
fileLoader = new CachedFileLoader(fileCache);
// Resolve the inputs to absolute paths to match TypeScript internals
const resolvedInputs: {[path: string]: string} = {};
const inputKeys = Object.keys(inputs);
Expand Down Expand Up @@ -186,8 +181,7 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
}

const bazelHost = new CompilerHost(
files, compilerOpts, bazelOpts, tsHost, fileLoader, allowNonHermeticReads,
generatedFileModuleResolver);
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);

// Also need to disable decorator downleveling in the BazelHost in Ivy mode.
if (isInIvyMode) {
Expand Down
4 changes: 2 additions & 2 deletions tools/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@angular/bazel": "6.1.9",
"@angular/compiler": "6.1.9",
"@angular/compiler-cli": "6.1.9",
"@bazel/karma": "0.20.3",
"@bazel/typescript": "0.20.3",
"@bazel/karma": "0.21.0",
"@bazel/typescript": "0.21.0",
"typescript": "~3.1.1"
},
"scripts": {
Expand Down
24 changes: 7 additions & 17 deletions tools/npm/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
dependencies:
tslib "^1.9.0"

"@bazel/karma@0.20.3":
version "0.20.3"
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.20.3.tgz#a63bb82b4887ae8c0d01f3028c6fa4764470851d"
"@bazel/karma@0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.21.0.tgz#c5ed4c141f44d0e7e18586ad4cff5bd54f70f3cc"
dependencies:
jasmine-core "2.8.0"
karma alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a
Expand All @@ -40,13 +40,12 @@
requirejs "2.3.5"
tmp "0.0.33"

"@bazel/typescript@0.20.3":
version "0.20.3"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.20.3.tgz#51dcc369c2af0d7f2311d6e692d07776492060f4"
"@bazel/typescript@0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.21.0.tgz#41c304f77a42c6a016280d0f4c20e0749c3f4b2a"
dependencies:
protobufjs "5.0.3"
source-map-support "0.5.9"
tsickle "0.28.0"
tsutils "2.27.2"

"@bazel/typescript@^0.15.0":
Expand Down Expand Up @@ -1694,7 +1693,7 @@ karma-sourcemap-loader@0.3.7:
dependencies:
graceful-fs "^4.1.2"

karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a:
"karma@github:alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a":
version "1.7.1"
resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a"
dependencies:
Expand Down Expand Up @@ -3017,15 +3016,6 @@ tsickle@0.25.x:
source-map "^0.5.6"
source-map-support "^0.4.2"

tsickle@0.28.0:
version "0.28.0"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875"
dependencies:
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map "^0.6.0"
source-map-support "^0.5.0"

tsickle@^0.32.1:
version "0.32.1"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"
Expand Down
27 changes: 8 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.1.1.tgz#f970c08b4e4efb0ab17e04ade3cc610554f33bed"
integrity sha1-+XDAi05O+wqxfgSt48xhBVTzO+0=

"@bazel/karma@0.20.3":
version "0.20.3"
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.20.3.tgz#a63bb82b4887ae8c0d01f3028c6fa4764470851d"
integrity sha512-IgWfTpK9XLEI977DS2kHIEO1QfFTEOBxeNDDjHtd1onmzyMCLROphTOBZ/g42ybUIWyJhS9DK4U3bLSMQE0Bng==
"@bazel/karma@0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.21.0.tgz#c5ed4c141f44d0e7e18586ad4cff5bd54f70f3cc"
integrity sha512-V5kxijZ7j/6x7+yNxPhhPrjO0APtNrlr5Gg/I9JRy3/SE3Y88yrPNIiEApLkfYWYWGQuoJO2LifUZA8BOXwLEA==
dependencies:
jasmine-core "2.8.0"
karma alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a
Expand All @@ -66,14 +66,13 @@
requirejs "2.3.5"
tmp "0.0.33"

"@bazel/typescript@0.20.3":
version "0.20.3"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.20.3.tgz#51dcc369c2af0d7f2311d6e692d07776492060f4"
integrity sha512-BZmfzaNkgS++53CGEUk5p9FXOG+k8FNWCDbxzYljoIGP60aIkw4UgRQ24ReBwhCMg6M6KW609yje7AvDZkA6bg==
"@bazel/typescript@0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.21.0.tgz#41c304f77a42c6a016280d0f4c20e0749c3f4b2a"
integrity sha512-ASXj0RFybmqoa3LwqkTU3gNkX9bY9wL/VDNo5hlp9pynYWl4RMpe9V3m/qDIdtSuLJ+qD+Z3FKT/OcpWQHMlYA==
dependencies:
protobufjs "5.0.3"
source-map-support "0.5.9"
tsickle "0.28.0"
tsutils "2.27.2"

"@schematics/angular@^7.0.4":
Expand Down Expand Up @@ -8308,16 +8307,6 @@ trim-off-newlines@^1.0.0:
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM=

tsickle@0.28.0:
version "0.28.0"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875"
integrity sha512-cb/Z4NlKMPGiIIbgmklfBJIxDl4EQoYqC+0/BnPxZWzWcUvikeOHFkkkEmabJVqKh47jUqOwU/uMAu6UvhicZg==
dependencies:
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map "^0.6.0"
source-map-support "^0.5.0"

tsickle@0.32.1:
version "0.32.1"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"
Expand Down

0 comments on commit 81e975a

Please sign in to comment.