Re-run Gazelle, formatting BUILD.bazel files
Closes #231
PiperOrigin-RevId: 205443963
diff --git a/BUILD.bazel b/BUILD.bazel
index 461d901..8da32ff 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -34,7 +34,7 @@
srcs = glob([
"node_modules/**/*.js",
"node_modules/**/*.d.ts",
- "node_modules/**/*.json"
+ "node_modules/**/*.json",
] + [
# Needed because http-server has a bin with no .js extension
"node_modules/http-server/**",
@@ -47,9 +47,9 @@
skylark_doc(
name = "docs",
srcs = [
- "//internal:ts_repositories.bzl",
"//internal:build_defs.bzl",
"//internal:ts_config.bzl",
+ "//internal:ts_repositories.bzl",
"//internal/devserver:ts_devserver.bzl",
"//internal/karma:ts_web_test.bzl",
"//internal/protobufjs:ts_proto_library.bzl",
diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel
index 3d1bcbc..db5bf95 100644
--- a/examples/BUILD.bazel
+++ b/examples/BUILD.bazel
@@ -24,8 +24,8 @@
ts_library(
name = "foo_ts_library",
srcs = [
- ":types",
"foo.ts",
+ ":types",
],
tsconfig = ":tsconfig.json",
deps = ["//examples/generated_ts"],
@@ -37,7 +37,7 @@
tsconfig = ":tsconfig.json",
deps = [
":foo_ts_library",
- "//examples/some_library:lib",
"//examples/generated_ts",
+ "//examples/some_library:lib",
],
)
diff --git a/examples/app/BUILD.bazel b/examples/app/BUILD.bazel
index 8ec42e1..7f5aed3 100644
--- a/examples/app/BUILD.bazel
+++ b/examples/app/BUILD.bazel
@@ -7,13 +7,13 @@
ts_devserver(
name = "devserver",
- # We'll collect all the devmode JS sources from these TypeScript libraries
- deps = [":app"],
+ port = 8080,
# This is the path we'll request from the browser, see index.html
serving_path = "/bundle.min.js",
# The devserver can serve our static files too
static_files = ["index.html"],
- port = 8080,
+ # We'll collect all the devmode JS sources from these TypeScript libraries
+ deps = [":app"],
)
# Test for production mode
@@ -21,8 +21,8 @@
rollup_bundle(
name = "bundle",
- deps = [":app"],
entry_point = "examples/app/app",
+ deps = [":app"],
)
nodejs_binary(
diff --git a/examples/bazel_managed_deps/BUILD.bazel b/examples/bazel_managed_deps/BUILD.bazel
index d3084b4..536a24e 100644
--- a/examples/bazel_managed_deps/BUILD.bazel
+++ b/examples/bazel_managed_deps/BUILD.bazel
@@ -3,6 +3,6 @@
ts_library(
name = "bazel_managed_deps",
srcs = ["index.ts"],
- tsconfig = ":tsconfig.json",
node_modules = "@build_bazel_rules_typescript_internal_bazel_managed_deps//:node_modules",
+ tsconfig = ":tsconfig.json",
)
diff --git a/examples/es5_output/BUILD.bazel b/examples/es5_output/BUILD.bazel
index c0aa28a..5bc709f 100644
--- a/examples/es5_output/BUILD.bazel
+++ b/examples/es5_output/BUILD.bazel
@@ -9,7 +9,7 @@
name = "es5_output_test",
srcs = ["es5_output_test.sh"],
data = [
- ":es5_output",
- "@bazel_tools//tools/bash/runfiles",
+ ":es5_output",
+ "@bazel_tools//tools/bash/runfiles",
],
)
diff --git a/examples/es6_output/BUILD.bazel b/examples/es6_output/BUILD.bazel
index 4bacb97..207a48a 100644
--- a/examples/es6_output/BUILD.bazel
+++ b/examples/es6_output/BUILD.bazel
@@ -25,7 +25,7 @@
name = "es6_output_test",
srcs = ["es6_output_test.sh"],
data = [
- ":es6_output",
- "@bazel_tools//tools/bash/runfiles",
+ ":es6_output",
+ "@bazel_tools//tools/bash/runfiles",
],
)
diff --git a/examples/generated_ts/BUILD.bazel b/examples/generated_ts/BUILD.bazel
index 380aaad..e488e57 100644
--- a/examples/generated_ts/BUILD.bazel
+++ b/examples/generated_ts/BUILD.bazel
@@ -3,12 +3,12 @@
package(default_visibility = ["//visibility:public"])
genrule(
- name = "foo_ts",
- outs = ["foo.ts"],
- cmd = "echo 'export const a = 1;' > $@",
+ name = "foo_ts",
+ outs = ["foo.ts"],
+ cmd = "echo 'export const a = 1;' > $@",
)
ts_library(
- name = "generated_ts",
- srcs = [":foo.ts"],
+ name = "generated_ts",
+ srcs = [":foo.ts"],
)
diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel
index 9d2aedb..68e33f7 100644
--- a/examples/protocol_buffers/BUILD.bazel
+++ b/examples/protocol_buffers/BUILD.bazel
@@ -1,4 +1,5 @@
-load("@build_bazel_rules_typescript//:defs.bzl",
+load(
+ "@build_bazel_rules_typescript//:defs.bzl",
"ts_library",
"ts_proto_library",
"ts_web_test_suite",
@@ -33,12 +34,12 @@
ts_web_test_suite(
name = "test",
- deps = ["test_lib"],
bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"],
browsers = [
- "@io_bazel_rules_webtesting//browsers:chromium-local",
- "@io_bazel_rules_webtesting//browsers:firefox-local",
+ "@io_bazel_rules_webtesting//browsers:chromium-local",
+ "@io_bazel_rules_webtesting//browsers:firefox-local",
],
+ deps = ["test_lib"],
)
ts_library(
@@ -49,10 +50,10 @@
ts_devserver(
name = "devserver",
- deps = [":app"],
- entry_module = "build_bazel_rules_typescript/examples/protocol_buffers/app",
bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"],
+ entry_module = "build_bazel_rules_typescript/examples/protocol_buffers/app",
port = 8080,
+ deps = [":app"],
)
# Test for production mode
@@ -60,7 +61,6 @@
rollup_bundle(
name = "bundle",
- deps = [":app"],
entry_point = "examples/protocol_buffers/app",
# TODO(alexeagle): we should be able to get this from //:protobufjs_bootstrap_scripts
# and automatically plumb it through to Rollup.
@@ -68,6 +68,7 @@
"long": "Long",
"protobufjs/minimal": "protobuf",
},
+ deps = [":app"],
)
# Needed because the prodserver only loads static files that appear under this
@@ -75,12 +76,12 @@
genrule(
name = "protobufjs",
srcs = [
- "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/protobufjs/dist/minimal/protobuf.min.js",
- "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/long/dist/long.js",
+ "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/protobufjs/dist/minimal/protobuf.min.js",
+ "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/long/dist/long.js",
],
outs = [
- "protobuf.min.js",
- "long.js"
+ "protobuf.min.js",
+ "long.js",
],
cmd = "outs=($(OUTS)); d=$$(dirname $${outs[0]}); for s in $(SRCS); do cp $$s $$d; done",
)
@@ -90,8 +91,8 @@
args = ["./examples/protocol_buffers"],
data = [
"index.html",
- ":protobufjs",
":bundle",
+ ":protobufjs",
],
entry_point = "http-server/bin/http-server",
)
diff --git a/examples/some_module/BUILD.bazel b/examples/some_module/BUILD.bazel
index d913b96..b3747f8 100644
--- a/examples/some_module/BUILD.bazel
+++ b/examples/some_module/BUILD.bazel
@@ -46,7 +46,7 @@
name = "module_load_test",
srcs = ["module_load_test.sh"],
data = [
- ":bin",
- "@bazel_tools//tools/bash/runfiles",
+ ":bin",
+ "@bazel_tools//tools/bash/runfiles",
],
)
diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel
index 0dc1758..b719e7c 100644
--- a/examples/testing/BUILD.bazel
+++ b/examples/testing/BUILD.bazel
@@ -7,37 +7,37 @@
ts_library(
name = "tests",
- srcs = glob(["*.spec.ts"]),
- deps = [":lib"],
- tsconfig = ":tsconfig.json",
testonly = 1,
+ srcs = glob(["*.spec.ts"]),
+ tsconfig = ":tsconfig.json",
+ deps = [":lib"],
)
ts_web_test_suite(
name = "testing",
- deps = [
- ":tests",
+ browsers = [
+ "@io_bazel_rules_webtesting//browsers:chromium-local",
+ "@io_bazel_rules_webtesting//browsers:firefox-local",
],
static_files = [
- "static_script.js",
+ "static_script.js",
],
- browsers = [
- "@io_bazel_rules_webtesting//browsers:chromium-local",
- "@io_bazel_rules_webtesting//browsers:firefox-local",
+ deps = [
+ ":tests",
],
)
ts_web_test_suite(
name = "testing_sauce",
- deps = [
- ":tests",
- ],
browsers = [
- "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10",
+ "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10",
],
tags = [
"sauce",
# TODO(alexeagle): enable on CI once we have set the SAUCE env variables
"manual",
],
+ deps = [
+ ":tests",
+ ],
)
diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel
index 4b803bb..438f315 100644
--- a/internal/BUILD.bazel
+++ b/internal/BUILD.bazel
@@ -18,7 +18,9 @@
exports_files([
# Exported to be consumed for generating skydoc.
- "build_defs.bzl", "ts_config.bzl", "ts_repositories.bzl",
+ "build_defs.bzl",
+ "ts_config.bzl",
+ "ts_repositories.bzl",
])
load("//internal:build_defs.bzl", "ts_library")
@@ -27,29 +29,35 @@
# Vanilla typescript compiler: run the tsc.js binary distributed by TypeScript
nodejs_binary(
name = "tsc",
- node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
entry_point = "typescript/lib/tsc.js",
+ node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
visibility = ["//internal:__subpackages__"],
)
# Build our custom compiler using the vanilla one
ts_library(
name = "tsc_wrapped",
- srcs = glob([
- "tsc_wrapped/*.ts",
- "tsetse/*.ts",
- "tsetse/rules/*.ts"
- ], exclude=["**/test_support.ts", "**/*_test.ts"]),
- supports_workers = False,
+ srcs = glob(
+ [
+ "tsc_wrapped/*.ts",
+ "tsetse/*.ts",
+ "tsetse/rules/*.ts",
+ ],
+ exclude = [
+ "**/test_support.ts",
+ "**/*_test.ts",
+ ],
+ ),
compiler = ":tsc",
- node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
- module_name = "@bazel/typescript",
- module_root = "tsc_wrapped/index.d.ts",
- tsconfig = "//internal:tsc_wrapped/tsconfig.json",
- visibility = ["//visibility:public"],
data = [
"//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto",
],
+ module_name = "@bazel/typescript",
+ module_root = "tsc_wrapped/index.d.ts",
+ node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
+ supports_workers = False,
+ tsconfig = "//internal:tsc_wrapped/tsconfig.json",
+ visibility = ["//visibility:public"],
# Cannot have any deps because it doesn't work with vanilla tsc
# Workaround for https://github.com/Microsoft/TypeScript/issues/22208
deps = [
@@ -63,8 +71,8 @@
data = [
":tsc_wrapped",
],
- node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js",
+ node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
templated_args = ["--node_options=--expose-gc"],
visibility = ["//visibility:public"],
)
@@ -72,8 +80,8 @@
ts_library(
name = "test_lib",
srcs = glob(["tsc_wrapped/*_test.ts"]) + ["tsc_wrapped/test_support.ts"],
- deps = [":tsc_wrapped"],
tsconfig = "//internal:tsc_wrapped/tsconfig.json",
+ deps = [":tsc_wrapped"],
)
jasmine_node_test(
diff --git a/internal/e2e/absolute_imports/BUILD.bazel b/internal/e2e/absolute_imports/BUILD.bazel
index 07a726f..fb25416 100644
--- a/internal/e2e/absolute_imports/BUILD.bazel
+++ b/internal/e2e/absolute_imports/BUILD.bazel
@@ -20,6 +20,6 @@
name = "absolute_imports",
srcs = glob(["*.ts"]),
expected_diagnostics = [
- "TS2307: Cannot find module 'internal/e2e/absolute_imports/foo'"
+ "TS2307: Cannot find module 'internal/e2e/absolute_imports/foo'",
],
)
diff --git a/internal/e2e/strict_deps/BUILD b/internal/e2e/strict_deps/BUILD
index b25079b..604704e 100644
--- a/internal/e2e/strict_deps/BUILD
+++ b/internal/e2e/strict_deps/BUILD
@@ -16,7 +16,6 @@
package(default_visibility = ["//visibility:public"])
-
load("//:defs.bzl", "ts_library")
ts_library(
diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel
index d2b5992..8802ef9 100644
--- a/internal/karma/BUILD.bazel
+++ b/internal/karma/BUILD.bazel
@@ -1,4 +1,4 @@
-package(default_visibility=["//visibility:public"])
+package(default_visibility = ["//visibility:public"])
exports_files([
"test-main.js",
@@ -21,7 +21,7 @@
nodejs_binary(
name = "karma_bin",
- entry_point = "karma/bin/karma",
data = [":karma_concat_js"],
+ entry_point = "karma/bin/karma",
node_modules = "@build_bazel_rules_typescript_karma_deps//:node_modules",
)
diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel
index 662c061..bfd588a 100644
--- a/internal/protobufjs/BUILD.bazel
+++ b/internal/protobufjs/BUILD.bazel
@@ -1,4 +1,5 @@
-package(default_visibility=["//visibility:public"])
+package(default_visibility = ["//visibility:public"])
+
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
exports_files([
@@ -9,11 +10,12 @@
nodejs_binary(
name = "pbjs",
- node_modules = "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules",
entry_point = "protobufjs/bin/pbjs",
+ node_modules = "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules",
)
+
nodejs_binary(
name = "pbts",
- node_modules = "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules",
entry_point = "protobufjs/bin/pbts",
+ node_modules = "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules",
)
diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel
index f96b9eb..69a478b 100644
--- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel
+++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel
@@ -1,4 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+
licenses(["notice"]) # Apache 2.0
# Export the raw proto file so protobufjs can be used reflectively without codegen
exports_files(["worker_protocol.proto"])
+
+proto_library(
+ name = "blaze_worker_proto",
+ srcs = ["worker_protocol.proto"],
+ visibility = ["//visibility:public"],
+)
+
+go_proto_library(
+ name = "blaze_worker_go_proto",
+ importpath = "github.com/bazelbuild/rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf",
+ proto = ":blaze_worker_proto",
+ visibility = ["//visibility:public"],
+)
+
+go_library(
+ name = "go_default_library",
+ embed = [":blaze_worker_go_proto"],
+ importpath = "github.com/bazelbuild/rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf",
+ visibility = ["//visibility:public"],
+)