豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 73d4292

Browse files
committed
feat(bazel): move app_bundle rule outside of benchmark toolkit
The app bundle rule is generally useful for all consumer Bazel workspaces to e.g. test CLI bundles, serve production bundles etc.
1 parent 550c818 commit 73d4292

File tree

16 files changed

+17
-29
lines changed

16 files changed

+17
-29
lines changed

.ng-dev/commit-message.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const commitMessage: CommitMessageConfig = {
1111
scopes: [
1212
...buildScopesFor('bazel', [
1313
'api-golden',
14+
'app-bundling',
1415
'benchmark',
1516
'browsers',
1617
'constraints',

bazel/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ filegroup(
66
"extract_js_module_output.bzl",
77
"extract_types.bzl",
88
"//bazel/api-golden:files",
9+
"//bazel/app-bundling:files",
910
"//bazel/benchmark:files",
1011
"//bazel/browsers:files",
1112
"//bazel/constraints:files",
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
22

33
package(default_visibility = ["//visibility:public"])
44

5+
exports_files([
6+
"terser_config.json",
7+
"esbuild.config-tmpl.mjs",
8+
])
9+
510
nodejs_binary(
6-
name = "brotli-cli",
7-
data = [
8-
"cli.cjs",
9-
],
10-
entry_point = ":cli.cjs",
11+
name = "brotli-compress",
12+
data = ["brotli-compress.cjs"],
13+
entry_point = ":brotli-compress.cjs",
1114
templated_args = ["--nobazel_run_linker"],
12-
visibility = ["//visibility:public"],
1315
)
1416

1517
# Make source files available for distribution via pkg_npm
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def app_bundle(
4545
expand_template(
4646
name = "%s_config_file" % name,
4747
output_name = "%s_config.mjs" % name,
48-
template = "//bazel/benchmark/app_bundling:esbuild.config-tmpl.mjs",
48+
template = "//bazel/app-bundling:esbuild.config-tmpl.mjs",
4949
visibility = visibility,
5050
substitutions = {
5151
"TMPL_ENTRY_POINT_ROOTPATH": "$(rootpath %s)" % entry_point,
@@ -75,7 +75,7 @@ def app_bundle(
7575

7676
common_terser_options = {
7777
"visibility": visibility,
78-
"config_file": "//bazel/benchmark/app_bundling:terser_config.json",
78+
"config_file": "//bazel/app-bundling:terser_config.json",
7979
# TODO: Enable source maps for better debugging when `@bazel/terser` pre-declares
8080
# JS and map outputs. Tracked with: DEV-120
8181
"sourcemap": False,
@@ -114,7 +114,7 @@ def app_bundle(
114114

115115
npm_package_bin(
116116
name = "_%s_brotli" % name,
117-
tool = "//bazel/benchmark/brotli-cli",
117+
tool = "//bazel/app-bundling:brotli-compress",
118118
data = [name + ".min.js"],
119119
outs = [name + ".min.js.br"],
120120
args = [
File renamed without changes.

bazel/benchmark/app_bundling/test/BUILD.bazel renamed to bazel/app-bundling/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@npm//@angular/bazel:index.bzl", "ng_module")
2-
load("//bazel/benchmark/app_bundling:index.bzl", "app_bundle")
2+
load("//bazel/app-bundling:index.bzl", "app_bundle")
33
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
44

55
ng_module(

bazel/benchmark/app_bundling/test/bundle.spec.ts renamed to bazel/app-bundling/test/bundle.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import {runInNewContext} from 'vm';
1212
import {runfiles} from '@bazel/runfiles';
1313

1414
/** Absolute file path to the built minified app bundle. */
15-
const bundleScriptPath = runfiles.resolveWorkspaceRelative(
16-
'bazel/benchmark/app_bundling/test/bundle.min.js',
17-
);
15+
const bundleScriptPath = runfiles.resolveWorkspaceRelative('bazel/app-bundling/test/bundle.min.js');
1816

1917
const appIndexHtml = `
2018
<html lang="en">
File renamed without changes.

0 commit comments

Comments
 (0)