Skip to content

Commit

Permalink
chore: misc cleanup (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored May 9, 2024
1 parent 0ae9976 commit bf41f2d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
10 changes: 4 additions & 6 deletions e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"Bazel dependencies"

bazel_dep(name = "aspect_bazel_lib", version = "1.38.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_terser", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "1.31.0", dev_dependency = True)

local_path_override(
module_name = "aspect_rules_terser",
path = "../..",
)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
bazel_dep(name = "aspect_bazel_lib", version = "1.38.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "1.31.0", dev_dependency = True)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
Expand Down
5 changes: 3 additions & 2 deletions terser/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//terser/private:is_bazel_7_or_greater.bzl", "is_bazel_7_or_greater")

# For stardoc to reference the files
exports_files(["defs.bzl"])
Expand All @@ -10,7 +11,7 @@ bzl_library(
deps = [
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if is_bazel_7_or_greater() else []),
)

bzl_library(
Expand All @@ -21,5 +22,5 @@ bzl_library(
"//terser/private:terser",
"@aspect_bazel_lib//lib:copy_file",
"@aspect_rules_js//js:defs",
],
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if is_bazel_7_or_greater() else []),
)
1 change: 0 additions & 1 deletion terser/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ bzl_library(
"@aspect_bazel_lib//lib:copy_to_bin",
"@aspect_rules_js//js:libs",
"@aspect_rules_js//js:providers",
"@rules_nodejs//nodejs:bzl",
],
)
7 changes: 7 additions & 0 deletions terser/private/is_bazel_7_or_greater.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"is_bazel_7_or_greater"

def is_bazel_7_or_greater():
# Vendored in from https://github.com/aspect-build/bazel-lib/blob/adad7889c925c4f22a2f84568268f0a62e7c2fb0/lib/private/utils.bzl#L208
# so that rules_js remains compatible with aspect_bazel_lib >= 2.0.0 and < 2.2.0.
# TODO(2.0): remove this and switch to the upstream function and bump minimum aspect_bazel_lib version to 2.2.0
return "apple_binary" not in dir(native) and "cc_host_toolchain_alias" not in dir(native)

0 comments on commit bf41f2d

Please sign in to comment.