Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions grpc/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,42 @@
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

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

load("@typedb_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
load("@rules_proto_grpc//java:defs.bzl", "java_grpc_library")

java_grpc_library(
name = "typedb-protocol",
protos = [
"//proto:typedb-service",
"//proto:server-proto",
"//proto:user-proto",
"//proto:database-proto",
"//proto:migration-proto",
"//proto:error-proto",
"//proto:answer-proto",
"//proto:concept-proto",
"//proto:connection-proto",
"//proto:authentication-proto",
"//proto:options-proto",
"//proto:query-proto",
"//proto:transaction-proto",
"//proto:analyze-proto",
"//proto:analyzed-conjunction-proto",
"//proto:version-proto",
"//proto/raft_service:raft-service",
"//proto/raft_service:replication-proto",
"//proto/raft_service:request-proto",
"//proto/typedb_clustering_service:typedb-clustering-proto",
"//proto/typedb_clustering_service:typedb-clustering-service",
"//proto/typedb_service:analyze-proto",
"//proto/typedb_service:analyzed-conjunction-proto",
"//proto/typedb_service:answer-proto",
"//proto/typedb_service:authentication-proto",
"//proto/typedb_service:concept-proto",
"//proto/typedb_service:connection-proto",
"//proto/typedb_service:database-proto",
"//proto/typedb_service:error-proto",
"//proto/typedb_service:migration-proto",
"//proto/typedb_service:options-proto",
"//proto/typedb_service:query-proto",
"//proto/typedb_service:server-proto",
"//proto/typedb_service:transaction-proto",
"//proto/typedb_service:typedb-service",
"//proto/typedb_service:user-proto",
],
# TypeDB Core bundles JARs by maven coordinate, we can remove this when Core is rewritten in Rust
tags = ["maven_coordinates=com.typedb:typedb-protocol:{pom_version}"],
)

checkstyle_test(
name = "checkstyle",
size = "small",
include = glob(["*"]),
license_type = "mpl-header",
size = "small",
)
66 changes: 39 additions & 27 deletions grpc/nodejs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

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

load("@typedb_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
load("@typedb_bazel_distribution//npm:rules.bzl", "assemble_npm", "deploy_npm")
load("@typedb_dependencies//distribution:deployment.bzl", "deployment")
Expand All @@ -14,7 +15,10 @@ load("//grpc/nodejs:rules.bzl", "ts_grpc_compile")

npm_link_all_packages(name = "node_modules")

exports_files(["package.json", "pnpm-lock.yaml"])
exports_files([
"package.json",
"pnpm-lock.yaml",
])

load("@typedb_protocol_npm//grpc/nodejs:protoc-gen-ts/package_json.bzl", protoc_gen_ts_bin = "bin")

Expand All @@ -25,28 +29,35 @@ protoc_gen_ts_bin.protoc_gen_ts_binary(
ts_grpc_compile(
name = "typedb-protocol-src",
deps = [
"//proto:typedb-service",
"//proto:server-proto",
"//proto:user-proto",
"//proto:database-proto",
"//proto:migration-proto",
"//proto:error-proto",
"//proto:answer-proto",
"//proto:concept-proto",
"//proto:connection-proto",
"//proto:authentication-proto",
"//proto:options-proto",
"//proto:query-proto",
"//proto:transaction-proto",
"//proto:analyze-proto",
"//proto:analyzed-conjunction-proto",
"//proto:version-proto",
]
"//proto/raft_service:raft-service",
"//proto/raft_service:replication-proto",
"//proto/raft_service:request-proto",
"//proto/typedb_clustering_service:typedb-clustering-proto",
"//proto/typedb_clustering_service:typedb-clustering-service",
"//proto/typedb_service:analyze-proto",
"//proto/typedb_service:analyzed-conjunction-proto",
"//proto/typedb_service:answer-proto",
"//proto/typedb_service:authentication-proto",
"//proto/typedb_service:concept-proto",
"//proto/typedb_service:connection-proto",
"//proto/typedb_service:database-proto",
"//proto/typedb_service:error-proto",
"//proto/typedb_service:migration-proto",
"//proto/typedb_service:options-proto",
"//proto/typedb_service:query-proto",
"//proto/typedb_service:server-proto",
"//proto/typedb_service:transaction-proto",
"//proto/typedb_service:typedb-service",
"//proto/typedb_service:user-proto",
],
)

ts_project(
name = "typedb-protocol",
srcs = [":typedb-protocol-src"],
declaration = True,
transpiler = "tsc",
tsconfig = {
"compilerOptions": {
"target": "es2019",
Expand All @@ -56,26 +67,27 @@ ts_project(
},
"include": [
"proto",
]
],
},
declaration = True,
visibility = ["//visibility:public"],
deps = [
":node_modules/@grpc/grpc-js",
":node_modules/google-protobuf",
":node_modules/@types/google-protobuf",
":node_modules/@types/node",
":node_modules/google-protobuf",
":node_modules/typescript",
],
transpiler = "tsc",
visibility = ["//visibility:public"],
)

npm_package(
name = "typedb-protocol-package",
srcs = [":typedb-protocol", "package.json"],
srcs = [
"package.json",
":typedb-protocol",
],
include_external_repositories = ["typedb_protocol"],
include_runfiles = False,
package = "typedb-protocol",
include_external_repositories = ["typedb_protocol"],
visibility = ["//visibility:public"],
)

Expand All @@ -86,18 +98,18 @@ assemble_npm(

deploy_npm(
name = "deploy-npm",
target = ":assemble-npm",
snapshot = deployment["npm"]["snapshot"],
release = deployment["npm"]["release"],
snapshot = deployment["npm"]["snapshot"],
target = ":assemble-npm",
)

checkstyle_test(
name = "checkstyle",
size = "small",
include = glob(["*"]),
exclude = [
"package.json",
"pnpm-lock.yaml",
],
license_type = "mpl-header",
size = "small",
)
59 changes: 32 additions & 27 deletions grpc/rust/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,69 @@ load("@typedb_dependencies//builder/proto_grpc/rust:compile.bzl", "rust_tonic_co

rust_tonic_compile(
name = "typedb_protocol_src",
packages = ["typedb.protocol"],
srcs = [
"//proto:typedb-service",
"//proto:server-proto",
"//proto:user-proto",
"//proto:database-proto",
"//proto:migration-proto",
"//proto:error-proto",
"//proto:answer-proto",
"//proto:concept-proto",
"//proto:connection-proto",
"//proto:authentication-proto",
"//proto:options-proto",
"//proto:query-proto",
"//proto:transaction-proto",
"//proto:analyze-proto",
"//proto:analyzed-conjunction-proto",
"//proto:version-proto",
]
"//proto/raft_service:raft-service",
"//proto/raft_service:replication-proto",
"//proto/raft_service:request-proto",
"//proto/typedb_clustering_service:typedb-clustering-proto",
"//proto/typedb_clustering_service:typedb-clustering-service",
"//proto/typedb_service:analyze-proto",
"//proto/typedb_service:analyzed-conjunction-proto",
"//proto/typedb_service:answer-proto",
"//proto/typedb_service:authentication-proto",
"//proto/typedb_service:concept-proto",
"//proto/typedb_service:connection-proto",
"//proto/typedb_service:database-proto",
"//proto/typedb_service:error-proto",
"//proto/typedb_service:migration-proto",
"//proto/typedb_service:options-proto",
"//proto/typedb_service:query-proto",
"//proto/typedb_service:server-proto",
"//proto/typedb_service:transaction-proto",
"//proto/typedb_service:typedb-service",
"//proto/typedb_service:user-proto",
],
packages = ["typedb.protocol"],
)

rust_library(
name = "typedb_protocol",
crate_root = ":typedb_protocol_src",
srcs = [
":typedb_protocol_src",
],
deps = [
"@crates//:tonic",
"@crates//:prost",
],
crate_root = ":typedb_protocol_src",
tags = [
"crate-name=typedb-protocol",
],
visibility = ["//visibility:public"],
deps = [
"@crates//:prost",
"@crates//:tonic",
],
)

assemble_crate(
name = "assemble_crate",
target = ":typedb_protocol",
description = "TypeDB Protocol",
homepage = "https://github.com/typedb/typedb-protocol",
readme_file = "//:README.md",
license = "MPL-2.0",
license_file = "//:LICENSE",
readme_file = "//:README.md",
repository = "https://github.com/typedb/typedb-protocol",
target = ":typedb_protocol",
)

deploy_crate(
name = "deploy_crate",
target = ":assemble_crate",
release = deployment["crate"]["release"],
snapshot = deployment["crate"]["snapshot"],
release = deployment["crate"]["release"]
target = ":assemble_crate",
)

checkstyle_test(
name = "checkstyle",
size = "small",
include = glob(["*"]),
license_type = "mpl-header",
size = "small",
)
34 changes: 19 additions & 15 deletions grpc/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@

fn main() -> std::io::Result<()> {
let protos = vec![
"../../proto/analyze.proto",
"../../proto/answer.proto",
"../../proto/authentication.proto",
"../../proto/concept.proto",
"../../proto/connection.proto",
"../../proto/analyzed-conjunction.proto",
"../../proto/database.proto",
"../../proto/error.proto",
"../../proto/migration.proto",
"../../proto/options.proto",
"../../proto/query.proto",
"../../proto/server.proto",
"../../proto/transaction.proto",
"../../proto/typedb-service.proto",
"../../proto/user.proto",
"../../proto/raft_service/replication.proto",
"../../proto/raft_service/raft_service.proto",
"../../proto/typedb_clustering_service/typedb_clustering.proto",
"../../proto/typedb_clustering_service/typedb_clustering_service.proto",
"../../proto/typedb_service/analyze.proto",
"../../proto/typedb_service/analyzed-conjunction.proto",
"../../proto/typedb_service/answer.proto",
"../../proto/typedb_service/authentication.proto",
"../../proto/typedb_service/concept.proto",
"../../proto/typedb_service/connection.proto",
"../../proto/typedb_service/database.proto",
"../../proto/typedb_service/error.proto",
"../../proto/typedb_service/migration.proto",
"../../proto/typedb_service/options.proto",
"../../proto/typedb_service/query.proto",
"../../proto/typedb_service/server.proto",
"../../proto/typedb_service/transaction.proto",
"../../proto/typedb_service/typedb_service.proto",
"../../proto/typedb_service/user.proto",
"../../proto/version.proto",
];

Expand Down
Loading