blob: 000eeb2ab6bc0516f47c9e14e4db706a73ffd4a2 [file]
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@build_bazel_rules_nodejs//:tools/defaults.bzl", "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "js_library")
load("//packages/typescript:index.bzl", "ts_config", "ts_project")
# to update run: bazel run //packages/worker:copy_worker_protocol.update
generated_file_test(
name = "copy_worker_protocol",
src = ":src/worker_protocol.ts",
generated = "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol_proto_ts",
tags = [
"no-bazelci-windows",
],
)
ts_config(
name = "tsconfig",
src = ":tsconfig.json",
visibility = ["//visibility:public"],
deps = [
"//:tsconfig.json",
],
)
ts_project(
name = "src",
srcs = [
"index.ts",
"src/gc.ts",
"src/size.ts",
"src/worker.ts",
"src/worker_protocol.ts",
],
declaration = True,
tsconfig = ":tsconfig",
deps = [
"@npm//@types/google-protobuf",
"@npm//@types/node",
"@npm//google-protobuf",
],
)
js_library(
name = "library",
package_name = "@bazel/worker",
srcs = [
"package.json",
],
visibility = ["//visibility:public"],
deps = [
":src",
],
)
pkg_npm(
name = "npm_package",
package_name = "@bazel/worker",
srcs = [
"README.md",
"package.json",
],
visibility = ["//visibility:public"],
deps = [
":src",
],
)