df816c9c80
The library used by ngcc to update the source files (MagicString) is able to generate a source-map but it is not able to account for any previous source-map that the input text is already associated with. There have been various attempts to fix this but none have been very successful, since it is not a trivial problem to solve. This commit contains a novel approach that is able to load up a tree of source-files connected by source-maps and flatten them down into a single source-map that maps directly from the final generated file to the original sources referenced by the intermediate source-maps. PR Close #35132
84 lines
2.4 KiB
Python
84 lines
2.4 KiB
Python
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
ts_library(
|
|
name = "test_lib",
|
|
testonly = True,
|
|
srcs = glob(
|
|
["**/*.ts"],
|
|
exclude = ["integration/**/*.ts"],
|
|
),
|
|
deps = [
|
|
"//packages/compiler",
|
|
"//packages/compiler-cli/ngcc",
|
|
"//packages/compiler-cli/ngcc/test/helpers",
|
|
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
"//packages/compiler-cli/src/ngtsc/file_system/testing",
|
|
"//packages/compiler-cli/src/ngtsc/imports",
|
|
"//packages/compiler-cli/src/ngtsc/partial_evaluator",
|
|
"//packages/compiler-cli/src/ngtsc/reflection",
|
|
"//packages/compiler-cli/src/ngtsc/testing",
|
|
"//packages/compiler-cli/src/ngtsc/transform",
|
|
"//packages/compiler-cli/src/ngtsc/translator",
|
|
"//packages/compiler-cli/test/helpers",
|
|
"@npm//@types/convert-source-map",
|
|
"@npm//convert-source-map",
|
|
"@npm//dependency-graph",
|
|
"@npm//magic-string",
|
|
"@npm//sourcemap-codec",
|
|
"@npm//typescript",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "test",
|
|
bootstrap = ["//tools/testing:node_no_angular_es5"],
|
|
data = [
|
|
"//packages/compiler-cli/test/ngtsc/fake_core:npm_package",
|
|
],
|
|
deps = [
|
|
":test_lib",
|
|
],
|
|
)
|
|
|
|
ts_library(
|
|
name = "integration_lib",
|
|
testonly = True,
|
|
srcs = glob(
|
|
["integration/**/*.ts"],
|
|
),
|
|
deps = [
|
|
"//packages/compiler-cli/ngcc",
|
|
"//packages/compiler-cli/ngcc/test/helpers",
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
"//packages/compiler-cli/src/ngtsc/file_system/testing",
|
|
"//packages/compiler-cli/src/ngtsc/testing",
|
|
"//packages/compiler-cli/test/helpers",
|
|
"@npm//rxjs",
|
|
"@npm//typescript",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "integration",
|
|
timeout = "long",
|
|
bootstrap = ["//tools/testing:node_no_angular_es5"],
|
|
data = [
|
|
"//packages/common:npm_package",
|
|
"//packages/core:npm_package",
|
|
"@npm//rxjs",
|
|
],
|
|
shard_count = 4,
|
|
tags = [
|
|
# Disabled in AOT mode because we want ngcc to compile non-AOT Angular packages.
|
|
"no-ivy-aot",
|
|
],
|
|
deps = [
|
|
":integration_lib",
|
|
"@npm//canonical-path",
|
|
"@npm//convert-source-map",
|
|
],
|
|
)
|