angular/devtools/src/BUILD.bazel
AleksanderBodurri 77ae5a391b refactor(devtools): remove git sha stamping from devtools build (#55694)
This stamping is interfering with publishing to the Firefox addons store by brining in the entirety of the `.git` directory as part of the source code necessary for a reproducible build, which Firefox requires as part of it's approval process.

In it's place, we are now using the extension version pulled from the manifest.

PR Close #55694
2024-05-06 16:02:36 -07:00

121 lines
3 KiB
Text

load("//devtools/tools:ng_module.bzl", "ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("//tools:defaults.bzl", "esbuild", "http_server")
load("//devtools/tools/esbuild:index.bzl", "LINKER_PROCESSED_FW_PACKAGES")
package(default_visibility = ["//visibility:public"])
sass_binary(
name = "demo_styles",
src = "styles.scss",
include_paths = ["external/npm/node_modules"],
sourcemap = False,
deps = ["//devtools:global_styles"],
)
sass_binary(
name = "firefox_styles",
src = "styles/firefox_styles.scss",
)
sass_binary(
name = "chrome_styles",
src = "styles/chrome_styles.scss",
)
ng_module(
name = "demo",
srcs = ["main.ts"],
deps = [
"//devtools/src/app",
"//packages/common",
"//packages/common/http",
"//packages/core",
"//packages/core/src/util",
"//packages/platform-browser",
"@npm//@types",
"@npm//rxjs",
],
)
esbuild(
name = "bundle",
config = "//devtools/tools/esbuild:esbuild_config_esm",
entry_points = [":main.ts"],
platform = "browser",
splitting = True,
# todo(aleksanderbodurri): here we target es2020 explicitly.
# We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change
# to how angular static properties are attached to class constructors.
# Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class
# constructors to reference a class constructor variable that they do not have access to.
target = "es2020",
deps = LINKER_PROCESSED_FW_PACKAGES + [":demo"],
)
exports_files(["index.html"])
filegroup(
name = "dev_app_static_files",
srcs = [
":chrome_styles",
":demo_styles",
":firefox_styles",
":index.html",
"//packages/zone.js/bundles:zone.umd.js",
],
)
pkg_web(
name = "devapp",
srcs = [":dev_app_static_files"] + [
":bundle",
"@npm//:node_modules/tslib/tslib.js",
],
)
http_server(
name = "devserver",
srcs = [":dev_app_static_files"],
additional_root_paths = ["angular/devtools/src/devapp"],
tags = ["manual"],
deps = [
":devapp",
],
)
ng_module(
name = "demo_application_environment",
srcs = ["demo-application-environment.ts"],
deps = [
"//devtools/projects/ng-devtools",
"//devtools/src/environments",
],
)
ng_module(
name = "demo_application_operations",
srcs = ["demo-application-operations.ts"],
deps = [
"//devtools/projects/ng-devtools",
"//devtools/projects/protocol",
],
)
ng_module(
name = "iframe_message_bus",
srcs = ["iframe-message-bus.ts"],
deps = [
"//devtools/projects/protocol",
],
)
ng_module(
name = "zone-unaware-iframe_message_bus",
srcs = ["zone-unaware-iframe-message-bus.ts"],
deps = [
":iframe_message_bus",
"//devtools/projects/protocol",
],
)