diff --git a/packages/animations/BUILD.bazel b/packages/animations/BUILD.bazel index 6d1996dfe0..a74e45e04a 100644 --- a/packages/animations/BUILD.bazel +++ b/packages/animations/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "animations", srcs = glob( [ diff --git a/packages/animations/browser/BUILD.bazel b/packages/animations/browser/BUILD.bazel index 04b19b0df9..04d4f31bec 100644 --- a/packages/animations/browser/BUILD.bazel +++ b/packages/animations/browser/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "browser", srcs = glob( [ diff --git a/packages/animations/browser/testing/BUILD.bazel b/packages/animations/browser/testing/BUILD.bazel index 3da2014fe1..7c7a9e8963 100644 --- a/packages/animations/browser/testing/BUILD.bazel +++ b/packages/animations/browser/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/bazel/index.bzl b/packages/bazel/index.bzl index 3934c35bcd..62337e440d 100644 --- a/packages/bazel/index.bzl +++ b/packages/bazel/index.bzl @@ -7,6 +7,6 @@ Users should not load files under "/src" """ -load("//src:ng_module.bzl", _ng_module = "ng_module") +load("//packages/bazel/src:ng_module.bzl", _ng_module = "ng_module") ng_module = _ng_module diff --git a/packages/bazel/src/ngc-wrapped/BUILD.bazel b/packages/bazel/src/ngc-wrapped/BUILD.bazel index 64150cdb03..beca2b1f0f 100644 --- a/packages/bazel/src/ngc-wrapped/BUILD.bazel +++ b/packages/bazel/src/ngc-wrapped/BUILD.bazel @@ -12,8 +12,8 @@ ts_library( visibility = ["//packages/bazel/test/ngc-wrapped:__subpackages__"], deps = [ # BEGIN-INTERNAL - # Only needed when compiling Angular from sources. - # Users with an npm depnedency will get this dependency from node_modules. + # Only needed when compiling within the Angular repo. + # Users will get this dependency from node_modules. "//packages/compiler-cli", # END-INTERNAL "@build_bazel_rules_typescript//internal/tsc_wrapped", diff --git a/packages/bazel/test/ngc-wrapped/BUILD.bazel b/packages/bazel/test/ngc-wrapped/BUILD.bazel index 36cc00696b..74b1eca65c 100644 --- a/packages/bazel/test/ngc-wrapped/BUILD.bazel +++ b/packages/bazel/test/ngc-wrapped/BUILD.bazel @@ -10,12 +10,8 @@ ts_library( ], tsconfig = ":tsconfig.json", deps = [ - # BEGIN-INTERNAL - # Only needed when compiling within the Angular repo. - # Users will get this dependency from node_modules. - "//packages/compiler-cli", - # END-INTERNAL "//packages/bazel/src/ngc-wrapped:ngc_lib", + "//packages/compiler-cli", ], ) diff --git a/packages/common/http/testing/BUILD.bazel b/packages/common/http/testing/BUILD.bazel index c5a212822a..e01d442796 100644 --- a/packages/common/http/testing/BUILD.bazel +++ b/packages/common/http/testing/BUILD.bazel @@ -1,10 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", - testonly = 1, srcs = glob( [ "*.ts", diff --git a/packages/common/testing/BUILD.bazel b/packages/common/testing/BUILD.bazel index f25172780d..8999c07896 100644 --- a/packages/common/testing/BUILD.bazel +++ b/packages/common/testing/BUILD.bazel @@ -1,10 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/common/testing", deps = [ diff --git a/packages/compiler-cli/BUILD.bazel b/packages/compiler-cli/BUILD.bazel index fc3e6dbbb0..43547a0624 100644 --- a/packages/compiler-cli/BUILD.bazel +++ b/packages/compiler-cli/BUILD.bazel @@ -22,6 +22,7 @@ ts_library( ], ), module_name = "@angular/compiler-cli", + node_modules = "@//:node_modules", tsconfig = ":tsconfig", deps = [ "//packages/compiler", diff --git a/packages/compiler-cli/tsconfig-build.json b/packages/compiler-cli/tsconfig-build.json index 866795a045..962f8f07ed 100644 --- a/packages/compiler-cli/tsconfig-build.json +++ b/packages/compiler-cli/tsconfig-build.json @@ -12,6 +12,9 @@ }, "outDir": "../../dist/packages/compiler-cli" }, + "bazelOptions": { + "suppressTsconfigOverrideWarnings": true + }, "exclude": [ "integrationtest" diff --git a/packages/core/testing/BUILD.bazel b/packages/core/testing/BUILD.bazel index 2e9a59ce59..3d9ac4daaa 100644 --- a/packages/core/testing/BUILD.bazel +++ b/packages/core/testing/BUILD.bazel @@ -1,10 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/core/testing", deps = [ diff --git a/packages/core/testing/src/test_compiler.ts b/packages/core/testing/src/test_compiler.ts index 3a1203981d..c33664638d 100644 --- a/packages/core/testing/src/test_compiler.ts +++ b/packages/core/testing/src/test_compiler.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Compiler, CompilerOptions, Component, ComponentFactory, Directive, Injector, NgModule, Pipe, Type} from '@angular/core'; +import {Compiler, CompilerOptions, Component, ComponentFactory, Directive, Injectable, Injector, NgModule, Pipe, Type} from '@angular/core'; import {MetadataOverride} from './metadata_override'; @@ -19,6 +19,7 @@ function unimplemented(): any { * * @experimental */ +@Injectable() export class TestingCompiler extends Compiler { get injector(): Injector { throw unimplemented(); } overrideModule(module: Type, overrides: MetadataOverride): void { diff --git a/packages/core/tsconfig-build.json b/packages/core/tsconfig-build.json index 50c1ffdf24..ba15f687e8 100644 --- a/packages/core/tsconfig-build.json +++ b/packages/core/tsconfig-build.json @@ -24,4 +24,4 @@ "flatModuleOutFile": "core.js", "flatModuleId": "@angular/core" } -} \ No newline at end of file +} diff --git a/packages/http/testing/BUILD.bazel b/packages/http/testing/BUILD.bazel index 61a2f682f7..afff4d3b71 100644 --- a/packages/http/testing/BUILD.bazel +++ b/packages/http/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/platform-browser-dynamic/BUILD.bazel b/packages/platform-browser-dynamic/BUILD.bazel index 4b49611d4c..7b5628cbe5 100644 --- a/packages/platform-browser-dynamic/BUILD.bazel +++ b/packages/platform-browser-dynamic/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "platform-browser-dynamic", srcs = glob( [ diff --git a/packages/platform-browser-dynamic/testing/BUILD.bazel b/packages/platform-browser-dynamic/testing/BUILD.bazel index 86b73bf42c..f68e10de15 100644 --- a/packages/platform-browser-dynamic/testing/BUILD.bazel +++ b/packages/platform-browser-dynamic/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/platform-browser/testing/BUILD.bazel b/packages/platform-browser/testing/BUILD.bazel index 50f8f8cbad..53776c89a2 100644 --- a/packages/platform-browser/testing/BUILD.bazel +++ b/packages/platform-browser/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/platform-server/testing/BUILD.bazel b/packages/platform-server/testing/BUILD.bazel index 9686f784a2..46ee14572a 100644 --- a/packages/platform-server/testing/BUILD.bazel +++ b/packages/platform-server/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/platform-webworker/BUILD.bazel b/packages/platform-webworker/BUILD.bazel index 21342dc160..348b78fc35 100644 --- a/packages/platform-webworker/BUILD.bazel +++ b/packages/platform-webworker/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "platform-webworker", srcs = glob( [ diff --git a/packages/router/BUILD.bazel b/packages/router/BUILD.bazel index 0f1334a761..87295b81ed 100644 --- a/packages/router/BUILD.bazel +++ b/packages/router/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "router", srcs = glob( [ diff --git a/packages/router/testing/BUILD.bazel b/packages/router/testing/BUILD.bazel index 97aaa0691f..987d1c8199 100644 --- a/packages/router/testing/BUILD.bazel +++ b/packages/router/testing/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), diff --git a/packages/service-worker/BUILD.bazel b/packages/service-worker/BUILD.bazel index 5b524dc537..0db379062b 100644 --- a/packages/service-worker/BUILD.bazel +++ b/packages/service-worker/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "service-worker", srcs = glob( [ diff --git a/packages/service-worker/testing/BUILD.bazel b/packages/service-worker/testing/BUILD.bazel index a08deaa16e..0e72cfe4c7 100644 --- a/packages/service-worker/testing/BUILD.bazel +++ b/packages/service-worker/testing/BUILD.bazel @@ -1,13 +1,14 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "testing", testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/service-worker/testing", deps = [ + "//packages/core", "@rxjs", ], ) diff --git a/packages/service-worker/worker/testing/BUILD.bazel b/packages/service-worker/worker/testing/BUILD.bazel index dcef9c75c8..3dfaa44310 100644 --- a/packages/service-worker/worker/testing/BUILD.bazel +++ b/packages/service-worker/worker/testing/BUILD.bazel @@ -8,6 +8,7 @@ ts_library( srcs = glob(["**/*.ts"]), deps = [ "//packages:types", + "//packages/core", "//packages/service-worker/worker", "@rxjs", ], diff --git a/packages/service-worker/worker/tsconfig.json b/packages/service-worker/worker/tsconfig.json index 148211f5b8..e74e7ed7a0 100644 --- a/packages/service-worker/worker/tsconfig.json +++ b/packages/service-worker/worker/tsconfig.json @@ -15,6 +15,9 @@ "target": "es2017", "typeRoots": [] }, + "bazelOptions": { + "suppressTsconfigOverrideWarnings": true + }, "files": [ "main.ts", "src/service-worker.d.ts" diff --git a/packages/tsconfig.json b/packages/tsconfig.json index e530f27ffb..0517a6978b 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -24,6 +24,9 @@ "target": "es5", "types": ["angularjs"] }, + "bazelOptions": { + "suppressTsconfigOverrideWarnings": true + }, "exclude": [ "bazel", "compiler-cli/integrationtest", diff --git a/packages/upgrade/BUILD.bazel b/packages/upgrade/BUILD.bazel index 15785c29d1..ac09be5935 100644 --- a/packages/upgrade/BUILD.bazel +++ b/packages/upgrade/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "upgrade", srcs = glob( [ diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 88ebffcebc..b49c73a6f6 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -1,6 +1,6 @@ """Re-export of some bazel rules with repository-wide defaults.""" load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library") -load("//packages/bazel/src:ng_module.bzl", _ng_module = "ng_module") +load("//packages/bazel:index.bzl", _ng_module = "ng_module") DEFAULT_TSCONFIG = "//packages:tsconfig-build.json" @@ -9,7 +9,7 @@ def ts_library(tsconfig = None, **kwargs): tsconfig = DEFAULT_TSCONFIG _ts_library(tsconfig = tsconfig, **kwargs) -def ng_module(tsconfig = None, **kwargs): +def ng_module(name, tsconfig = None, **kwargs): if not tsconfig: tsconfig = DEFAULT_TSCONFIG - _ng_module(tsconfig = tsconfig, **kwargs) \ No newline at end of file + _ng_module(name = name, tsconfig = tsconfig, **kwargs)