Skip to content

Commit

Permalink
Add sample ts_proto wrong output placement
Browse files Browse the repository at this point in the history
* Moved eliza.proto and proto_library one level up
* Adjusted references on BUILD from proto dir
* Now fails to build

$ bazel build //examples/connect_node/proto

Error in declare_file: the output artifact 'examples/connect_node/eliza_pb.js' is not under package directory 'examples/connect_node/proto' for target '//examples/connect_node/proto:eliza_ts_proto'
  • Loading branch information
jvliwanag committed Oct 12, 2023
1 parent 8cdcab7 commit 625990f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions examples/connect_node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_proto//proto:defs.bzl", "proto_library")

npm_link_all_packages()

Expand Down Expand Up @@ -34,3 +35,9 @@ js_binary(
],
entry_point = "server.js",
)

proto_library(
name = "eliza_proto",
srcs = ["eliza.proto"],
visibility = ["//visibility:public"],
)
File renamed without changes.
8 changes: 1 addition & 7 deletions examples/connect_node/proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:proto.bzl", "ts_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

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

proto_library(
name = "eliza_proto",
srcs = ["eliza.proto"],
)

ts_proto_library(
name = "eliza_ts_proto",
node_modules = "//examples/connect_node:node_modules",
proto = ":eliza_proto",
proto = "//examples/connect_node:eliza_proto",
)

js_library(
Expand Down

0 comments on commit 625990f

Please sign in to comment.