diff --git a/BUILD.bazel b/BUILD.bazel
index f9f73b000c..86f2622049 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,3 +1,5 @@
+load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
+
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_nodejs//:defs.bzl", "node_modules_filegroup")
@@ -44,8 +46,6 @@ filegroup(
],
)
-load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
-
# A nodejs_binary for @angular/bazel/ngc-wrapped to use by default in
# ng_module that depends on @npm//@angular/bazel instead of the
# output of the //packages/bazel/src/ngc-wrapped ts_library rule. This
diff --git a/WORKSPACE b/WORKSPACE
index 2ace4e6428..a48369410e 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -41,7 +41,9 @@ Angular has a dependency on the @bazel/bazel package which supplies it.
Try running `yarn bazel` instead.
(If you did run that, check that you've got a fresh `yarn install`)
-""")
+""",
+ minimum_bazel_version = "0.21.0",
+)
# Setup the Node.js toolchain
node_repositories(
diff --git a/integration/bazel/src/BUILD.bazel b/integration/bazel/src/BUILD.bazel
index 1014cdd936..7ea70c2a09 100644
--- a/integration/bazel/src/BUILD.bazel
+++ b/integration/bazel/src/BUILD.bazel
@@ -5,6 +5,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "nodejs_binary", "ro
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
+package(default_visibility = ["//visibility:public"])
+
# Allow targets under sub-packages to reference the tsconfig.json file
exports_files(["tsconfig.json"])
diff --git a/integration/bazel/src/hello-world/BUILD.bazel b/integration/bazel/src/hello-world/BUILD.bazel
index e081522371..abadf03c1b 100644
--- a/integration/bazel/src/hello-world/BUILD.bazel
+++ b/integration/bazel/src/hello-world/BUILD.bazel
@@ -5,6 +5,8 @@ load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
load("@npm_angular_bazel//:index.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
sass_binary(
name = "hello-world-styles",
src = "hello-world.component.scss",
diff --git a/modules/benchmarks/src/BUILD.bazel b/modules/benchmarks/src/BUILD.bazel
index fd7fb9848a..6e3313d759 100644
--- a/modules/benchmarks/src/BUILD.bazel
+++ b/modules/benchmarks/src/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "util_lib",
srcs = ["util.ts"],
diff --git a/modules/benchmarks/src/largetable/BUILD.bazel b/modules/benchmarks/src/largetable/BUILD.bazel
index 85706c9c97..3b2888efd0 100644
--- a/modules/benchmarks/src/largetable/BUILD.bazel
+++ b/modules/benchmarks/src/largetable/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "util_lib",
srcs = ["util.ts"],
diff --git a/modules/benchmarks/src/largetable/render3/BUILD.bazel b/modules/benchmarks/src/largetable/render3/BUILD.bazel
index a4ae3675cb..306be43e2b 100644
--- a/modules/benchmarks/src/largetable/render3/BUILD.bazel
+++ b/modules/benchmarks/src/largetable/render3/BUILD.bazel
@@ -4,6 +4,8 @@ load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "largetable_lib",
srcs = glob(["**/*.ts"]),
diff --git a/modules/benchmarks/src/tree/BUILD.bazel b/modules/benchmarks/src/tree/BUILD.bazel
index 05d485954b..1941513d5c 100644
--- a/modules/benchmarks/src/tree/BUILD.bazel
+++ b/modules/benchmarks/src/tree/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "util_lib",
srcs = ["util.ts"],
diff --git a/modules/benchmarks/src/tree/render3/BUILD.bazel b/modules/benchmarks/src/tree/render3/BUILD.bazel
index 705018b0eb..b51b4d9656 100644
--- a/modules/benchmarks/src/tree/render3/BUILD.bazel
+++ b/modules/benchmarks/src/tree/render3/BUILD.bazel
@@ -4,6 +4,8 @@ load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "tree_lib",
srcs = glob(["**/*.ts"]),
diff --git a/modules/e2e_util/BUILD.bazel b/modules/e2e_util/BUILD.bazel
index 647b53205e..3dc9b959c9 100644
--- a/modules/e2e_util/BUILD.bazel
+++ b/modules/e2e_util/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "e2e_util",
testonly = 1,
diff --git a/package.json b/package.json
index 095e05c969..3f1d47db43 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
"url": "https://github.com/angular/angular.git"
},
"scripts": {
- "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name BUILD -or -name BUILD.bazel -or -name WORKSPACE \\) ! -path \"*/node_modules/*\" | xargs buildifier -v",
+ "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable",
"bazel:lint": "yarn bazel:format --lint=warn",
"bazel:lint-fix": "yarn bazel:format --lint=fix",
"preinstall": "node tools/yarn/check-yarn.js",
diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel
index 65ff743075..8c5112d4a5 100644
--- a/packages/BUILD.bazel
+++ b/packages/BUILD.bazel
@@ -1,3 +1,5 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = ["//visibility:public"])
exports_files([
diff --git a/packages/animations/BUILD.bazel b/packages/animations/BUILD.bazel
index a922e86aca..f1738a206a 100644
--- a/packages/animations/BUILD.bazel
+++ b/packages/animations/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "animations",
srcs = glob(
diff --git a/packages/animations/browser/BUILD.bazel b/packages/animations/browser/BUILD.bazel
index d2d9712be4..8e87cf98a7 100644
--- a/packages/animations/browser/BUILD.bazel
+++ b/packages/animations/browser/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "browser",
srcs = glob(
diff --git a/packages/animations/browser/testing/BUILD.bazel b/packages/animations/browser/testing/BUILD.bazel
index 22ccc1934f..e1adf2cf6d 100644
--- a/packages/animations/browser/testing/BUILD.bazel
+++ b/packages/animations/browser/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/bazel/index.bzl b/packages/bazel/index.bzl
index 2daee51d54..18b55abe3d 100644
--- a/packages/bazel/index.bzl
+++ b/packages/bazel/index.bzl
@@ -7,14 +7,14 @@
Users should not load files under "/src"
"""
-load("//packages/bazel/src:ng_module.bzl", _ng_module = "ng_module")
-load("//packages/bazel/src:ng_setup_workspace.bzl", _ng_setup_workspace = "ng_setup_workspace")
load("//packages/bazel/src/ng_package:ng_package.bzl", _ng_package = "ng_package")
load(
"//packages/bazel/src/protractor:protractor_web_test.bzl",
_protractor_web_test = "protractor_web_test",
_protractor_web_test_suite = "protractor_web_test_suite",
)
+load("//packages/bazel/src:ng_module.bzl", _ng_module = "ng_module")
+load("//packages/bazel/src:ng_setup_workspace.bzl", _ng_setup_workspace = "ng_setup_workspace")
ng_module = _ng_module
ng_package = _ng_package
diff --git a/packages/bazel/src/BUILD.bazel b/packages/bazel/src/BUILD.bazel
index 6f806fbfec..04767652e0 100644
--- a/packages/bazel/src/BUILD.bazel
+++ b/packages/bazel/src/BUILD.bazel
@@ -8,8 +8,6 @@ filegroup(
# For generating skydoc
exports_files(glob(["*.bzl"]))
-load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
-
nodejs_binary(
name = "rollup_with_build_optimizer",
data = [
diff --git a/packages/bazel/src/builders/BUILD.bazel b/packages/bazel/src/builders/BUILD.bazel
index 93134df6e1..175ce6d437 100644
--- a/packages/bazel/src/builders/BUILD.bazel
+++ b/packages/bazel/src/builders/BUILD.bazel
@@ -1,3 +1,5 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = ["//visibility:public"])
filegroup(
@@ -8,8 +10,6 @@ filegroup(
visibility = ["//packages/bazel:__subpackages__"],
)
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "builders",
srcs = [
diff --git a/packages/bazel/src/esm5.bzl b/packages/bazel/src/esm5.bzl
index 57d2157ca3..e0f3fd6ba9 100644
--- a/packages/bazel/src/esm5.bzl
+++ b/packages/bazel/src/esm5.bzl
@@ -170,6 +170,11 @@ esm5_outputs_aspect = aspect(
executable = True,
cfg = "host",
),
+ "_tsc_wrapped": attr.label(
+ default = Label("@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped"),
+ executable = True,
+ cfg = "host",
+ ),
},
)
diff --git a/packages/bazel/src/ng_module.bzl b/packages/bazel/src/ng_module.bzl
index 66d3538019..183a08fb75 100644
--- a/packages/bazel/src/ng_module.bzl
+++ b/packages/bazel/src/ng_module.bzl
@@ -244,6 +244,8 @@ def _expected_outs(ctx):
# TODO(alxhub): i18n is only produced by the legacy compiler currently. This should be re-enabled
# when ngtsc can extract messages
if is_legacy_ngc:
+ # TODO(manekinekko): due to bazelbuild/bazel#4858 we cannot fix the call to ctx.new_file(genfiles_dir)
+ # so the rule is turned off for now.
i18n_messages_files = [ctx.new_file(ctx.genfiles_dir, ctx.label.name + "_ngc_messages.xmb")]
else:
i18n_messages_files = []
@@ -268,9 +270,9 @@ def _ngc_tsconfig(ctx, files, srcs, **kwargs):
expected_outs = outs.closure_js
angular_compiler_options = {
- "enableResourceInlining": ctx.attr.inline_resources,
- "generateCodeForLibraries": False,
"allowEmptyCodegenFiles": True,
+ "enableIvy": _enable_ivy_value(ctx),
+ "enableResourceInlining": ctx.attr.inline_resources,
# Summaries are only enabled if Angular outputs are to be produced.
"enableSummariesForJit": is_legacy_ngc,
"enableIvy": _enable_ivy_value(ctx),
@@ -537,8 +539,8 @@ def ng_module_impl(ctx, ts_compile_actions):
if is_legacy_ngc:
providers["angular"] = {
- "summaries": outs.summaries,
"metadata": outs.metadata,
+ "summaries": outs.summaries,
}
providers["ngc_messages"] = outs.i18n_messages
@@ -568,13 +570,6 @@ local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect]
NG_MODULE_ATTRIBUTES = {
"srcs": attr.label_list(allow_files = [".ts"]),
-
- # Note: DEPS_ASPECTS is already a list, we add the cast to workaround
- # https://github.com/bazelbuild/skydoc/issues/21
- "deps": attr.label_list(
- doc = "Targets that are imported by this target",
- aspects = local_deps_aspects,
- ),
"assets": attr.label_list(
doc = ".html and .css files needed by the Angular compiler",
allow_files = [
@@ -583,14 +578,6 @@ NG_MODULE_ATTRIBUTES = {
".html",
],
),
- "factories": attr.label_list(
- allow_files = [".ts", ".html"],
- mandatory = False,
- ),
- "filter_summaries": attr.bool(default = False),
- "type_check": attr.bool(default = True),
- "inline_resources": attr.bool(default = True),
- "no_i18n": attr.bool(default = False),
"compiler": attr.label(
doc = """Sets a different ngc compiler binary to use for this library.
@@ -605,16 +592,40 @@ NG_MODULE_ATTRIBUTES = {
executable = True,
cfg = "host",
),
+ "factories": attr.label_list(
+ allow_files = [".ts", ".html"],
+ mandatory = False,
+ ),
+ "filter_summaries": attr.bool(default = False),
+ "inline_resources": attr.bool(default = True),
"ng_xi18n": attr.label(
default = Label(DEFAULT_NG_XI18N),
executable = True,
cfg = "host",
),
+ "no_i18n": attr.bool(default = False),
+ "type_check": attr.bool(default = True),
+
+ # Note: DEPS_ASPECTS is already a list, we add the cast to workaround
+ # https://github.com/bazelbuild/skydoc/issues/21
+ "deps": attr.label_list(
+ doc = "Targets that are imported by this target",
+ aspects = local_deps_aspects,
+ ),
"_supports_workers": attr.bool(default = True),
}
NG_MODULE_RULE_ATTRS = dict(dict(COMMON_ATTRIBUTES, **NG_MODULE_ATTRIBUTES), **{
- "tsconfig": attr.label(allow_files = True, single_file = True),
+ "entry_point": attr.string(),
+
+ # Default is %{name}_public_index
+ # The suffix points to the generated "bundle index" files that users import from
+ # The default is intended to avoid collisions with the users input files.
+ # Later packaging rules will point to these generated files as the entry point
+ # into the package.
+ # See the flatModuleOutFile documentation in
+ # https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/api.ts
+ "flat_module_out_file": attr.string(),
"node_modules": attr.label(
doc = """The npm packages which should be available during the compile.
diff --git a/packages/bazel/src/ng_package/BUILD.bazel b/packages/bazel/src/ng_package/BUILD.bazel
index 8cfc2cfab3..1fa7a41652 100644
--- a/packages/bazel/src/ng_package/BUILD.bazel
+++ b/packages/bazel/src/ng_package/BUILD.bazel
@@ -1,5 +1,3 @@
-package(default_visibility = ["//visibility:public"])
-
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
# BEGIN-DEV-ONLY
diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl
index c1b4c64492..3fff5ac467 100644
--- a/packages/bazel/src/ng_package/ng_package.bzl
+++ b/packages/bazel/src/ng_package/ng_package.bzl
@@ -16,6 +16,12 @@ specification of this format at https://goo.gl/jB3GVv
load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources")
load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo")
load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect")
+load(
+ "@build_bazel_rules_nodejs//:internal/npm_package/npm_package.bzl",
+ "NPM_PACKAGE_ATTRS",
+ "NPM_PACKAGE_OUTPUTS",
+ "create_package",
+)
load(
"@build_bazel_rules_nodejs//:internal/rollup/rollup_bundle.bzl",
"ROLLUP_ATTRS",
@@ -32,6 +38,7 @@ load(
load("//packages/bazel/src:external.bzl", "FLAT_DTS_FILE_SUFFIX")
load("//packages/bazel/src:esm5.bzl", "esm5_outputs_aspect", "esm5_root_dir", "flatten_esm5")
load("//packages/bazel/src/ng_package:collect-type-definitions.bzl", "collect_type_definitions")
+load("//packages/bazel/src:esm5.bzl", "esm5_outputs_aspect", "esm5_root_dir", "flatten_esm5")
_DEFAULT_NG_PACKAGER = "@npm//@angular/bazel/bin:packager"
@@ -336,8 +343,8 @@ def _ng_package_impl(ctx):
packager_inputs.extend([m.metadata_file])
metadata_arg[m.module_name] = {
"index": m.typings_file.path.replace(".d.ts", ".js"),
- "typings": m.typings_file.path,
"metadata": m.metadata_file.path,
+ "typings": m.typings_file.path,
}
packager_args.add(str(metadata_arg))
@@ -401,7 +408,6 @@ DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect]
NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
"srcs": attr.label_list(allow_files = True),
- "deps": attr.label_list(aspects = DEPS_ASPECTS),
"data": attr.label_list(
doc = "Additional, non-Angular files to be added to the package, e.g. global CSS assets.",
allow_files = True,
@@ -412,11 +418,15 @@ NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
"entry_point_name": attr.string(
doc = "Name to use when generating bundle files for the primary entry-point.",
),
+ "globals": attr.string_dict(default = {}),
+ "include_devmode_srcs": attr.bool(default = False),
"ng_packager": attr.label(
default = Label(_DEFAULT_NG_PACKAGER),
executable = True,
cfg = "host",
),
+ "readme_md": attr.label(allow_single_file = [".md"]),
+ "deps": attr.label_list(aspects = DEPS_ASPECTS),
"_rollup": attr.label(
default = Label("@build_bazel_rules_nodejs//internal/rollup"),
executable = True,
@@ -479,8 +489,8 @@ def ng_package_outputs(name, entry_point, entry_point_name):
basename = primary_entry_point_name(name, entry_point, entry_point_name)
outputs = {
- "fesm5": "fesm5/%s.js" % basename,
"fesm2015": "fesm2015/%s.js" % basename,
+ "fesm5": "fesm5/%s.js" % basename,
"umd": "%s.umd.js" % basename,
"umd_min": "%s.umd.min.js" % basename,
}
diff --git a/packages/bazel/src/ng_rollup_bundle.bzl b/packages/bazel/src/ng_rollup_bundle.bzl
index 0905ff49aa..d6992fc24e 100644
--- a/packages/bazel/src/ng_rollup_bundle.bzl
+++ b/packages/bazel/src/ng_rollup_bundle.bzl
@@ -91,7 +91,7 @@ def _run_tsc(ctx, input, output):
args.add(input)
args.add("--outFile", output)
- ctx.action(
+ ctx.actions.run(
executable = ctx.executable._tsc,
inputs = [input],
outputs = [output],
@@ -170,16 +170,16 @@ ng_rollup_bundle = rule(
Typically this will be `ts_library` or `ng_module` targets.""",
aspects = DEPS_ASPECTS,
),
- "_rollup": attr.label(
- executable = True,
- cfg = "host",
- default = Label("@angular//packages/bazel/src:rollup_with_build_optimizer"),
- ),
"_brotli": attr.label(
executable = True,
cfg = "host",
default = Label("@org_brotli//:brotli"),
),
+ "_rollup": attr.label(
+ executable = True,
+ cfg = "host",
+ default = Label("@angular//packages/bazel/src:rollup_with_build_optimizer"),
+ ),
}),
outputs = dict(ROLLUP_OUTPUTS, **{
"build_es5_min_compressed": "%{name}.min.js.br",
diff --git a/packages/bazel/src/protractor/protractor_web_test.bzl b/packages/bazel/src/protractor/protractor_web_test.bzl
index eb2fc06914..aaf06f0f09 100644
--- a/packages/bazel/src/protractor/protractor_web_test.bzl
+++ b/packages/bazel/src/protractor/protractor_web_test.bzl
@@ -62,9 +62,9 @@ def _protractor_web_test_impl(ctx):
substitutions = {
"TMPL_config": expand_path_into_runfiles(ctx, configuration_file.short_path) if configuration_file else "",
"TMPL_on_prepare": expand_path_into_runfiles(ctx, on_prepare_file.short_path) if on_prepare_file else "",
- "TMPL_workspace": ctx.workspace_name,
"TMPL_server": ctx.executable.server.short_path if ctx.executable.server else "",
"TMPL_specs": "\n".join([" '%s'," % e for e in specs]),
+ "TMPL_workspace": ctx.workspace_name,
},
)
@@ -121,14 +121,17 @@ _protractor_web_test = rule(
test = True,
executable = True,
attrs = {
+ "srcs": attr.label_list(
+ doc = "A list of JavaScript test files",
+ allow_files = [".js"],
+ ),
"configuration": attr.label(
doc = "Protractor configuration file",
allow_single_file = True,
aspects = [sources_aspect],
),
- "srcs": attr.label_list(
- doc = "A list of JavaScript test files",
- allow_files = [".js"],
+ "data": attr.label_list(
+ doc = "Runtime dependencies",
),
"on_prepare": attr.label(
doc = """A file with a node.js script to run once before all tests run.
@@ -137,27 +140,22 @@ _protractor_web_test = rule(
allow_single_file = True,
aspects = [sources_aspect],
),
- "deps": attr.label_list(
- doc = "Other targets which produce JavaScript such as `ts_library`",
+ "protractor": attr.label(
+ doc = "Protractor executable target (set by protractor_web_test macro)",
+ executable = True,
+ cfg = "target",
allow_files = True,
- aspects = [sources_aspect],
- ),
- "data": attr.label_list(
- doc = "Runtime dependencies",
),
"server": attr.label(
doc = "Optional server executable target",
executable = True,
cfg = "target",
- single_file = False,
allow_files = True,
),
- "protractor": attr.label(
- doc = "Protractor executable target (set by protractor_web_test macro)",
- executable = True,
- cfg = "target",
- single_file = False,
+ "deps": attr.label_list(
+ doc = "Other targets which produce JavaScript such as `ts_library`",
allow_files = True,
+ aspects = [sources_aspect],
),
"_conf_tmpl": attr.label(
default = Label(_CONF_TMPL),
diff --git a/packages/bazel/src/protractor/utils/BUILD.bazel b/packages/bazel/src/protractor/utils/BUILD.bazel
index fd461d9610..0035bfa749 100644
--- a/packages/bazel/src/protractor/utils/BUILD.bazel
+++ b/packages/bazel/src/protractor/utils/BUILD.bazel
@@ -2,6 +2,8 @@ package(default_visibility = ["//visibility:public"])
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "utils",
srcs = ["index.ts"],
diff --git a/packages/bazel/src/schematics/BUILD.bazel b/packages/bazel/src/schematics/BUILD.bazel
index fe90035725..16e9cf968e 100644
--- a/packages/bazel/src/schematics/BUILD.bazel
+++ b/packages/bazel/src/schematics/BUILD.bazel
@@ -1,3 +1,5 @@
+load("//tools:defaults.bzl", "jasmine_node_test")
+
package(default_visibility = ["//visibility:public"])
filegroup(
@@ -8,8 +10,6 @@ filegroup(
visibility = ["//packages/bazel:__subpackages__"],
)
-load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
-
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
diff --git a/packages/bazel/src/schematics/bazel-workspace/BUILD.bazel b/packages/bazel/src/schematics/bazel-workspace/BUILD.bazel
index 26f75310f5..44945a27e8 100644
--- a/packages/bazel/src/schematics/bazel-workspace/BUILD.bazel
+++ b/packages/bazel/src/schematics/bazel-workspace/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "bazel-workspace",
srcs = [
diff --git a/packages/bazel/src/schematics/ng-new/BUILD.bazel b/packages/bazel/src/schematics/ng-new/BUILD.bazel
index 6227329322..45a103934b 100644
--- a/packages/bazel/src/schematics/ng-new/BUILD.bazel
+++ b/packages/bazel/src/schematics/ng-new/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "ng-new",
srcs = [
diff --git a/packages/bazel/test/ng_package/example/BUILD.bazel b/packages/bazel/test/ng_package/example/BUILD.bazel
index 6bf8a00242..3e5733ae7b 100644
--- a/packages/bazel/test/ng_package/example/BUILD.bazel
+++ b/packages/bazel/test/ng_package/example/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//packages/bazel/test:__subpackages__"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package", "npm_package")
+package(default_visibility = ["//packages/bazel/test:__subpackages__"])
+
ng_module(
name = "example",
srcs = glob(["*.ts"]),
diff --git a/packages/bazel/test/ng_package/example/secondary/BUILD.bazel b/packages/bazel/test/ng_package/example/secondary/BUILD.bazel
index e223cd26f2..f66a3af590 100644
--- a/packages/bazel/test/ng_package/example/secondary/BUILD.bazel
+++ b/packages/bazel/test/ng_package/example/secondary/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//packages/bazel/test:__subpackages__"])
-
load("//tools:defaults.bzl", "ng_module")
+package(default_visibility = ["//packages/bazel/test:__subpackages__"])
+
ng_module(
name = "secondary",
srcs = glob(["*.ts"]),
diff --git a/packages/benchpress/BUILD.bazel b/packages/benchpress/BUILD.bazel
index 188f8910de..b418569d6e 100644
--- a/packages/benchpress/BUILD.bazel
+++ b/packages/benchpress/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "npm_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "benchpress",
srcs = glob(
diff --git a/packages/common/BUILD.bazel b/packages/common/BUILD.bazel
index ebdd72f73c..7e429d92ec 100644
--- a/packages/common/BUILD.bazel
+++ b/packages/common/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "common",
srcs = glob(
diff --git a/packages/common/http/BUILD.bazel b/packages/common/http/BUILD.bazel
index 7fb75cfbd8..120fb214f5 100644
--- a/packages/common/http/BUILD.bazel
+++ b/packages/common/http/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "http",
srcs = glob(
diff --git a/packages/common/http/testing/BUILD.bazel b/packages/common/http/testing/BUILD.bazel
index 2679e45ed3..74fab73105 100644
--- a/packages/common/http/testing/BUILD.bazel
+++ b/packages/common/http/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(
diff --git a/packages/common/locales/BUILD.bazel b/packages/common/locales/BUILD.bazel
index 1ab81ae5b1..3a36a04ad9 100644
--- a/packages/common/locales/BUILD.bazel
+++ b/packages/common/locales/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "npm_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "locales",
srcs = glob(
@@ -14,6 +14,10 @@ npm_package(
name = "package",
srcs = ["package.json"],
replacements = {
+
+ # Workaround for `.d.ts`` containing `/// `
+ # which are generated in TypeScript v2.9, but not before.
+ "/// ": "",
# Workaround for https://github.com/angular/angular/issues/23217
# Webpack will detect that the UMD outputs from TypeScript pass the
# `require` function into the module, and cannot accurately track
@@ -21,10 +25,6 @@ npm_package(
# We don't actually import anything in the locale code so we can
# null out the require reference passed into the module.
"factory\(require, exports\)": "factory(null, exports)",
-
- # Workaround for `.d.ts`` containing `/// `
- # which are generated in TypeScript v2.9, but not before.
- "/// ": "",
},
deps = [":locales"],
)
diff --git a/packages/common/testing/BUILD.bazel b/packages/common/testing/BUILD.bazel
index c5028e1b31..9addcc00c3 100644
--- a/packages/common/testing/BUILD.bazel
+++ b/packages/common/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/compiler-cli/BUILD.bazel b/packages/compiler-cli/BUILD.bazel
index 65550129bb..9ce5738d5e 100644
--- a/packages/compiler-cli/BUILD.bazel
+++ b/packages/compiler-cli/BUILD.bazel
@@ -3,6 +3,8 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "npm_package", "ts_library")
load("@npm_bazel_typescript//:defs.bzl", "ts_config")
+package(default_visibility = ["//visibility:public"])
+
ts_config(
name = "tsconfig",
src = "tsconfig-build.json",
diff --git a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/BUILD.bazel
index 489eeba8c2..524b44082a 100644
--- a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/BUILD.bazel
@@ -1,6 +1,6 @@
-package(default_visibility = ["//visibility:public"])
+load("//tools:defaults.bzl", "ng_module")
-load("//tools:defaults.bzl", "ng_module", "ts_library")
+package(default_visibility = ["//visibility:public"])
ng_module(
name = "app",
diff --git a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel
index d4c43d3479..6999d6c26a 100644
--- a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/integrationtest/bazel/injectable_def/lib1/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injectable_def/lib1/BUILD.bazel
index 1541ba9e83..efa1d38972 100644
--- a/packages/compiler-cli/integrationtest/bazel/injectable_def/lib1/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injectable_def/lib1/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "lib1",
srcs = glob(
diff --git a/packages/compiler-cli/integrationtest/bazel/injectable_def/lib2/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injectable_def/lib2/BUILD.bazel
index aee1ff6d32..e29a00e29c 100644
--- a/packages/compiler-cli/integrationtest/bazel/injectable_def/lib2/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injectable_def/lib2/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "lib2",
srcs = glob(
diff --git a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/BUILD.bazel
index a603a75afb..bd8a754c72 100644
--- a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/BUILD.bazel
@@ -1,7 +1,6 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module")
-load("//packages/bazel/src:ng_rollup_bundle.bzl", "ng_rollup_bundle")
+
+package(default_visibility = ["//visibility:public"])
ng_module(
name = "app",
diff --git a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel
index 6cb9248d7e..ab1ed5eb0b 100644
--- a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/integrationtest/bazel/ng_module/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/ng_module/BUILD.bazel
index b65c58d7ce..e42d728325 100644
--- a/packages/compiler-cli/integrationtest/bazel/ng_module/BUILD.bazel
+++ b/packages/compiler-cli/integrationtest/bazel/ng_module/BUILD.bazel
@@ -1,4 +1,6 @@
load("//packages/bazel:index.bzl", "ng_module")
+load("//tools:defaults.bzl", "jasmine_node_test")
+load(":extract_flat_module_index.bzl", "extract_flat_module_index")
ng_module(
name = "test_module",
@@ -21,16 +23,12 @@ ng_module(
],
)
-load(":extract_flat_module_index.bzl", "extract_flat_module_index")
-
extract_flat_module_index(
name = "flat_module_index",
testonly = True,
deps = [":test_module"],
)
-load("//tools:defaults.bzl", "jasmine_node_test")
-
jasmine_node_test(
name = "test",
srcs = ["spec.js"],
diff --git a/packages/compiler-cli/src/ngcc/BUILD.bazel b/packages/compiler-cli/src/ngcc/BUILD.bazel
index 54b7ed1a8e..271f47f2de 100644
--- a/packages/compiler-cli/src/ngcc/BUILD.bazel
+++ b/packages/compiler-cli/src/ngcc/BUILD.bazel
@@ -1,6 +1,6 @@
-package(default_visibility = ["//visibility:public"])
+load("//tools:defaults.bzl", "ts_library")
-load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
ts_library(
name = "ngcc",
diff --git a/packages/compiler-cli/src/ngcc/test/BUILD.bazel b/packages/compiler-cli/src/ngcc/test/BUILD.bazel
index f1b6941b95..f2e51149d1 100644
--- a/packages/compiler-cli/src/ngcc/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngcc/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/annotations/BUILD.bazel b/packages/compiler-cli/src/ngtsc/annotations/BUILD.bazel
index a9e04b3cdc..ea3eb2f159 100644
--- a/packages/compiler-cli/src/ngtsc/annotations/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/annotations/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "annotations",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel
index cf13057e6a..e6da783313 100644
--- a/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel b/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel
index 2b0efabac8..965c7ae178 100644
--- a/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "diagnostics",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/entry_point/BUILD.bazel b/packages/compiler-cli/src/ngtsc/entry_point/BUILD.bazel
index c0c7c991bf..77c0d8fc55 100644
--- a/packages/compiler-cli/src/ngtsc/entry_point/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/entry_point/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "entry_point",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
module_name = "@angular/compiler-cli/src/ngtsc/entry_point",
diff --git a/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel
index e149fa0f33..cb761a55da 100644
--- a/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/imports/BUILD.bazel b/packages/compiler-cli/src/ngtsc/imports/BUILD.bazel
index 6f8cb487a9..07db415e02 100644
--- a/packages/compiler-cli/src/ngtsc/imports/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/imports/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "imports",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/partial_evaluator/BUILD.bazel b/packages/compiler-cli/src/ngtsc/partial_evaluator/BUILD.bazel
index 95c2478682..02979fd2da 100644
--- a/packages/compiler-cli/src/ngtsc/partial_evaluator/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/partial_evaluator/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "partial_evaluator",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/*.ts",
]),
module_name = "@angular/compiler-cli/src/ngtsc/partial_evaluator",
diff --git a/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel
index c79c44c2cb..d4caa3a9ed 100644
--- a/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/reflection/BUILD.bazel b/packages/compiler-cli/src/ngtsc/reflection/BUILD.bazel
index 6047781396..591bba9075 100644
--- a/packages/compiler-cli/src/ngtsc/reflection/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/reflection/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "reflection",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = ["@ngdeps//typescript"],
diff --git a/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel
index c9301bc16d..55e21e18e8 100644
--- a/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel b/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel
index 7f8e78488e..f25ef3e838 100644
--- a/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "shims",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel
index 505ca31152..381f9cdd88 100644
--- a/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/switch/BUILD.bazel b/packages/compiler-cli/src/ngtsc/switch/BUILD.bazel
index e5f9ad5d80..cb758ef2bb 100644
--- a/packages/compiler-cli/src/ngtsc/switch/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/switch/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "switch",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel b/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel
index db42c39981..7509f42d95 100644
--- a/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "testing",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/transform/BUILD.bazel b/packages/compiler-cli/src/ngtsc/transform/BUILD.bazel
index e438e91560..d3a6fe38da 100644
--- a/packages/compiler-cli/src/ngtsc/transform/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/transform/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "transform",
- srcs = glob([
- "index.ts",
+ srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/translator/BUILD.bazel b/packages/compiler-cli/src/ngtsc/translator/BUILD.bazel
index df6dd0884f..5da5a9dcac 100644
--- a/packages/compiler-cli/src/ngtsc/translator/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/translator/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "translator",
srcs = glob(["**/*.ts"]),
diff --git a/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel b/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel
index f76e8d5b0a..12725051a4 100644
--- a/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "typecheck",
srcs = glob(["**/*.ts"]),
diff --git a/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel
index 233796c5ff..cc73dee179 100644
--- a/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/src/ngtsc/util/BUILD.bazel b/packages/compiler-cli/src/ngtsc/util/BUILD.bazel
index 4f385af484..2ae5def318 100644
--- a/packages/compiler-cli/src/ngtsc/util/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/util/BUILD.bazel
@@ -1,11 +1,10 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "util",
srcs = glob([
- "index.ts",
"src/**/*.ts",
]),
deps = [
diff --git a/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel
index 88ddde2ad7..0aaa4f777c 100644
--- a/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel
+++ b/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel b/packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel
index b8af5238a3..e15812685b 100644
--- a/packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel
+++ b/packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "fake_core",
srcs = [
diff --git a/packages/compiler/BUILD.bazel b/packages/compiler/BUILD.bazel
index a2d2e78bc4..717982e2ea 100644
--- a/packages/compiler/BUILD.bazel
+++ b/packages/compiler/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "compiler",
srcs = glob(
diff --git a/packages/compiler/testing/BUILD.bazel b/packages/compiler/testing/BUILD.bazel
index f47ee11d51..188ec1260c 100644
--- a/packages/compiler/testing/BUILD.bazel
+++ b/packages/compiler/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(
diff --git a/packages/core/BUILD.bazel b/packages/core/BUILD.bazel
index bacfc259d3..193bdf0cf5 100644
--- a/packages/core/BUILD.bazel
+++ b/packages/core/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "core",
srcs = glob(
diff --git a/packages/core/src/compiler/BUILD.bazel b/packages/core/src/compiler/BUILD.bazel
index eabb68ecff..457eb5db78 100644
--- a/packages/core/src/compiler/BUILD.bazel
+++ b/packages/core/src/compiler/BUILD.bazel
@@ -1,11 +1,11 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = [
"//packages/compiler/test:__pkg__",
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "compiler",
srcs = glob(
diff --git a/packages/core/src/di/interface/BUILD.bazel b/packages/core/src/di/interface/BUILD.bazel
index 11b110996f..c27b5da5f0 100644
--- a/packages/core/src/di/interface/BUILD.bazel
+++ b/packages/core/src/di/interface/BUILD.bazel
@@ -1,10 +1,10 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = [
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "interface",
srcs = glob(
diff --git a/packages/core/src/interface/BUILD.bazel b/packages/core/src/interface/BUILD.bazel
index 57391b768e..8f38896a4d 100644
--- a/packages/core/src/interface/BUILD.bazel
+++ b/packages/core/src/interface/BUILD.bazel
@@ -1,10 +1,10 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = [
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "interface",
srcs = glob(
diff --git a/packages/core/src/reflection/BUILD.bazel b/packages/core/src/reflection/BUILD.bazel
index 73d9f570cd..baeae5551a 100644
--- a/packages/core/src/reflection/BUILD.bazel
+++ b/packages/core/src/reflection/BUILD.bazel
@@ -1,10 +1,10 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = [
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "reflection",
srcs = glob(
diff --git a/packages/core/src/util/BUILD.bazel b/packages/core/src/util/BUILD.bazel
index 7cf01e30b2..f1752340de 100644
--- a/packages/core/src/util/BUILD.bazel
+++ b/packages/core/src/util/BUILD.bazel
@@ -1,10 +1,10 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = [
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "util",
srcs = glob(
diff --git a/packages/core/test/BUILD.bazel b/packages/core/test/BUILD.bazel
index face8ab22b..c14aad99c1 100644
--- a/packages/core/test/BUILD.bazel
+++ b/packages/core/test/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "test_lib",
testonly = True,
diff --git a/packages/core/test/bundling/animation_world/BUILD.bazel b/packages/core/test/bundling/animation_world/BUILD.bazel
index c16b41d6b1..42dc72553b 100644
--- a/packages/core/test/bundling/animation_world/BUILD.bazel
+++ b/packages/core/test/bundling/animation_world/BUILD.bazel
@@ -3,6 +3,8 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "animation_world",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/hello_world/BUILD.bazel b/packages/core/test/bundling/hello_world/BUILD.bazel
index 4a48c199b4..36cb746bb3 100644
--- a/packages/core/test/bundling/hello_world/BUILD.bazel
+++ b/packages/core/test/bundling/hello_world/BUILD.bazel
@@ -4,6 +4,8 @@ load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "hello_world",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/hello_world_i18n/BUILD.bazel b/packages/core/test/bundling/hello_world_i18n/BUILD.bazel
index f19fdffa30..489410577d 100644
--- a/packages/core/test/bundling/hello_world_i18n/BUILD.bazel
+++ b/packages/core/test/bundling/hello_world_i18n/BUILD.bazel
@@ -3,6 +3,8 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "hello_world_i18n",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/hello_world_r2/BUILD.bazel b/packages/core/test/bundling/hello_world_r2/BUILD.bazel
index 1601c9b57b..9d1d446a2d 100644
--- a/packages/core/test/bundling/hello_world_r2/BUILD.bazel
+++ b/packages/core/test/bundling/hello_world_r2/BUILD.bazel
@@ -3,6 +3,8 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "hello_world",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/injection/BUILD.bazel b/packages/core/test/bundling/injection/BUILD.bazel
index 170bf48536..8caa0a1f01 100644
--- a/packages/core/test/bundling/injection/BUILD.bazel
+++ b/packages/core/test/bundling/injection/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
-load("//tools:defaults.bzl", "jasmine_node_test", "ng_rollup_bundle", "ts_library")
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
+load("//tools:defaults.bzl", "jasmine_node_test", "ng_rollup_bundle", "ts_library")
+
+package(default_visibility = ["//visibility:public"])
ts_library(
name = "injection",
diff --git a/packages/core/test/bundling/todo/BUILD.bazel b/packages/core/test/bundling/todo/BUILD.bazel
index eb60ff4618..0d6cbbf46c 100644
--- a/packages/core/test/bundling/todo/BUILD.bazel
+++ b/packages/core/test/bundling/todo/BUILD.bazel
@@ -5,6 +5,8 @@ load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "todo",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/todo_i18n/BUILD.bazel b/packages/core/test/bundling/todo_i18n/BUILD.bazel
index 94da2d7409..cb61d0b738 100644
--- a/packages/core/test/bundling/todo_i18n/BUILD.bazel
+++ b/packages/core/test/bundling/todo_i18n/BUILD.bazel
@@ -4,6 +4,8 @@ load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "todo_i18n",
srcs = [
diff --git a/packages/core/test/bundling/todo_r2/BUILD.bazel b/packages/core/test/bundling/todo_r2/BUILD.bazel
index 3eeed75691..6ce564bc0b 100644
--- a/packages/core/test/bundling/todo_r2/BUILD.bazel
+++ b/packages/core/test/bundling/todo_r2/BUILD.bazel
@@ -4,6 +4,8 @@ load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "todo",
srcs = ["index.ts"],
diff --git a/packages/core/test/bundling/util/BUILD.bazel b/packages/core/test/bundling/util/BUILD.bazel
index 185c23677b..c596830d96 100644
--- a/packages/core/test/bundling/util/BUILD.bazel
+++ b/packages/core/test/bundling/util/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
# Either loads reflect-metadata or is a no-op, depending on whether compilation is in JIT mode.
ts_library(
name = "reflect_metadata",
diff --git a/packages/core/test/render3/BUILD.bazel b/packages/core/test/render3/BUILD.bazel
index c2ad02cac1..0cd5a39ce6 100644
--- a/packages/core/test/render3/BUILD.bazel
+++ b/packages/core/test/render3/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "render3_lib",
testonly = True,
diff --git a/packages/core/test/render3/ivy/BUILD.bazel b/packages/core/test/render3/ivy/BUILD.bazel
index efd2b58d8e..39e0a8ce87 100644
--- a/packages/core/test/render3/ivy/BUILD.bazel
+++ b/packages/core/test/render3/ivy/BUILD.bazel
@@ -1,6 +1,6 @@
-package(default_visibility = ["//visibility:public"])
+load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
-load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+package(default_visibility = ["//visibility:public"])
ts_library(
name = "ivy_lib",
diff --git a/packages/core/test/view/BUILD.bazel b/packages/core/test/view/BUILD.bazel
index e4b7fb7200..306a050734 100644
--- a/packages/core/test/view/BUILD.bazel
+++ b/packages/core/test/view/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "view_lib",
testonly = True,
diff --git a/packages/core/testing/BUILD.bazel b/packages/core/testing/BUILD.bazel
index 8e20a93e78..774fd2ad42 100644
--- a/packages/core/testing/BUILD.bazel
+++ b/packages/core/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(
diff --git a/packages/elements/BUILD.bazel b/packages/elements/BUILD.bazel
index f53290fb5a..30ab2b5ab3 100644
--- a/packages/elements/BUILD.bazel
+++ b/packages/elements/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "elements",
srcs = glob(
diff --git a/packages/elements/schematics/BUILD.bazel b/packages/elements/schematics/BUILD.bazel
index 3a3c20fa78..f3d17d4571 100644
--- a/packages/elements/schematics/BUILD.bazel
+++ b/packages/elements/schematics/BUILD.bazel
@@ -1,6 +1,6 @@
-package(default_visibility = ["//visibility:public"])
+load("//tools:defaults.bzl", "npm_package")
-load("//tools:defaults.bzl", "npm_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
exports_files([
"package.json",
diff --git a/packages/elements/schematics/ng-add/BUILD.bazel b/packages/elements/schematics/ng-add/BUILD.bazel
index 5c1703fe3b..c7825948bd 100644
--- a/packages/elements/schematics/ng-add/BUILD.bazel
+++ b/packages/elements/schematics/ng-add/BUILD.bazel
@@ -1,15 +1,14 @@
-package(default_visibility = ["//visibility:public"])
+load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
-load("//tools:defaults.bzl", "jasmine_node_test", "npm_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
ts_library(
name = "ng-add",
- srcs = glob(
+ srcs =
[
"index.ts",
"schema.ts",
],
- ),
deps = [
"//packages/common",
"//packages/core",
@@ -21,11 +20,9 @@ ts_library(
ts_library(
name = "test_lib",
testonly = True,
- srcs = glob(
- [
- "index_spec.ts",
- ],
- ),
+ srcs = [
+ "index_spec.ts",
+ ],
deps = [
":ng-add",
"//packages/common",
diff --git a/packages/elements/test/BUILD.bazel b/packages/elements/test/BUILD.bazel
index 06549ecf4a..71bea73873 100644
--- a/packages/elements/test/BUILD.bazel
+++ b/packages/elements/test/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
ts_library(
name = "test_lib",
diff --git a/packages/forms/BUILD.bazel b/packages/forms/BUILD.bazel
index f5f87572fe..ec38d66fd6 100644
--- a/packages/forms/BUILD.bazel
+++ b/packages/forms/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "forms",
srcs = glob(
diff --git a/packages/http/BUILD.bazel b/packages/http/BUILD.bazel
index 13559eb7d8..b43f975831 100644
--- a/packages/http/BUILD.bazel
+++ b/packages/http/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "http",
srcs = glob(
diff --git a/packages/http/testing/BUILD.bazel b/packages/http/testing/BUILD.bazel
index cc00a93b2e..b2cfc00ea5 100644
--- a/packages/http/testing/BUILD.bazel
+++ b/packages/http/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/language-service/BUILD.bazel b/packages/language-service/BUILD.bazel
index 4454b2a11c..e1c9a382c9 100644
--- a/packages/language-service/BUILD.bazel
+++ b/packages/language-service/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "npm_package", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "language-service",
srcs = glob(
diff --git a/packages/language-service/bundles/BUILD.bazel b/packages/language-service/bundles/BUILD.bazel
index edc67cde63..951be9ef5e 100644
--- a/packages/language-service/bundles/BUILD.bazel
+++ b/packages/language-service/bundles/BUILD.bazel
@@ -4,9 +4,9 @@ ls_rollup_bundle(
name = "language-service",
entry_point = "packages/language-service/index.js",
globals = {
- "typescript": "ts",
- "path": "path",
"fs": "fs",
+ "path": "path",
+ "typescript": "ts",
},
license_banner = "banner.js.txt",
visibility = ["//packages/language-service:__pkg__"],
diff --git a/packages/platform-browser-dynamic/BUILD.bazel b/packages/platform-browser-dynamic/BUILD.bazel
index be5a391d27..644680e019 100644
--- a/packages/platform-browser-dynamic/BUILD.bazel
+++ b/packages/platform-browser-dynamic/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
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 860821fe91..b832166efa 100644
--- a/packages/platform-browser-dynamic/testing/BUILD.bazel
+++ b/packages/platform-browser-dynamic/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/platform-browser/BUILD.bazel b/packages/platform-browser/BUILD.bazel
index 1be13db7f1..35ceb82f5f 100644
--- a/packages/platform-browser/BUILD.bazel
+++ b/packages/platform-browser/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "platform-browser",
srcs = glob(
diff --git a/packages/platform-browser/animations/BUILD.bazel b/packages/platform-browser/animations/BUILD.bazel
index 95208ba8dd..f806e76519 100644
--- a/packages/platform-browser/animations/BUILD.bazel
+++ b/packages/platform-browser/animations/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "animations",
srcs = glob(
diff --git a/packages/platform-browser/testing/BUILD.bazel b/packages/platform-browser/testing/BUILD.bazel
index 650c7e35e9..85ebed9b67 100644
--- a/packages/platform-browser/testing/BUILD.bazel
+++ b/packages/platform-browser/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/platform-server/BUILD.bazel b/packages/platform-server/BUILD.bazel
index f8b77b017f..b94304cc54 100644
--- a/packages/platform-server/BUILD.bazel
+++ b/packages/platform-server/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "platform-server",
srcs = glob(
diff --git a/packages/platform-server/testing/BUILD.bazel b/packages/platform-server/testing/BUILD.bazel
index 45a2ce183b..66ea22d96e 100644
--- a/packages/platform-server/testing/BUILD.bazel
+++ b/packages/platform-server/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/platform-webworker-dynamic/BUILD.bazel b/packages/platform-webworker-dynamic/BUILD.bazel
index f43e4269a7..fec50fa318 100644
--- a/packages/platform-webworker-dynamic/BUILD.bazel
+++ b/packages/platform-webworker-dynamic/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "platform-webworker-dynamic",
srcs = glob(
diff --git a/packages/platform-webworker/BUILD.bazel b/packages/platform-webworker/BUILD.bazel
index f162b993b6..d3a1057105 100644
--- a/packages/platform-webworker/BUILD.bazel
+++ b/packages/platform-webworker/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "platform-webworker",
srcs = glob(
diff --git a/packages/private/testing/BUILD.bazel b/packages/private/testing/BUILD.bazel
index 90299288c5..9981322971 100644
--- a/packages/private/testing/BUILD.bazel
+++ b/packages/private/testing/BUILD.bazel
@@ -5,8 +5,6 @@ package(default_visibility = [
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
testonly = True,
diff --git a/packages/router/BUILD.bazel b/packages/router/BUILD.bazel
index d6c244852f..97e0c52a3c 100644
--- a/packages/router/BUILD.bazel
+++ b/packages/router/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "router",
srcs = glob(
diff --git a/packages/router/test/aot_ngsummary_test/BUILD.bazel b/packages/router/test/aot_ngsummary_test/BUILD.bazel
index 65d4c197cc..5a4b60bf49 100644
--- a/packages/router/test/aot_ngsummary_test/BUILD.bazel
+++ b/packages/router/test/aot_ngsummary_test/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ts_library", "ts_web_test_suite")
+load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ts_library")
ng_module(
name = "aot_routing_module",
diff --git a/packages/router/testing/BUILD.bazel b/packages/router/testing/BUILD.bazel
index cc75d95dcb..5061eeeec6 100644
--- a/packages/router/testing/BUILD.bazel
+++ b/packages/router/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "testing",
srcs = glob(["**/*.ts"]),
diff --git a/packages/router/upgrade/BUILD.bazel b/packages/router/upgrade/BUILD.bazel
index eb0452285d..9004665b68 100644
--- a/packages/router/upgrade/BUILD.bazel
+++ b/packages/router/upgrade/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "upgrade",
srcs = glob(
diff --git a/packages/service-worker/BUILD.bazel b/packages/service-worker/BUILD.bazel
index 5f46c64007..7eb0955228 100644
--- a/packages/service-worker/BUILD.bazel
+++ b/packages/service-worker/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "service-worker",
srcs = glob(
diff --git a/packages/service-worker/cli/BUILD.bazel b/packages/service-worker/cli/BUILD.bazel
index 97d0adb3d0..ce2c48bee4 100644
--- a/packages/service-worker/cli/BUILD.bazel
+++ b/packages/service-worker/cli/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_rollup_bundle", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "cli",
srcs = glob(
diff --git a/packages/service-worker/config/BUILD.bazel b/packages/service-worker/config/BUILD.bazel
index 2b052804ee..638a39301a 100644
--- a/packages/service-worker/config/BUILD.bazel
+++ b/packages/service-worker/config/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "config",
srcs = glob([
diff --git a/packages/service-worker/config/testing/BUILD.bazel b/packages/service-worker/config/testing/BUILD.bazel
index e1498fd1e4..3c1ba46fdc 100644
--- a/packages/service-worker/config/testing/BUILD.bazel
+++ b/packages/service-worker/config/testing/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ts_library")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ts_library")
-
ts_library(
name = "testing",
srcs = glob([
diff --git a/packages/service-worker/testing/BUILD.bazel b/packages/service-worker/testing/BUILD.bazel
index 3878b16b95..25b06c37e3 100644
--- a/packages/service-worker/testing/BUILD.bazel
+++ b/packages/service-worker/testing/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "testing",
testonly = True,
diff --git a/packages/service-worker/worker/BUILD.bazel b/packages/service-worker/worker/BUILD.bazel
index 84fe858dca..c4ec4e90c6 100644
--- a/packages/service-worker/worker/BUILD.bazel
+++ b/packages/service-worker/worker/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_rollup_bundle", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "worker",
srcs = glob(
diff --git a/packages/service-worker/worker/testing/BUILD.bazel b/packages/service-worker/worker/testing/BUILD.bazel
index a593be6cb1..1c98b537da 100644
--- a/packages/service-worker/worker/testing/BUILD.bazel
+++ b/packages/service-worker/worker/testing/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "testing",
testonly = True,
diff --git a/packages/upgrade/BUILD.bazel b/packages/upgrade/BUILD.bazel
index 12be6dcffa..af9f35723a 100644
--- a/packages/upgrade/BUILD.bazel
+++ b/packages/upgrade/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ng_module", "ng_package")
+package(default_visibility = ["//visibility:public"])
+
ng_module(
name = "upgrade",
srcs = glob(
diff --git a/packages/upgrade/static/BUILD.bazel b/packages/upgrade/static/BUILD.bazel
index ec750a8b9a..6f9bfc7b15 100644
--- a/packages/upgrade/static/BUILD.bazel
+++ b/packages/upgrade/static/BUILD.bazel
@@ -1,9 +1,9 @@
+load("//tools:defaults.bzl", "ng_module")
+
package(default_visibility = ["//visibility:public"])
exports_files(["package.json"])
-load("//tools:defaults.bzl", "ng_module")
-
ng_module(
name = "static",
# Note: There is Bazel issue where Windows symlinks
diff --git a/packages/upgrade/test/BUILD.bazel b/packages/upgrade/test/BUILD.bazel
index e8cae7a5b6..d36a265c91 100644
--- a/packages/upgrade/test/BUILD.bazel
+++ b/packages/upgrade/test/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
+load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
ts_library(
name = "test_lib",
diff --git a/tools/defaults.bzl b/tools/defaults.bzl
index 776cd8c555..078ef8068a 100644
--- a/tools/defaults.bzl
+++ b/tools/defaults.bzl
@@ -6,6 +6,7 @@ load("@npm_bazel_karma//:defs.bzl", _karma_web_test = "karma_web_test", _karma_w
load("@npm_bazel_typescript//:defs.bzl", _ts_library = "ts_library")
load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
load("//packages/bazel/src:ng_rollup_bundle.bzl", _ng_rollup_bundle = "ng_rollup_bundle")
+load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
_DEFAULT_TSCONFIG_BUILD = "//packages:tsconfig-build.json"
_DEFAULT_TSCONFIG_TEST = "//packages:tsconfig-test"
diff --git a/tools/ng_setup_workspace.bzl b/tools/ng_setup_workspace.bzl
index a705f91e37..259c96af1a 100644
--- a/tools/ng_setup_workspace.bzl
+++ b/tools/ng_setup_workspace.bzl
@@ -5,9 +5,9 @@
"Install angular source dependencies"
-load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version")
-load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
load("@angular//packages/bazel/src:ng_setup_workspace.bzl", _ng_setup_workspace = "ng_setup_workspace")
+load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
+load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version")
def ng_setup_workspace():
"""This repository rule should be called from your WORKSPACE file.
diff --git a/tools/public_api_guard/BUILD.bazel b/tools/public_api_guard/BUILD.bazel
index 918bae387c..2b3b335791 100644
--- a/tools/public_api_guard/BUILD.bazel
+++ b/tools/public_api_guard/BUILD.bazel
@@ -1,7 +1,7 @@
load("//tools/ts-api-guardian:index.bzl", "ts_api_guardian_test")
load(":public_api_guard.bzl", "generate_targets")
-generate_targets(glob(
+generate_targets(golden_files = glob(
["*/**/*.d.ts"],
# exclude the following target because we have an explicit target for it bellow, see :core_api
exclude = ["core/core.d.ts"],
diff --git a/tools/symbol-extractor/BUILD.bazel b/tools/symbol-extractor/BUILD.bazel
index d3f8cfb55b..68945a07dd 100644
--- a/tools/symbol-extractor/BUILD.bazel
+++ b/tools/symbol-extractor/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "lib",
testonly = True,
diff --git a/tools/testing/BUILD.bazel b/tools/testing/BUILD.bazel
index 0af43b2a7a..2f0d7bf928 100644
--- a/tools/testing/BUILD.bazel
+++ b/tools/testing/BUILD.bazel
@@ -1,7 +1,7 @@
-package(default_visibility = ["//visibility:public"])
-
load("//tools:defaults.bzl", "ts_library")
+package(default_visibility = ["//visibility:public"])
+
ts_library(
name = "browser",
testonly = 1,
diff --git a/tools/ts-api-guardian/BUILD.bazel b/tools/ts-api-guardian/BUILD.bazel
index 191aa162e0..eb6c2f2f07 100644
--- a/tools/ts-api-guardian/BUILD.bazel
+++ b/tools/ts-api-guardian/BUILD.bazel
@@ -1,8 +1,6 @@
load(
"@build_bazel_rules_nodejs//:defs.bzl",
"jasmine_node_test",
- "node_modules_filegroup",
- "nodejs_binary",
"npm_package",
)
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
diff --git a/yarn.lock b/yarn.lock
index 2f4acfb2ed..5a624242a0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -82,23 +82,23 @@
"@bazel/bazel-linux_x64" "0.22.0"
"@bazel/bazel-win32_x64" "0.22.0"
-"@bazel/buildifier-darwin_x64@0.19.2":
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.19.2.tgz#1182862b4a3578fb9367ab42e807131187a61702"
- integrity sha512-f6CITRj8jFhhZFrQkIao3IgJjZAXGYwUkW/QBSeAu0HIltBerJ0FTt/Nmu9ji1QZYT2aO4RpZ8oJksG6xv1dcQ==
+"@bazel/buildifier-darwin_x64@0.20.0":
+ version "0.20.0"
+ resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.20.0.tgz#1aeceb5a1a57a62eef6415377dbe95091781a7d4"
+ integrity sha512-yV7niwbdpDDPUw1vgyk1wIjPl3+YOM4o5FPgFmnFgzf48JUqrF3PK6Blg95Z8SqGOVoJAOChRC1GvopzEUzwZA==
-"@bazel/buildifier-linux_x64@0.19.2":
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.19.2.tgz#8b26eaf1f091cd3846a7dd7ea94008b55498401e"
- integrity sha512-kJjzbrjuAW4yVms5mbTWSHpJF6ogDLkuq4MjVP6a03umQ7E15o9YoxbDoiN+CzAj9ZMWPWfc5/N5TouiwXkGzA==
+"@bazel/buildifier-linux_x64@0.20.0":
+ version "0.20.0"
+ resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.20.0.tgz#8cb6c8f999dbd8a9ee183906f202b698571d771b"
+ integrity sha512-djbBtcacgERWZoxjEm8lGmMyEaOYB3moiz0kioHTQc2F96wNLfm6Cikd4Ojrcj5VNQCMW9oy3YFTu+c5mIrCcA==
-"@bazel/buildifier@^0.19.2":
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.19.2.tgz#3e077de346ad98561cee703297aa8db50cfb3c76"
- integrity sha512-MwkuoQdOdZ/VYKJvZe3qVCn3/20pLJyJpzNl3cBmaccWeUtdDKhtOm8YlLU08lxrt0VcKNcTYt4uiA62e/315A==
+"@bazel/buildifier@^0.20.0":
+ version "0.20.0"
+ resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.20.0.tgz#24a10e485fe65dbd75ef812cf37635df1fb91d0d"
+ integrity sha512-dahQRtE1KEp+efUV23q/JtOCSbQEk5C/+H3J33g8wP5roxMUa8mfDto85eloJ+gRPW7yOybxknuRYc4KSpgT7w==
optionalDependencies:
- "@bazel/buildifier-darwin_x64" "0.19.2"
- "@bazel/buildifier-linux_x64" "0.19.2"
+ "@bazel/buildifier-darwin_x64" "0.20.0"
+ "@bazel/buildifier-linux_x64" "0.20.0"
"@bazel/ibazel@~0.9.0":
version "0.9.0"