This commit adds tracking of modules, directives, and pipes which are made visible to consumers through NgModules exported from the package entrypoint. ngtsc will now produce a diagnostic if such classes are not themselves exported via the entrypoint (as this is a requirement for downstream consumers to use them with Ivy). To accomplish this, a graph of references is created and populated via the ReferencesRegistry. Symbols exported via the package entrypoint are compared against the graph to determine if any publicly visible symbols are not properly exported. Diagnostics are produced for each one which also show the path by which they become visible. This commit also introduces a diagnostic (instead of a hard compiler crash) if an entrypoint file cannot be correctly determined. PR Close #27743
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
package(default_visibility = ["//visibility:public"])
|
|
|
|
load("//tools:defaults.bzl", "npm_package", "ts_library")
|
|
load("@build_bazel_rules_typescript//:defs.bzl", "ts_config")
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig-build.json",
|
|
deps = ["//packages:tsconfig-build.json"],
|
|
)
|
|
|
|
ts_library(
|
|
name = "compiler-cli",
|
|
srcs = glob(
|
|
[
|
|
"*.ts",
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"src/integrationtest/**/*.ts",
|
|
],
|
|
),
|
|
module_name = "@angular/compiler-cli",
|
|
tsconfig = ":tsconfig",
|
|
deps = [
|
|
"//packages/compiler",
|
|
"//packages/compiler-cli/src/ngtsc/annotations",
|
|
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
|
"//packages/compiler-cli/src/ngtsc/entry_point",
|
|
"//packages/compiler-cli/src/ngtsc/imports",
|
|
"//packages/compiler-cli/src/ngtsc/partial_evaluator",
|
|
"//packages/compiler-cli/src/ngtsc/reflection",
|
|
"//packages/compiler-cli/src/ngtsc/shims",
|
|
"//packages/compiler-cli/src/ngtsc/switch",
|
|
"//packages/compiler-cli/src/ngtsc/transform",
|
|
"//packages/compiler-cli/src/ngtsc/typecheck",
|
|
"//packages/compiler-cli/src/ngtsc/util",
|
|
"@ngdeps//@bazel/typescript",
|
|
"@ngdeps//@types",
|
|
"@ngdeps//tsickle",
|
|
"@ngdeps//typescript",
|
|
],
|
|
)
|
|
|
|
npm_package(
|
|
name = "npm_package",
|
|
srcs = [
|
|
"package.json",
|
|
],
|
|
tags = [
|
|
"release-with-framework",
|
|
],
|
|
# Do not add more to this list.
|
|
# Dependencies on the full npm_package cause long re-builds.
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":compiler-cli",
|
|
"//packages/compiler-cli/src/ngcc",
|
|
],
|
|
)
|