Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support --incompatible_disallow_empty_glob #731

Merged
merged 5 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import %workspace%/.aspect/bazelrc/performance.bazelrc
common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
common --@aspect_rules_ts//ts:default_to_tsc_transpiler

# We have some empty globs in this repo
common --noincompatible_disallow_empty_glob
# opt-in to flag that is on by default in Bazel 8
common --incompatible_disallow_empty_glob

# Never Compile protoc Again
common --incompatible_enable_proto_toolchain_resolution
Expand Down
9 changes: 1 addition & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True
bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_nodejs", version = "6.2.0", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "toolchains_protoc", version = "0.3.0", dev_dependency = True)

# Should not be required, stardoc leaks a dependency
Expand All @@ -38,13 +38,6 @@ register_toolchains(
dev_dependency = True,
)

# pick up fix: https://github.com/bazelbuild/stardoc/pull/221
git_override(
module_name = "stardoc",
commit = "3baa5d1761970c6285d2ac9c3adccfaac42f54c5",
remote = "https://github.com/bazelbuild/stardoc.git",
)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
Expand Down
2 changes: 2 additions & 0 deletions docs/proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Future work
## ts_proto_library

<pre>
load("@aspect_rules_ts//ts:proto.bzl", "ts_proto_library")

ts_proto_library(<a href="#ts_proto_library-name">name</a>, <a href="#ts_proto_library-node_modules">node_modules</a>, <a href="#ts_proto_library-proto">proto</a>, <a href="#ts_proto_library-protoc_gen_options">protoc_gen_options</a>, <a href="#ts_proto_library-gen_connect_es">gen_connect_es</a>, <a href="#ts_proto_library-gen_connect_query">gen_connect_query</a>,
<a href="#ts_proto_library-gen_connect_query_service_mapping">gen_connect_query_service_mapping</a>, <a href="#ts_proto_library-copy_files">copy_files</a>, <a href="#ts_proto_library-proto_srcs">proto_srcs</a>, <a href="#ts_proto_library-files_to_copy">files_to_copy</a>, <a href="#ts_proto_library-kwargs">kwargs</a>)
</pre>
Expand Down
2 changes: 2 additions & 0 deletions docs/repositories.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion docs/rules.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def rules_ts_internal_deps():

http_archive(
name = "io_bazel_stardoc",
sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
urls = ["https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz"],
sha256 = "fabb280f6c92a3b55eed89a918ca91e39fb733373c81e87a18ae9e33e75023ec",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
alexeagle marked this conversation as resolved.
Show resolved Hide resolved
"https://github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
],
)

http_archive(
Expand Down
4 changes: 2 additions & 2 deletions ts/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _is_file_missing(label):
"""
file_abs = "%s/%s" % (label.package, label.name)
file_rel = file_abs[len(native.package_name()) + 1:]
file_glob = native.glob([file_rel])
file_glob = native.glob([file_rel], allow_empty = True)
return len(file_glob) == 0

_tsc = "@npm_typescript//:tsc"
Expand Down Expand Up @@ -475,7 +475,7 @@ def _default_srcs(allow_js, resolve_json_module):
include.append("**/*.json")
exclude.extend(["**/package.json", "**/package-lock.json", "**/tsconfig*.json"])

return native.glob(include, exclude)
return native.glob(include, exclude, allow_empty = True)

def _invoke_custom_transpiler(type_str, transpiler, transpile_target_name, srcs, common_kwargs):
if type(transpiler) == "function" or type(transpiler) == "rule":
Expand Down
Loading