build: upgrade bazel rules to latest (#20768)
Add enough BUILD files to make it possible to `bazel build packages/core/test` Also re-format BUILD.bazel files with Buildifier. Add a CI lint check that they stay formatted. PR Close #20768
This commit is contained in:
@ -1 +1,20 @@
|
||||
exports_files(["tsconfig-build.json"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files([
|
||||
"tsconfig-build.json",
|
||||
"tsconfig.json",
|
||||
])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_config", "ts_library")
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = ":tsconfig-build.json",
|
||||
deps = [],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "types",
|
||||
srcs = glob(["*.ts"]),
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
18
packages/animations/BUILD.bazel
Normal file
18
packages/animations/BUILD.bazel
Normal file
@ -0,0 +1,18 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "animations",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/animations",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
18
packages/animations/browser/BUILD.bazel
Normal file
18
packages/animations/browser/BUILD.bazel
Normal file
@ -0,0 +1,18 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "browser",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/animations/browser",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/animations",
|
||||
],
|
||||
)
|
17
packages/animations/browser/test/BUILD.bazel
Normal file
17
packages/animations/browser/test/BUILD.bazel
Normal file
@ -0,0 +1,17 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/animations/browser/testing",
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
@ -53,13 +53,13 @@ export function main() {
|
||||
player.onStart(() => log.push('started'));
|
||||
player.onDone(() => log.push('done'));
|
||||
|
||||
player.triggerCallback('start');
|
||||
(player as any).triggerCallback('start');
|
||||
expect(log).toEqual(['started']);
|
||||
|
||||
player.play();
|
||||
expect(log).toEqual(['started']);
|
||||
|
||||
player.triggerCallback('done');
|
||||
(player as any).triggerCallback('done');
|
||||
expect(log).toEqual(['started', 'done']);
|
||||
|
||||
player.finish();
|
||||
|
15
packages/animations/browser/testing/BUILD.bazel
Normal file
15
packages/animations/browser/testing/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/animations/browser/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
],
|
||||
)
|
15
packages/animations/test/BUILD.bazel
Normal file
15
packages/animations/test/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
srcs = glob(["test/**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/animations",
|
||||
"//packages/core/testing",
|
||||
],
|
||||
)
|
@ -49,13 +49,13 @@ export function main() {
|
||||
player.onDone(() => log.push('done'));
|
||||
flushMicrotasks();
|
||||
|
||||
player.triggerCallback('start');
|
||||
(player as any).triggerCallback('start');
|
||||
expect(log).toEqual(['started']);
|
||||
|
||||
player.play();
|
||||
expect(log).toEqual(['started']);
|
||||
|
||||
player.triggerCallback('done');
|
||||
(player as any).triggerCallback('done');
|
||||
expect(log).toEqual(['started', 'done']);
|
||||
|
||||
player.finish();
|
||||
|
@ -9,7 +9,6 @@
|
||||
"typescript": ">=2.4.2 <2.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bazel/typescript": "0.3.2",
|
||||
"@types/node": "6.0.84"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -4,41 +4,42 @@ load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
ts_library(
|
||||
name = "ngc_lib",
|
||||
srcs = [
|
||||
"index.ts",
|
||||
"extract_i18n.ts",
|
||||
"index.ts",
|
||||
],
|
||||
module_name = "@angular/bazel",
|
||||
tsconfig = ":tsconfig.json",
|
||||
visibility = ["//test/ngc-wrapped:__subpackages__"],
|
||||
deps = [
|
||||
# BEGIN-INTERNAL
|
||||
# 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"
|
||||
"@build_bazel_rules_typescript//internal/tsc_wrapped",
|
||||
],
|
||||
tsconfig = ":tsconfig.json",
|
||||
visibility = ["//test/ngc-wrapped:__subpackages__"],
|
||||
)
|
||||
|
||||
nodejs_binary(
|
||||
name = "ngc-wrapped",
|
||||
data = [
|
||||
":ngc_lib",
|
||||
"@build_bazel_rules_typescript//internal:worker_protocol.proto",
|
||||
],
|
||||
# Entry point assumes the user is outside this WORKSPACE,
|
||||
# and references our rules with @angular//src/ngc-wrapped
|
||||
entry_point = "angular/src/ngc-wrapped/index.js",
|
||||
data = [
|
||||
":ngc_lib",
|
||||
"@build_bazel_rules_typescript//internal:worker_protocol.proto"
|
||||
],
|
||||
node_modules = "@build_bazel_rules_typescript_deps//:node_modules",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
nodejs_binary(
|
||||
name = "xi18n",
|
||||
# Entry point assumes the user is outside this WORKSPACE,
|
||||
# and references our rules with @angular//src/ngc-wrapped
|
||||
entry_point = "angular/src/ngc-wrapped/index.js/extract_i18n.js",
|
||||
data = [
|
||||
":ngc_lib",
|
||||
],
|
||||
# Entry point assumes the user is outside this WORKSPACE,
|
||||
# and references our rules with @angular//src/ngc-wrapped
|
||||
entry_point = "angular/src/ngc-wrapped/index.js/extract_i18n.js",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
@ -8,32 +8,32 @@ ts_library(
|
||||
"test_support.ts",
|
||||
"tsconfig_template.ts",
|
||||
],
|
||||
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
|
||||
"//src/ngc-wrapped:ngc_lib"
|
||||
"//src/ngc-wrapped:ngc_lib",
|
||||
],
|
||||
tsconfig = ":tsconfig.json",
|
||||
)
|
||||
|
||||
# We need a filegroup so that we can refer
|
||||
# .d.ts files (by default, jasmine_node_test would get the .js files).
|
||||
filegroup(
|
||||
name = "angular_core",
|
||||
srcs = ["@//packages/core"]
|
||||
srcs = ["@//packages/core"],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
name = "ngc_test",
|
||||
size = "small",
|
||||
srcs = [":ngc_test_lib"],
|
||||
data = [
|
||||
"@build_bazel_rules_typescript//internal:worker_protocol.proto",
|
||||
":angular_core",
|
||||
"//test/ngc-wrapped/empty:empty_tsconfig.json",
|
||||
"//test/ngc-wrapped/empty:tsconfig.json",
|
||||
"@build_bazel_rules_typescript//internal:worker_protocol.proto",
|
||||
],
|
||||
size="small",
|
||||
)
|
||||
|
@ -1,10 +1,10 @@
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
package(default_visibility=["//test:__subpackages__"])
|
||||
package(default_visibility = ["//test:__subpackages__"])
|
||||
|
||||
ng_module(
|
||||
name = "empty",
|
||||
srcs = ["empty.ts"],
|
||||
deps = ["@//packages/core"],
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = ["@//packages/core"],
|
||||
)
|
||||
|
@ -40,7 +40,7 @@ export function setup(
|
||||
bazelBin?: string,
|
||||
tsconfig?: string,
|
||||
} = {}): TestSupport {
|
||||
const runfilesPath = process.env['RUNFILES'];
|
||||
const runfilesPath = process.env['TEST_SRCDIR'];
|
||||
|
||||
const basePath = makeTempDir(runfilesPath);
|
||||
|
||||
@ -150,7 +150,7 @@ function makeTempDir(baseDir): string {
|
||||
}
|
||||
|
||||
export function listFilesRecursive(dir: string, fileList: string[] = []) {
|
||||
fs.readdirSync(dir).map(file => {
|
||||
fs.readdirSync(dir).forEach(file => {
|
||||
if (fs.statSync(path.join(dir, file)).isDirectory()) {
|
||||
listFilesRecursive(path.join(dir, file), fileList);
|
||||
} else {
|
||||
|
@ -68,6 +68,9 @@ export function createTsConfig(options: TsConfigOptions) {
|
||||
// Because we ask for :empty_tsconfig.json, we get the ES6 version which
|
||||
// expects to write externs, yet that doesn't work under this fixture.
|
||||
'tsickleExternsPath': '',
|
||||
// we don't copy the node_modules into our tmp dir, so we should look in
|
||||
// the original workspace directory for it
|
||||
'nodeModulesPrefix': '../angular_src/node_modules',
|
||||
},
|
||||
'files': options.files,
|
||||
'angularCompilerOptions': {
|
||||
|
@ -1,15 +1,19 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "common",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"http/**",
|
||||
"locales/**",
|
||||
"test/**",
|
||||
"testing/**",
|
||||
]),
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/common",
|
||||
deps = ["//packages/core"],
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
||||
|
20
packages/common/http/BUILD.bazel
Normal file
20
packages/common/http/BUILD.bazel
Normal file
@ -0,0 +1,20 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "http",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/common/http",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
14
packages/common/http/testing/BUILD.bazel
Normal file
14
packages/common/http/testing/BUILD.bazel
Normal file
@ -0,0 +1,14 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["testing/**/*.ts"]),
|
||||
module_name = "@angular/common/http/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common/http",
|
||||
],
|
||||
)
|
16
packages/common/testing/BUILD.bazel
Normal file
16
packages/common/testing/BUILD.bazel
Normal file
@ -0,0 +1,16 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/common/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
@ -1,21 +1,24 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_config")
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig-build.json",
|
||||
deps = ["//packages:tsconfig-build.json"]
|
||||
deps = ["//packages:tsconfig-build.json"],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "compiler-cli",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"integrationtest/**",
|
||||
"test/**",
|
||||
]),
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/compiler-cli",
|
||||
deps = [
|
||||
"//packages/compiler"
|
||||
],
|
||||
tsconfig = ":tsconfig",
|
||||
deps = [
|
||||
"//packages/compiler",
|
||||
],
|
||||
)
|
||||
|
@ -1,12 +1,15 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "compiler",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"test/**",
|
||||
"testing/**",
|
||||
]),
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/compiler",
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
)
|
||||
|
@ -43,8 +43,6 @@ const TAG_TO_PLACEHOLDER_NAMES: {[k: string]: string} = {
|
||||
* Creates unique names for placeholder with different content.
|
||||
*
|
||||
* Returns the same placeholder name when the content is identical.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export class PlaceholderRegistry {
|
||||
// Count the occurrence of the base name top generate a unique name
|
||||
|
22
packages/compiler/test/BUILD.bazel
Normal file
22
packages/compiler/test/BUILD.bazel
Normal file
@ -0,0 +1,22 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/common",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli",
|
||||
"//packages/compiler/testing",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/testing",
|
||||
],
|
||||
)
|
@ -33,7 +33,7 @@ describe('StaticReflector', () => {
|
||||
beforeEach(() => init());
|
||||
|
||||
function simplify(context: StaticSymbol, value: any) {
|
||||
return reflector.simplify(context, value);
|
||||
return (reflector as any).simplify(context, value);
|
||||
}
|
||||
|
||||
it('should get annotations for NgFor', () => {
|
||||
@ -1079,11 +1079,11 @@ describe('StaticReflector', () => {
|
||||
'/tmp/root.ts': ``,
|
||||
'/tmp/a.ts': `export const x = 1;`,
|
||||
});
|
||||
let symbol =
|
||||
reflector.resolveExternalReference({moduleName: './a', name: 'x'}, '/tmp/root.ts');
|
||||
let symbol = reflector.resolveExternalReference(
|
||||
{moduleName: './a', name: 'x', runtime: null}, '/tmp/root.ts');
|
||||
expect(symbolResolver.getKnownModuleName(symbol.filePath)).toBeFalsy();
|
||||
|
||||
symbol = reflector.resolveExternalReference({moduleName: 'a', name: 'x'});
|
||||
symbol = reflector.resolveExternalReference({moduleName: 'a', name: 'x', runtime: null});
|
||||
expect(symbolResolver.getKnownModuleName(symbol.filePath)).toBe('a');
|
||||
});
|
||||
});
|
||||
|
12
packages/compiler/testing/BUILD.bazel
Normal file
12
packages/compiler/testing/BUILD.bazel
Normal file
@ -0,0 +1,12 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/compiler/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = ["//packages/compiler"],
|
||||
)
|
@ -1,13 +1,19 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ng_module(
|
||||
name = "core",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"test/**",
|
||||
"testing/**",
|
||||
]),
|
||||
module_name = "@angular/core",
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
)
|
||||
name = "core",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/core",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
||||
|
@ -51,9 +51,6 @@ export class ReflectiveKey {
|
||||
static get numberOfKeys(): number { return _globalKeyRegistry.numberOfKeys; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export class KeyRegistry {
|
||||
private _allKeys = new Map<Object, ReflectiveKey>();
|
||||
|
||||
|
@ -313,8 +313,6 @@ function onLeave(zone: NgZonePrivate) {
|
||||
/**
|
||||
* Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
|
||||
* to framework to perform rendering.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export class NoopNgZone implements NgZone {
|
||||
readonly hasPendingMicrotasks: boolean = false;
|
||||
|
43
packages/core/test/BUILD.bazel
Normal file
43
packages/core/test/BUILD.bazel
Normal file
@ -0,0 +1,43 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
|
||||
|
||||
ts_library(
|
||||
name = "test_lib",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/animations/browser/testing",
|
||||
"//packages/common",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler/test",
|
||||
"//packages/compiler/testing",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/animations",
|
||||
"//packages/platform-browser/testing",
|
||||
"//packages/platform-server",
|
||||
"//packages/router",
|
||||
"//packages/router/testing",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
# TODO(mhevery): re-enable when passing
|
||||
jasmine_node_test(
|
||||
name = "test",
|
||||
srcs = [],
|
||||
bootstrap = [
|
||||
"zone.js/dist/zone-node.js",
|
||||
],
|
||||
tags = ["manual"],
|
||||
deps = [
|
||||
":test_lib",
|
||||
],
|
||||
)
|
@ -15,13 +15,13 @@ export function main() {
|
||||
|
||||
it('should return true for `done`',
|
||||
async(inject([ApplicationInitStatus], (status: ApplicationInitStatus) => {
|
||||
status.runInitializers();
|
||||
(status as any).runInitializers();
|
||||
expect(status.done).toBe(true);
|
||||
})));
|
||||
|
||||
it('should return a promise that resolves immediately for `donePromise`',
|
||||
async(inject([ApplicationInitStatus], (status: ApplicationInitStatus) => {
|
||||
status.runInitializers();
|
||||
(status as any).runInitializers();
|
||||
status.donePromise.then(() => { expect(status.done).toBe(true); });
|
||||
})));
|
||||
});
|
||||
@ -53,7 +53,7 @@ export function main() {
|
||||
|
||||
it('should update the status once all async initializers are done',
|
||||
async(inject([ApplicationInitStatus], (status: ApplicationInitStatus) => {
|
||||
status.runInitializers();
|
||||
(status as any).runInitializers();
|
||||
|
||||
setTimeout(() => {
|
||||
completerResolver = true;
|
||||
|
@ -52,7 +52,7 @@ export function main() {
|
||||
options = providersOrOptions || {};
|
||||
}
|
||||
const errorHandler = new ErrorHandler();
|
||||
errorHandler._console = mockConsole as any;
|
||||
(errorHandler as any)._console = mockConsole as any;
|
||||
|
||||
const platformModule = getDOM().supportsDOMEvents() ? BrowserModule : ServerModule;
|
||||
|
||||
|
@ -19,7 +19,7 @@ export function main() {
|
||||
function errorToString(error: any) {
|
||||
const logger = new MockConsole();
|
||||
const errorHandler = new ErrorHandler();
|
||||
errorHandler._console = logger as any;
|
||||
(errorHandler as any)._console = logger as any;
|
||||
errorHandler.handleError(error);
|
||||
return logger.res.map(line => line.join('#')).join('\n');
|
||||
}
|
||||
@ -62,7 +62,7 @@ ERROR CONTEXT#Context`);
|
||||
const err = new Error('test');
|
||||
const console = new MockConsole();
|
||||
const errorHandler = new ErrorHandler();
|
||||
errorHandler._console = console as any;
|
||||
(errorHandler as any)._console = console as any;
|
||||
const logger = jasmine.createSpy('logger');
|
||||
(err as any)[ERROR_LOGGER] = logger;
|
||||
|
||||
|
@ -409,7 +409,7 @@ function declareTestsUsingBootstrap() {
|
||||
|
||||
logger = new MockConsole();
|
||||
errorHandler = new ErrorHandler();
|
||||
errorHandler._console = logger as any;
|
||||
(errorHandler as any)._console = logger as any;
|
||||
}));
|
||||
|
||||
afterEach(() => { destroyPlatform(); });
|
||||
|
15
packages/core/testing/BUILD.bazel
Normal file
15
packages/core/testing/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/core/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
20
packages/http/BUILD.bazel
Normal file
20
packages/http/BUILD.bazel
Normal file
@ -0,0 +1,20 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "http",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/http",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
16
packages/http/testing/BUILD.bazel
Normal file
16
packages/http/testing/BUILD.bazel
Normal file
@ -0,0 +1,16 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/http/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/http",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
23
packages/platform-browser-dynamic/BUILD.bazel
Normal file
23
packages/platform-browser-dynamic/BUILD.bazel
Normal file
@ -0,0 +1,23 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "platform-browser-dynamic",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/platform-browser-dynamic",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/common",
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
],
|
||||
)
|
20
packages/platform-browser-dynamic/testing/BUILD.bazel
Normal file
20
packages/platform-browser-dynamic/testing/BUILD.bazel
Normal file
@ -0,0 +1,20 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/platform-browser-dynamic/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/compiler/testing",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/testing",
|
||||
],
|
||||
)
|
21
packages/platform-browser/BUILD.bazel
Normal file
21
packages/platform-browser/BUILD.bazel
Normal file
@ -0,0 +1,21 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "platform-browser",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/platform-browser",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
21
packages/platform-browser/animations/BUILD.bazel
Normal file
21
packages/platform-browser/animations/BUILD.bazel
Normal file
@ -0,0 +1,21 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "animations",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/platform-browser/animations",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
],
|
||||
)
|
16
packages/platform-browser/testing/BUILD.bazel
Normal file
16
packages/platform-browser/testing/BUILD.bazel
Normal file
@ -0,0 +1,16 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/platform-browser/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
27
packages/platform-server/BUILD.bazel
Normal file
27
packages/platform-server/BUILD.bazel
Normal file
@ -0,0 +1,27 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "platform-server",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/platform-server",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/animations/browser",
|
||||
"//packages/common",
|
||||
"//packages/common/http",
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/http",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/animations",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
17
packages/platform-server/testing/BUILD.bazel
Normal file
17
packages/platform-server/testing/BUILD.bazel
Normal file
@ -0,0 +1,17 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/platform-server/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/platform-browser-dynamic/testing",
|
||||
"//packages/platform-browser/animations",
|
||||
"//packages/platform-server",
|
||||
],
|
||||
)
|
22
packages/router/BUILD.bazel
Normal file
22
packages/router/BUILD.bazel
Normal file
@ -0,0 +1,22 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "router",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/router",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
"//packages/upgrade/static",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
17
packages/router/testing/BUILD.bazel
Normal file
17
packages/router/testing/BUILD.bazel
Normal file
@ -0,0 +1,17 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/router/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common",
|
||||
"//packages/common/testing",
|
||||
"//packages/core",
|
||||
"//packages/router",
|
||||
],
|
||||
)
|
20
packages/service-worker/BUILD.bazel
Normal file
20
packages/service-worker/BUILD.bazel
Normal file
@ -0,0 +1,20 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "service-worker",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/service-worker",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
21
packages/service-worker/worker/BUILD.bazel
Normal file
21
packages/service-worker/worker/BUILD.bazel
Normal file
@ -0,0 +1,21 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "worker",
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
exclude = ["main.ts"],
|
||||
),
|
||||
tsconfig = ":tsconfig.json",
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "main",
|
||||
srcs = ["main.ts"],
|
||||
deps = [":worker"],
|
||||
)
|
28
packages/service-worker/worker/test/BUILD.bazel
Normal file
28
packages/service-worker/worker/test/BUILD.bazel
Normal file
@ -0,0 +1,28 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
|
||||
|
||||
ts_library(
|
||||
name = "test_lib",
|
||||
testonly = 1,
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/service-worker/worker",
|
||||
"//packages/service-worker/worker/testing",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
name = "test",
|
||||
srcs = [],
|
||||
# TODO(alxhub): re-enable when need for main() is removed
|
||||
tags = ["manual"],
|
||||
deps = [
|
||||
":test_lib",
|
||||
],
|
||||
)
|
15
packages/service-worker/worker/testing/BUILD.bazel
Normal file
15
packages/service-worker/worker/testing/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/service-worker/worker",
|
||||
"@rxjs",
|
||||
],
|
||||
)
|
15
packages/upgrade/static/BUILD.bazel
Normal file
15
packages/upgrade/static/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "static",
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/upgrade/static",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
],
|
||||
)
|
Reference in New Issue
Block a user