Skip to content

Commit

Permalink
Updates typescript_proto_library to use an aspect that can generate t…
Browse files Browse the repository at this point in the history
…ransitive dependencies. (#138)
  • Loading branch information
Dig-Doug authored and jonnyreeves committed Nov 29, 2018
1 parent a7b6422 commit 14d69f6
Show file tree
Hide file tree
Showing 25 changed files with 9,547 additions and 502 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ lib/
**/mocha-report.json
bazel-*
protoc/
.ijwb/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cache:
directories:
- node_modules
before_install:
- BAZEL_VERSION=0.11.0
- BAZEL_VERSION=0.19.2
- BAZEL_DEB="bazel_${BAZEL_VERSION}-linux-x86_64.deb"
- wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${BAZEL_DEB} -O "${BAZEL_DEB}"
- sudo dpkg -i ${BAZEL_DEB}
Expand Down
18 changes: 10 additions & 8 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package(default_visibility = ["//visibility:public"])


exports_files(["tsconfig.json"])
exports_files([
"tsconfig.json",
"node_modules/google-protobuf/google-protobuf.js",
])

filegroup(
name = "generate_ts",
srcs = [
"//proto:generate",
"//proto/examplecom:generate",
"//proto/othercom:generate",
],
name = "generate_ts",
srcs = [
"//proto:generate",
"//proto/examplecom:generate",
"//proto/othercom:generate",
],
)
58 changes: 32 additions & 26 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
workspace(name = "ts_protoc_gen")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

git_repository(
name = "io_bazel_rules_go",
commit = "6bee898391a42971289a7989c0f459ab5a4a84dd", # master as of May 10th, 2018
remote = "https://github.com/bazelbuild/rules_go.git",
http_archive(
name = "build_bazel_rules_typescript",
sha256 = "e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47",
strip_prefix = "rules_typescript-0.21.0",
urls = ["https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip"],
)

load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")

rules_typescript_dependencies()

load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")

ts_setup_workspace()

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

node_repositories()

yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")

load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains()

http_archive(
name = "io_bazel_rules_webtesting",
strip_prefix = "rules_webtesting-master",
urls = [
"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz",
],
)
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")

web_test_repositories()

git_repository(
name = "build_bazel_rules_nodejs",
remote = "https://github.com/bazelbuild/rules_nodejs.git",
commit = "d334fd8e2274fb939cf447106dced97472534e80",
browser_repositories(
chromium = True,
)
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
node_repositories(package_json = ["//:package.json"])

load("@ts_protoc_gen//:defs.bzl", "typescript_proto_dependencies")
typescript_proto_dependencies()

git_repository(
name = "build_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git",
commit = "3488d4fb89c6a02d79875d217d1029182fbcd797",
)
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
ts_setup_workspace()
typescript_proto_dependencies()
9 changes: 5 additions & 4 deletions bin/BUILD → bin/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package(default_visibility=["//visibility:public"])
package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")

nodejs_binary(
name = "protoc-gen-ts",
node_modules = "@deps//:node_modules",
args = ["--node_options=--expose-gc"],
data = [
"//src:src",
"//src",
],
entry_point = "ts_protoc_gen/src/index",
args = ["--node_options=--expose-gc"],
node_modules = "@ts_protoc_gen_deps//:node_modules",
)
Loading

0 comments on commit 14d69f6

Please sign in to comment.