mirror of
https://github.com/angular/angular.git
synced 2026-11-22 22:55:25 -05:00
We had some code we used earlier to check apps against the preprocessor. These changes clean it up since it's not used anymore and it includes dependencies on TypeScript and esbuild.
63 lines
1.7 KiB
Python
63 lines
1.7 KiB
Python
load("@bazel_lib//lib:write_source_files.bzl", "write_source_file")
|
|
load("//tools:defaults.bzl", "js_binary", "npm_package", "ts_config", "ts_project")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# `src/error_code.ts` is generated from the Rust source of truth in
|
|
# `ng-analyze/src/types/error_code.rs`. It is updated together with the `ngtsc` copy by
|
|
# `//packages/compiler-cli/src/ngtsc/diagnostics:sync_error_code`.
|
|
write_source_file(
|
|
name = "sync_error_code",
|
|
in_file = "//packages/compiler-cli/preprocessor/ng-analyze:generated_error_code.ts",
|
|
out_file = "src/error_code.ts",
|
|
suggested_update_target = "//packages/compiler-cli/src/ngtsc/diagnostics:sync_error_code",
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig.json",
|
|
deps = [
|
|
"//packages:tsconfig_build",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "preprocessor",
|
|
srcs = glob(
|
|
include = [
|
|
"*.ts",
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"src/diagnostics.ts",
|
|
],
|
|
),
|
|
tsconfig = ":tsconfig",
|
|
deps = [
|
|
"//:node_modules/@types/node",
|
|
"//:node_modules/magic-string",
|
|
"//packages/compiler",
|
|
"//packages/compiler-cli/preprocessor/ng-analyze:wasm",
|
|
"//packages/compiler-cli/private:hybrid_preprocessor",
|
|
],
|
|
)
|
|
|
|
js_binary(
|
|
name = "main",
|
|
data = [
|
|
":preprocessor",
|
|
"//packages/compiler-cli/preprocessor/ng-analyze:ng_analyze_wasm",
|
|
"//packages/compiler-cli/preprocessor/ng-analyze:package_json",
|
|
],
|
|
entry_point = "main.js",
|
|
)
|
|
|
|
npm_package(
|
|
srcs = [
|
|
"package.json",
|
|
":preprocessor",
|
|
"//packages/compiler-cli/preprocessor/ng-analyze:wasm",
|
|
],
|
|
package = "@angular/compiler-cli/preprocessor",
|
|
)
|