Skip to content

Commit

Permalink
feat: upgrade to rules_js 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed May 8, 2024
1 parent abbde88 commit 8621ebc
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 66 deletions.
17 changes: 8 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module(
)

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

# Need feat: backport 2.x features for interoperability by @kormide in #657
Expand All @@ -15,6 +16,12 @@ 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.1")
bazel_dep(name = "aspect_rules_js", version = "2.0.0-alpha.3")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "rules_nodejs", version = "6.1.0")
>>>>>>> 95b76e4 (feat: upgrade to rules_js 2.0)
bazel_dep(name = "platforms", version = "0.0.5")

rollup = use_extension("@aspect_rules_rollup//rollup:extensions.bzl", "rollup")
Expand All @@ -27,6 +34,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 +44,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.1", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "2.0.0-alpha.3", 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
23 changes: 23 additions & 0 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Our "development" dependencies
Users should *not* need to install these. If users see a load()
statement from these, that's a bug in our distribution.
"""

# buildifier: disable=bzl-visibility
load("//rollup/private:maybe.bzl", http_archive = "maybe_http_archive")

def rules_rollup_internal_deps():
"Fetch deps needed for local development"
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"],
)

http_archive(
name = "buildifier_prebuilt",
sha256 = "8ada9d88e51ebf5a1fdff37d75ed41d51f5e677cdbeafb0a22dda54747d6e07e",
strip_prefix = "buildifier-prebuilt-6.4.0",
urls = ["http://github.com/keith/buildifier-prebuilt/archive/6.4.0.tar.gz"],
)
Loading

0 comments on commit 8621ebc

Please sign in to comment.