Skip to content
Open
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
2 changes: 1 addition & 1 deletion e2e/smoke/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("@aspect_rules_ts//ts:proto.bzl", "ts_proto_library")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")

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

Expand Down
2 changes: 1 addition & 1 deletion e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local_path_override(

bazel_dep(name = "aspect_rules_js", version = "2.3.8", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.8.2", dev_dependency = True)
bazel_dep(name = "rules_proto", version = "6.0.0", dev_dependency = True)
bazel_dep(name = "protobuf", version = "33.4", dev_dependency = True)
bazel_dep(name = "toolchains_protoc", version = "0.4.3", dev_dependency = True)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
Expand Down
35 changes: 0 additions & 35 deletions e2e/smoke/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,48 +1,13 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Override http_archive for local testing
local_repository(
name = "aspect_rules_ts",
path = "../..",
)

http_archive(
name = "rules_proto",
sha256 = "303e86e722a520f6f326a50b41cfc16b98fe6d1955ce46642a5b7a67c11c0f5d",
strip_prefix = "rules_proto-6.0.0",
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.0/rules_proto-6.0.0.tar.gz",
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")

rules_proto_dependencies()

load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")

rules_proto_toolchains()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

http_archive(
name = "toolchains_protoc",
sha256 = "3019f9ed1273d547334da2004e634340c896d9e24dd6d899911e03b694fdc1f5",
strip_prefix = "toolchains_protoc-0.4.3",
url = "https://github.com/aspect-build/toolchains_protoc/releases/download/v0.4.3/toolchains_protoc-v0.4.3.tar.gz",
)

load("@toolchains_protoc//protoc:repositories.bzl", "rules_protoc_dependencies")

rules_protoc_dependencies()

load("@toolchains_protoc//protoc:toolchain.bzl", "protoc_toolchains")

protoc_toolchains(
name = "protoc_toolchains",
version = "v25.3",
)

#---SNIP--- Below here is re-used in the workspace snippet published on releases

##################
Expand Down
1 change: 1 addition & 0 deletions examples/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc
1 change: 1 addition & 0 deletions examples/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.11.0
19 changes: 16 additions & 3 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
bazel_dep(name = "aspect_rules_js", version = "2.3.8")
bazel_dep(name = "aspect_rules_js", version = "2.9.2")
bazel_dep(name = "aspect_rules_ts")
bazel_dep(name = "bazel_lib", version = "3.1.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "protobuf", version = "21.7")
bazel_dep(name = "protobuf", version = "33.4")

# Minimum versions for bazel_lib and bazel9 compat
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5", repo_name = None)
bazel_dep(name = "rules_nodejs", version = "6.7.3", repo_name = None)
bazel_dep(name = "rules_nodejs", version = "6.7.3")

local_path_override(
module_name = "aspect_rules_ts",
path = "..",
)

# TODO(alexeagle): remove this once the PR is merged
git_override(
module_name = "aspect_rules_js",
commit = "c6d592da6819db888690da84e702d295a7ca58a4", # https://github.com/aspect-build/rules_js/pull/2722
remote = "https://github.com/aspect-build/rules_js.git",
)

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version_from_nvmrc = "//:.nvmrc")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
Expand All @@ -23,8 +33,11 @@ use_repo(npm, "npm")

# Allow us to do 'bazel run @pnpm -- --dir=$PWD install'
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(pnpm_version_from = "//:package.json")
use_repo(pnpm, "pnpm")

rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps(ts_version_from = "//:package.json")
use_repo(rules_ts_ext, "npm_typescript")

register_toolchains("//tools/toolchains:all")
7 changes: 2 additions & 5 deletions examples/connect_node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ ts_project(
":node_modules/@connectrpc/connect-fastify",
":node_modules/@types/node",
":node_modules/fastify",
"//connect_node/proto:eliza_ts_proto",
"//connect_node/proto:eliza_proto",
],
)

# Try it out:
# $ bazel run server
# $ curl \
# --header 'Content-Type: application/json' \
# --data '{"sentence": "I feel happy."}' \
# http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say
# $ curl --header 'Content-Type: application/json' --data '{"sentence": "Hello from connect-rpc"}' http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say
js_binary(
name = "server",
data = [
Expand Down
7 changes: 2 additions & 5 deletions examples/connect_node/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"dependencies": {
"@bufbuild/protobuf": "^2.2.4",
"@bufbuild/protobuf": "catalog:",
"@connectrpc/connect": "^2.0.2",
"@connectrpc/connect-fastify": "^2.0.2",
"fastify": "^5.2.1"
},
"devDependencies": {
"@bufbuild/buf": "^1.50.1",
"@bufbuild/protoc-gen-es": "~2.2.4",
"@connectrpc/protoc-gen-connect-query": "^2.0.1",
"@types/node": "^20.19.11"
"@types/node": "catalog:"
},
"type": "module",
"scripts": {
Expand Down
22 changes: 7 additions & 15 deletions examples/connect_node/proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:proto.bzl", "ts_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")

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

proto_srcs = ["eliza.proto"]

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

ts_proto_library(
name = "eliza_ts_proto",
gen_connect_query = True,
gen_connect_query_service_mapping = {
"eliza.proto": ["ElizaService"],
},
node_modules = "//connect_node:node_modules",
proto = ":eliza_proto",
proto_srcs = proto_srcs,
)
# FIXME: this is supposed to create connect_query code
# gen_connect_query = True,
# gen_connect_query_service_mapping = {
# "eliza.proto": ["ElizaService"],
# },

js_library(
name = "proto",
srcs = [":package.json"],
deps = ["eliza_ts_proto"],
deps = ["eliza_proto"],
)
10 changes: 0 additions & 10 deletions examples/connect_node/proto/eliza-ElizaService_connectquery.d.ts

This file was deleted.

58 changes: 0 additions & 58 deletions examples/connect_node/proto/eliza_pb.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion examples/linked_lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"devDependencies": {
"@aspect-test/f": "1.0.0",
"@types/node": "^20.19.11"
"@types/node": "catalog:"
}
}
2 changes: 1 addition & 1 deletion examples/linked_pkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"devDependencies": {
"@aspect-test/f": "1.0.0",
"@types/node": "^20.19.11"
"@types/node": "catalog:"
}
}
2 changes: 1 addition & 1 deletion examples/linked_tsconfig_consumer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"private": true,
"devDependencies": {
"@lib/tsconfig": "workspace:*",
"@types/node": "^20.19.11"
"@types/node": "catalog:"
}
}
6 changes: 4 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"packageManager": "pnpm@10.20.0",
"dependencies": {
"@angular/compiler": "^19.0.0-next.2",
"@angular/compiler-cli": "^19.0.0-next.2",
Expand All @@ -10,12 +11,13 @@
"@babel/plugin-transform-modules-commonjs": "~7.26.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/types": "~7.23.9",
"@bufbuild/protobuf": "catalog:",
"@tsconfig/strictest": "2.0.5",
"@types/node": "^20.19.11",
"@types/node": "catalog:",
"date-fns": "2.29.3",
"rxjs": "7.5.7",
"source-map-support": "^0.5.21",
"typescript": "5.6.2",
"typescript": "5.8.2",
"zone.js": "0.12.0"
},
"devDependencies": {
Expand Down
Loading
Loading