build: enable importHelpers in tsconfig (#22812)

This is the primary tsconfig file used for Bazel builds.
Previously, we enabled this option only for releases.

PR Close #22812
This commit is contained in:
Alex Eagle 2018-03-15 18:33:52 -07:00 committed by Miško Hevery
parent 44de10e2db
commit f9247e4b2e
18 changed files with 37 additions and 93 deletions

View File

@ -143,6 +143,9 @@ describe('@angular/core ng_package', () => {
expect(shx.cat('bundles/core.umd.js'))
.toMatch(/@license Angular v\d+\.\d+\.\d+(?!-PLACEHOLDER)/);
});
it('should have tslib helpers',
() => { expect(shx.cat('bundles/core.umd.js')).not.toContain('undefined.__extends'); });
});
});

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -32,12 +31,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -49,14 +48,9 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# dissable since tests are running but not yet passing
# disable since tests are running but not yet passing
tags = ["manual"],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,7 +1,6 @@
package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -62,12 +61,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,7 +1,6 @@
package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -57,12 +56,7 @@ jasmine_node_test(
ts_web_test(
name = "render3_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":render3_lib",
],
)

View File

@ -13,7 +13,7 @@ cd `dirname $0`
DIST="../../dist/examples";
rm -rf -- $DIST
$(npm bin)/tsc -p ./tsconfig-build.json
$(npm bin)/tsc -p ./tsconfig-build.json --importHelpers false
mkdir $DIST/vendor/

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -27,12 +26,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -28,12 +27,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -16,10 +15,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
# dissable since tests are running but not yet passing
# disable since tests are running but not yet passing
tags = ["manual"],
deps = [
":test_lib",
"//tools/testing:node",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -30,14 +29,9 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# dissable since tests are running but not yet passing
# disable since tests are running but not yet passing
tags = ["manual"],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -36,14 +35,9 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# dissable since tests are running but not yet passing
# disable since tests are running but not yet passing
tags = ["manual"],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -30,12 +29,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -31,12 +30,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -29,12 +28,7 @@ jasmine_node_test(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -22,7 +22,8 @@
// As tsickle will lower decorators before TS, this is not a problem for our build.
"emitDecoratorMetadata": true,
"sourceMap": true,
"inlineSources": true
"inlineSources": true,
"importHelpers": true
},
"bazelOptions": {
"suppressTsconfigOverrideWarnings": true

View File

@ -1,5 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -22,16 +21,13 @@ ts_library(
ts_web_test(
name = "test_web",
bootstrap = [
"//:web_test_bootstrap_scripts",
# "//:angularjs",
],
# Disable since tests need to request different AngularJS versions at
# runtime, which is not yet supported.
# (Related issue: https://github.com/bazelbuild/rules_typescript/issues/131)
tags = ["manual"],
# do not sort
deps = [
"//tools/testing:browser",
":test_lib",
],
)

View File

@ -1,6 +1,6 @@
"""Re-export of some bazel rules with repository-wide defaults."""
load("@build_bazel_rules_nodejs//:defs.bzl", _npm_package = "npm_package")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library", _ts_web_test = "ts_web_test")
load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
DEFAULT_TSCONFIG = "//packages:tsconfig-build.json"
@ -66,3 +66,16 @@ def npm_package(name, replacements = {}, **kwargs):
stamp_data = "//tools:stamp_data",
replacements = dict(replacements, **PKG_GROUP_REPLACEMENTS),
**kwargs)
def ts_web_test(bootstrap = [], deps = [], **kwargs):
if not bootstrap:
bootstrap = ["//:web_test_bootstrap_scripts"]
local_deps = [
"//:node_modules/tslib/tslib.js",
"//tools/testing:browser",
] + deps
_ts_web_test(
bootstrap = bootstrap,
deps = local_deps,
**kwargs)