Skip to content

Commit

Permalink
feat: export bazel build rules for googleapis (#511)
Browse files Browse the repository at this point in the history
* feat: export bazel build rules for googleapis

Release-As: v0.99.0

* fix: PR feedback

* fix: typo
  • Loading branch information
alexander-fenster committed May 21, 2020
1 parent d57b33b commit 11f6f49
Show file tree
Hide file tree
Showing 8 changed files with 3,842 additions and 4,890 deletions.
19 changes: 8 additions & 11 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Allow any ts_library rules in this workspace to reference the config
exports_files(["tsconfig.json"], visibility = ["//:__subpackages__"])

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

exports_files(["tsconfig.json"], visibility = ["//visibility:public"])

load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test")
load("@npm_bazel_typescript//:index.bzl", "ts_project", "ts_config")
load("@npm_bazel_labs//:index.bzl", "protobufjs_ts_library")
Expand Down Expand Up @@ -110,23 +109,21 @@ npm_compile_dependencies = npm_test_dependencies + [
"@npm//@types/object-hash",
"@npm//@types/sinon",
"@npm//@types/yargs",
"@npm//gts",
]

ts_project(
name = "compile",
srcs = glob([
"src/**/*.ts",
"test/**/*.ts",
"tools/**/*.ts",
"index.d.ts"
]),
"src/**/*.ts",
"test/**/*.ts",
"tools/**/*.ts",
"index.d.ts",
]),
tsconfig = "//:tsconfig.json",
extends = ["@npm//:node_modules/gts/tsconfig-google.json"],
source_map = True,
declaration = True,
deps = [
":protos",
"//:protos"
] + npm_compile_dependencies,
)

Expand Down
12 changes: 4 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_
rules_proto_dependencies()
rules_proto_toolchains()

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install", "yarn_install")
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")

npm_install(
yarn_install(
name = "npm",
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
yarn_lock = "//:yarn.lock",
)

# Install any Bazel rules which were extracted earlier by the npm_install rule.
# Install any Bazel rules which were extracted earlier by the yarn_install rule.
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
install_bazel_dependencies()

Expand All @@ -52,8 +52,4 @@ yarn_install(
name = "build_bazel_rules_typescript_protobufs_compiletime_deps",
package_json = "@npm_bazel_labs//protobufjs:package.json",
yarn_lock = "@npm_bazel_labs//protobufjs:yarn.lock",
# Do not symlink node_modules as when used in downstream repos we should not create
# node_modules folders in the @npm_bazel_typescript external repository. This is
# not supported by managed_directories.
symlink_node_modules = False,
)

0 comments on commit 11f6f49

Please sign in to comment.