Skip to content

Commit

Permalink
remove: test against bazel-lib 2.0 and rules_js updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kormide committed Nov 16, 2023
1 parent f5c0e14 commit 303ff19
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 10 deletions.
14 changes: 14 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "aspect_rules_js", version = "1.33.3")
bazel_dep(name = "aspect_bazel_lib", version = "1.29.2")

# TODO: remove before landing
archive_override(
module_name = "aspect_bazel_lib",
patches = ["//:version.patch"],
strip_prefix = "bazel-lib-14f685015cb1219a9ee2c83859a5c1e79fa0ca27",
urls = ["https://github.com/kormide/bazel-lib/archive/14f685015cb1219a9ee2c83859a5c1e79fa0ca27.zip"],
)

archive_override(
module_name = "aspect_rules_js",
strip_prefix = "rules_js-0085348f221540e9c1712db1ca944d2fd8ae7666",
urls = ["https://github.com/kormide/rules_js/archive/0085348f221540e9c1712db1ca944d2fd8ae7666.zip"],
)

# Similar to rules_python/MODULE.bazel, see https://github.com/bazelbuild/rules_python/pull/832
# These are loaded only when using ts_proto_library
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
Expand Down
14 changes: 14 additions & 0 deletions e2e/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ local_path_override(
path = "../..",
)

# TODO: remove before landing
archive_override(
module_name = "aspect_bazel_lib",
patches = ["//:version.patch"],
strip_prefix = "bazel-lib-14f685015cb1219a9ee2c83859a5c1e79fa0ca27",
urls = ["https://github.com/kormide/bazel-lib/archive/14f685015cb1219a9ee2c83859a5c1e79fa0ca27.zip"],
)

archive_override(
module_name = "aspect_rules_js",
strip_prefix = "rules_js-0085348f221540e9c1712db1ca944d2fd8ae7666",
urls = ["https://github.com/kormide/rules_js/archive/0085348f221540e9c1712db1ca944d2fd8ae7666.zip"],
)

npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
Expand Down
12 changes: 12 additions & 0 deletions e2e/bzlmod/version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git tools/version.bzl tools/version.bzl
index cd62824..486d94f 100755
--- tools/version.bzl
+++ tools/version.bzl
@@ -2,6 +2,6 @@

# This is automagically replace by git during git archive using `git export-subst`
# See https://git-scm.com/docs/git-archive#Documentation/git-archive.txt-export-subst
-_VERSION_PRIVATE = "v0.8.1-485-g14f68501"
+_VERSION_PRIVATE = "v2.0.0"

VERSION = "0.0.0" if _VERSION_PRIVATE.startswith("$Format") else _VERSION_PRIVATE.replace("v", "", 1)
5 changes: 5 additions & 0 deletions e2e/external_dep/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

# TODO: remove after landing
load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")

register_coreutils_toolchains()

# Fetch and register node, if you haven't already
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

Expand Down
5 changes: 5 additions & 0 deletions e2e/external_dep/app/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

# TODO: remove after landing
load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")

register_coreutils_toolchains()

# Fetch and register node, if you haven't already
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

Expand Down
5 changes: 5 additions & 0 deletions e2e/worker/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

# TODO: remove after landing
load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")

register_coreutils_toolchains()

# Fetch and register node, if you haven't already
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

Expand Down
9 changes: 5 additions & 4 deletions e2e/workspace/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

# TODO: remove after landing
load("@aspect_bazel_lib//lib:repositories.bzl", "register_copy_directory_toolchains", "register_copy_to_directory_toolchains", "register_coreutils_toolchains")

register_coreutils_toolchains()

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

bazel_features_deps()
Expand All @@ -41,10 +46,6 @@ nodejs_register_toolchains(
node_version = DEFAULT_NODE_VERSION,
)

# Register aspect_bazel_lib toolchains;
# If you use npm_translate_lock or npm_import from aspect_rules_js you can omit this block.
load("@aspect_bazel_lib//lib:repositories.bzl", "register_copy_directory_toolchains", "register_copy_to_directory_toolchains")

register_copy_directory_toolchains()

register_copy_to_directory_toolchains()
29 changes: 23 additions & 6 deletions ts/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,35 @@ def rules_ts_bazel_dependencies():
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz"],
)

# http_archive(
# name = "aspect_bazel_lib",
# sha256 = "ee95bbc80f9ca219b93a8cc49fa19a2d4aa8649ddc9024f46abcdd33935753ca",
# strip_prefix = "bazel-lib-1.29.2",
# url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.29.2/bazel-lib-v1.29.2.tar.gz",
# )

# TODO: remove before landing
http_archive(
name = "aspect_bazel_lib",
sha256 = "ee95bbc80f9ca219b93a8cc49fa19a2d4aa8649ddc9024f46abcdd33935753ca",
strip_prefix = "bazel-lib-1.29.2",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.29.2/bazel-lib-v1.29.2.tar.gz",
strip_prefix = "bazel-lib-14f685015cb1219a9ee2c83859a5c1e79fa0ca27",
url = "https://github.com/kormide/bazel-lib/archive/14f685015cb1219a9ee2c83859a5c1e79fa0ca27.zip",
patches = [
"@aspect_rules_ts//:version.patch",
],
)

# http_archive(
# name = "aspect_rules_js",
# sha256 = "295a73d963bad4b04a3c488d60dc8a76a659ee64708be3a66be75726e6277c7e",
# strip_prefix = "rules_js-1.33.3",
# url = "https://github.com/aspect-build/rules_js/releases/download/v1.33.3/rules_js-v1.33.3.tar.gz",
# )

# TODO: remove before landing
http_archive(
name = "aspect_rules_js",
sha256 = "295a73d963bad4b04a3c488d60dc8a76a659ee64708be3a66be75726e6277c7e",
strip_prefix = "rules_js-1.33.3",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.33.3/rules_js-v1.33.3.tar.gz",
strip_prefix = "rules_js-0085348f221540e9c1712db1ca944d2fd8ae7666",
url = "https://github.com/kormide/rules_js/archive/0085348f221540e9c1712db1ca944d2fd8ae7666.zip",
)

http_archive(
Expand Down
12 changes: 12 additions & 0 deletions version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git tools/version.bzl tools/version.bzl
index cd62824..486d94f 100755
--- tools/version.bzl
+++ tools/version.bzl
@@ -2,6 +2,6 @@

# This is automagically replace by git during git archive using `git export-subst`
# See https://git-scm.com/docs/git-archive#Documentation/git-archive.txt-export-subst
-_VERSION_PRIVATE = "v0.8.1-485-g14f68501"
+_VERSION_PRIVATE = "v2.0.0"

VERSION = "0.0.0" if _VERSION_PRIVATE.startswith("$Format") else _VERSION_PRIVATE.replace("v", "", 1)

0 comments on commit 303ff19

Please sign in to comment.