Skip to content

Commit

Permalink
feat: upgrade to rules_js 2.0 (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored May 22, 2024
1 parent 0c3e66b commit ca48fe7
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 74 deletions.
1 change: 1 addition & 0 deletions .aspect/bazelrc/javascript.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
# details.
# Docs: https://nodejs.org/en/docs/guides/debugging-getting-started/#command-line-options
run:debug -- --node_options=--inspect-brk
test:debug --test_env=NODE_OPTIONS=--inspect-brk
22 changes: 5 additions & 17 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ module(
)

# Lower-bounds (minimum) versions for direct runtime dependencies
bazel_dep(name = "bazel_skylib", version = "1.3.0")

# Need feat: backport 2.x features for interoperability by @kormide in #657
bazel_dep(name = "aspect_bazel_lib", version = "1.38.0")

# Need feat: import toolchains to use for copy actions by @kormide in #1355
bazel_dep(name = "aspect_rules_js", version = "1.34.0")
bazel_dep(name = "rules_nodejs", version = "5.5.3")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.3")
bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "rules_nodejs", version = "6.1.0")
bazel_dep(name = "platforms", version = "0.0.5")

rollup = use_extension("@aspect_rules_rollup//rollup:extensions.bzl", "rollup")
Expand All @@ -27,6 +23,7 @@ use_repo(rollup, "rollup")
####### Dev dependencies ########

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
Expand All @@ -36,12 +33,3 @@ npm.npm_translate_lock(
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# We want the stardoc handling from bazel-lib 2.x for dev use here,
# but not force users to upgrade yet.
archive_override(
module_name = "aspect_bazel_lib",
integrity = "sha256-9ep2aCsgnMC9kND1o7JtL3pqKIXwxfYV5ykT9IBduw0=",
strip_prefix = "bazel-lib-2.5.0",
urls = ["https://github.com/aspect-build/bazel-lib/releases/download/v2.5.0/bazel-lib-v2.5.0.tar.gz"],
)
28 changes: 14 additions & 14 deletions docs/rollup.md

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

6 changes: 3 additions & 3 deletions e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ local_path_override(
path = "../..",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.2.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "1.35.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.3.0", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "2.7.3", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
Expand Down
10 changes: 4 additions & 6 deletions e2e/smoke/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()

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

nodejs_register_toolchains(
name = "node",
node_version = DEFAULT_NODE_VERSION,
)
load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains")

rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION)

load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
name = "npm",
Expand Down
21 changes: 11 additions & 10 deletions rollup/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@ load("//rollup/private:maybe.bzl", http_archive = "maybe_http_archive")
def rules_rollup_dependencies():
http_archive(
name = "bazel_skylib",
sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz"],
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
)

http_archive(
name = "aspect_bazel_lib",
sha256 = "b848cd8e93be7f18c3deda6d2f3ade92a657d3585e119953bc50dc75fef535c2",
strip_prefix = "bazel-lib-1.38.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.38.0/bazel-lib-v1.38.0.tar.gz",
sha256 = "87ab4ec479ebeb00d286266aca2068caeef1bb0b1765e8f71c7b6cfee6af4226",
strip_prefix = "bazel-lib-2.7.3",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.7.3/bazel-lib-v2.7.3.tar.gz",
)

http_archive(
name = "aspect_rules_js",
sha256 = "7b2a4d1d264e105eae49a27e2e78065b23e2e45724df2251eacdd317e95bfdfd",
strip_prefix = "rules_js-1.31.0",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.31.0/rules_js-v1.31.0.tar.gz",
sha256 = "389021e29b3aeed2f6fb3a7a1478f8fc52947a6500b198a7ec0f3358c2842415",
strip_prefix = "rules_js-2.0.0-rc0",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc0/rules_js-v2.0.0-rc0.tar.gz",
)

http_archive(
name = "rules_nodejs",
sha256 = "764a3b3757bb8c3c6a02ba3344731a3d71e558220adcb0cf7e43c9bba2c37ba8",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-core-5.8.2.tar.gz"],
sha256 = "dddd60acc3f2f30359bef502c9d788f67e33814b0ddd99aa27c5a15eb7a41b8c",
strip_prefix = "rules_nodejs-6.1.0",
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.1.0/rules_nodejs-v6.1.0.tar.gz",
)
Loading

0 comments on commit ca48fe7

Please sign in to comment.