From 99275cdc6d57e5d66a67cb2c94616859524c7cb3 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 22 Apr 2024 15:48:19 -0700 Subject: [PATCH] chore: cleanup WORKSPACE and MODULE.bazel files (#1673) --- .bazeliskrc | 2 +- .github/workflows/buildifier.yaml | 20 +++++++++++ .github/workflows/release_prep.sh | 2 +- .pre-commit-config.yaml | 6 ++-- BUILD.bazel | 4 ++- MODULE.bazel | 2 +- WORKSPACE | 5 +-- e2e/bzlmod/MODULE.bazel | 14 +++----- e2e/git_dep_metadata/MODULE.bazel | 7 +--- e2e/gyp_no_install_script/MODULE.bazel | 14 +++++--- .../MODULE.bazel | 0 e2e/js_image_docker/WORKSPACE | 21 ++++++++---- e2e/js_run_devserver/MODULE.bazel | 34 +++++++++++-------- e2e/npm_link_package-esm/WORKSPACE | 2 +- e2e/npm_link_package/WORKSPACE | 2 +- e2e/npm_translate_lock/MODULE.bazel | 22 ++++++------ e2e/npm_translate_lock_auth/MODULE.bazel | 17 +++++----- e2e/npm_translate_lock_empty/MODULE.bazel | 22 ++++++------ e2e/npm_translate_lock_git+ssh/MODULE.bazel | 17 +++++----- e2e/npm_translate_lock_multi/MODULE.bazel | 17 +++++----- .../MODULE.bazel | 17 +++++----- .../MODULE.bazel | 8 +++-- e2e/npm_translate_package_lock/MODULE.bazel | 17 +++++----- e2e/npm_translate_yarn_lock/MODULE.bazel | 23 +++++++------ e2e/package_json_module/MODULE.bazel | 14 ++++---- e2e/patch_from_repo/MODULE.bazel | 14 +++++--- e2e/pnpm_lockfiles/MODULE.bazel | 28 ++++++++------- e2e/pnpm_lockfiles/WORKSPACE | 7 ---- e2e/pnpm_repo_install/MODULE.bazel | 29 ++++++++++------ e2e/pnpm_workspace/MODULE.bazel | 27 ++++++++------- e2e/pnpm_workspace_deps/MODULE.bazel | 14 ++++---- e2e/pnpm_workspace_rerooted/MODULE.bazel | 23 +++++++------ e2e/rules_foo/WORKSPACE | 5 ++- e2e/rules_foo/foo/repositories.bzl | 6 ++-- e2e/stamped_package_json/MODULE.bazel | 11 ++---- e2e/update_pnpm_lock/MODULE.bazel | 17 +++++----- e2e/update_pnpm_lock_with_import/MODULE.bazel | 17 +++++----- e2e/vendored_node/MODULE.bazel | 14 +++----- e2e/vendored_tarfile/MODULE.bazel | 17 +++++----- e2e/verify_patches/MODULE.bazel | 17 +++++----- e2e/webpack_devserver/MODULE.bazel | 25 ++++++++++---- e2e/webpack_devserver_esm/MODULE.bazel | 25 ++++++++++---- e2e/worker/MODULE.bazel | 21 ++++++------ js/repositories.bzl | 4 +-- 44 files changed, 336 insertions(+), 294 deletions(-) create mode 100644 .github/workflows/buildifier.yaml rename e2e/{rules_foo => js_image_docker}/MODULE.bazel (100%) diff --git a/.bazeliskrc b/.bazeliskrc index 83387c80a..269fbb0a0 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1,2 +1,2 @@ BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download -USE_BAZEL_VERSION=aspect/5.9.24 +USE_BAZEL_VERSION=aspect/5.9.25 diff --git a/.github/workflows/buildifier.yaml b/.github/workflows/buildifier.yaml new file mode 100644 index 000000000..c5395fb3b --- /dev/null +++ b/.github/workflows/buildifier.yaml @@ -0,0 +1,20 @@ +name: Buildifier + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [main] + pull_request: + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: buildifier + run: bazel run --enable_bzlmod //:buildifier.check diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 8b80e7d9b..5295fb8b6 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -34,7 +34,7 @@ bazel_dep(name = "aspect_rules_js", version = "${TAG:1}") # By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl # Optionally you can pin a different node version: bazel_dep(name = "rules_nodejs", version = "6.1.0") -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) node.toolchain(node_version = "16.14.2") ################################# diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0912b007f..5a44fc6c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,19 +9,19 @@ default_stages: [commit] repos: # Check formatting and lint for starlark code - repo: https://github.com/keith/pre-commit-buildifier - rev: 6.1.0.1 + rev: 6.4.0 hooks: - id: buildifier - id: buildifier-lint # Enforce that commit messages allow for later changelog generation - repo: https://github.com/commitizen-tools/commitizen - rev: v2.18.0 + rev: v3.24.0 hooks: # Requires that commitizen is already installed - id: commitizen stages: [commit-msg] - repo: https://github.com/pre-commit/mirrors-prettier - rev: 'v2.4.0' + rev: v3.1.0 hooks: - id: prettier - repo: https://github.com/koalaman/shellcheck-precommit diff --git a/BUILD.bazel b/BUILD.bazel index d1da4f59d..6f79f9251 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -5,8 +5,8 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@npm//:defs.bzl", "npm_link_all_packages", "npm_link_targets") load("@pnpm__links//:defs.bzl", npm_link_pnpm = "npm_link_imported_package") -load("//npm:defs.bzl", "npm_link_package") load("//js:defs.bzl", "js_library") +load("//npm:defs.bzl", "npm_link_package") # Link all packages from the /WORKSPACE npm_translate_lock(name = "npm") and also packages from # manual /WORKSPACE npm_import rules to bazel-bin/node_modules as well as the package store @@ -99,6 +99,7 @@ buildifier( lint_mode = "fix", lint_warnings = ["-out-of-order-load"], # TODO: enable out-of-order-load mode = "fix", + tags = ["manual"], # tag as manual so windows ci does not build it by default ) buildifier( @@ -107,6 +108,7 @@ buildifier( lint_mode = "warn", lint_warnings = ["-out-of-order-load"], # TODO: enable out-of-order-load mode = "diff", + tags = ["manual"], # tag as manual so windows ci does not build it by default ) alias( diff --git a/MODULE.bazel b/MODULE.bazel index 47a847dae..340021b03 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -11,8 +11,8 @@ module( bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "bazel_features", version = "1.9.0") 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") +bazel_dep(name = "rules_nodejs", version = "6.1.0") node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") use_repo(node, "nodejs_darwin_amd64") diff --git a/WORKSPACE b/WORKSPACE index aecad2751..69886b03b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,7 +1,4 @@ -workspace( - # see https://docs.bazel.build/versions/main/skylark/deploying.html#workspace - name = "aspect_rules_js", -) +workspace(name = "aspect_rules_js") # buildifier: disable=bzl-visibility load("//js/private:dev_deps.bzl", "rules_js_dev_dependencies") diff --git a/e2e/bzlmod/MODULE.bazel b/e2e/bzlmod/MODULE.bazel index c8a8b1953..9feb72fc2 100644 --- a/e2e/bzlmod/MODULE.bazel +++ b/e2e/bzlmod/MODULE.bazel @@ -1,18 +1,12 @@ -module( - name = "e2e_bzlmod", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "bazel_skylib", version = "1.5.0") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", 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", diff --git a/e2e/git_dep_metadata/MODULE.bazel b/e2e/git_dep_metadata/MODULE.bazel index 53790230c..d94ace341 100644 --- a/e2e/git_dep_metadata/MODULE.bazel +++ b/e2e/git_dep_metadata/MODULE.bazel @@ -1,9 +1,4 @@ -module( - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", diff --git a/e2e/gyp_no_install_script/MODULE.bazel b/e2e/gyp_no_install_script/MODULE.bazel index 86ed09043..618f68dcf 100644 --- a/e2e/gyp_no_install_script/MODULE.bazel +++ b/e2e/gyp_no_install_script/MODULE.bazel @@ -1,13 +1,17 @@ -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "platforms", version = "0.0.8") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "platforms", version = "0.0.9", dev_dependency = True) + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = ["//:package.json"], diff --git a/e2e/rules_foo/MODULE.bazel b/e2e/js_image_docker/MODULE.bazel similarity index 100% rename from e2e/rules_foo/MODULE.bazel rename to e2e/js_image_docker/MODULE.bazel diff --git a/e2e/js_image_docker/WORKSPACE b/e2e/js_image_docker/WORKSPACE index d6bb744b9..e222ae805 100644 --- a/e2e/js_image_docker/WORKSPACE +++ b/e2e/js_image_docker/WORKSPACE @@ -29,13 +29,6 @@ load("@npm//:repositories.bzl", "npm_repositories") npm_repositories() -# TODO: remove when rules_? upgrades to modern version supporting -http_archive( - name = "bazel_gazelle", - integrity = "sha256-dd8ojEsxyB61D1Hi4U9HY8t1SNquEmgXJHBkY3/Z6mI=", - urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz"], -) - ### # Setup rules_docker # rules_docker does not work with M1 macs due to ancient rules_go version. @@ -54,6 +47,20 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip"], ) +# Bring in a newer version of bazel_gazelle to work-around an incompatability with an older +# version that is brought in transitively below that is incompatible with newer versions of rules_go. +# Error when this is not done is: +# ERROR: Traceback (most recent call last): +# File "/private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/bazel_gazelle/internal/go_repository_tools.bzl", line 15, column 52, in +# load("@io_bazel_rules_go//go/private:common.bzl", "env_execute", "executable_extension") +# Error: file '@io_bazel_rules_go//go/private:common.bzl' does not contain symbol 'env_execute' +# ERROR: Error computing the main repository mapping: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/io_bazel_rules_docker/repositories/deps.bzl:22:6: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/io_bazel_rules_docker/repositories/go_repositories.bzl:22:6: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/bazel_gazelle/deps.bzl:24:5: initialization of module 'internal/go_repository_tools.bzl' failed +http_archive( + name = "bazel_gazelle", + integrity = "sha256-dd8ojEsxyB61D1Hi4U9HY8t1SNquEmgXJHBkY3/Z6mI=", + urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz"], +) + load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() diff --git a/e2e/js_run_devserver/MODULE.bazel b/e2e/js_run_devserver/MODULE.bazel index d0d7d9c42..b5d42df7d 100644 --- a/e2e/js_run_devserver/MODULE.bazel +++ b/e2e/js_run_devserver/MODULE.bazel @@ -1,23 +1,25 @@ -module( - name = "e2e_js_run_devserver", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_go", version = "0.46.0") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True) + +pnpm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "pnpm", + dev_dependency = True, +) use_repo(pnpm, "pnpm") -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", bins = { @@ -32,7 +34,11 @@ npm.npm_translate_lock( ) use_repo(npm, "npm") -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk = use_extension( + "@rules_go//go:extensions.bzl", + "go_sdk", + dev_dependency = True, +) go_sdk.download( name = "go_sdk", version = "1.20.3", diff --git a/e2e/npm_link_package-esm/WORKSPACE b/e2e/npm_link_package-esm/WORKSPACE index 24f3d24ef..1bd1792c1 100644 --- a/e2e/npm_link_package-esm/WORKSPACE +++ b/e2e/npm_link_package-esm/WORKSPACE @@ -43,7 +43,7 @@ local_repository( load("@rules_foo//foo:repositories.bzl", "foo_repositories") -foo_repositories(name = "foo") +foo_repositories() load("@foo//:npm_repositories.bzl", foo_npm_repositories = "npm_repositories") diff --git a/e2e/npm_link_package/WORKSPACE b/e2e/npm_link_package/WORKSPACE index 4a84efd25..1f0debd8c 100644 --- a/e2e/npm_link_package/WORKSPACE +++ b/e2e/npm_link_package/WORKSPACE @@ -44,7 +44,7 @@ local_repository( load("@rules_foo//foo:repositories.bzl", "foo_repositories") -foo_repositories(name = "foo") +foo_repositories() load("@foo//:npm_repositories.bzl", foo_npm_repositories = "npm_repositories") diff --git a/e2e/npm_translate_lock/MODULE.bazel b/e2e/npm_translate_lock/MODULE.bazel index c83b1fcea..f601005eb 100644 --- a/e2e/npm_translate_lock/MODULE.bazel +++ b/e2e/npm_translate_lock/MODULE.bazel @@ -1,20 +1,18 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "platforms", version = "0.0.8") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "platforms", version = "0.0.9", dev_dependency = True) + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = ["//:package.json"], diff --git a/e2e/npm_translate_lock_auth/MODULE.bazel b/e2e/npm_translate_lock_auth/MODULE.bazel index b3beb9aa9..88a8992eb 100644 --- a/e2e/npm_translate_lock_auth/MODULE.bazel +++ b/e2e/npm_translate_lock_auth/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock_auth", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = ["//:package.json"], diff --git a/e2e/npm_translate_lock_empty/MODULE.bazel b/e2e/npm_translate_lock_empty/MODULE.bazel index 6b6bda52c..e7cf2b700 100644 --- a/e2e/npm_translate_lock_empty/MODULE.bazel +++ b/e2e/npm_translate_lock_empty/MODULE.bazel @@ -1,20 +1,18 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "platforms", version = "0.0.8") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "platforms", version = "0.0.9", dev_dependency = True) + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = ["//:package.json"], diff --git a/e2e/npm_translate_lock_git+ssh/MODULE.bazel b/e2e/npm_translate_lock_git+ssh/MODULE.bazel index e99465505..88a8992eb 100644 --- a/e2e/npm_translate_lock_git+ssh/MODULE.bazel +++ b/e2e/npm_translate_lock_git+ssh/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock_git_ssh", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = ["//:package.json"], diff --git a/e2e/npm_translate_lock_multi/MODULE.bazel b/e2e/npm_translate_lock_multi/MODULE.bazel index 4f55561b7..e48a3a3f7 100644 --- a/e2e/npm_translate_lock_multi/MODULE.bazel +++ b/e2e/npm_translate_lock_multi/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock_multi", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "app1_npm", npmrc = "//:.npmrc", diff --git a/e2e/npm_translate_lock_partial_clone/MODULE.bazel b/e2e/npm_translate_lock_partial_clone/MODULE.bazel index 1d3c70bcb..569a7017a 100644 --- a/e2e/npm_translate_lock_partial_clone/MODULE.bazel +++ b/e2e/npm_translate_lock_partial_clone/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = [ diff --git a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel index 972ad6778..f4fc95de1 100644 --- a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel +++ b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel @@ -1,10 +1,14 @@ -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = [ diff --git a/e2e/npm_translate_package_lock/MODULE.bazel b/e2e/npm_translate_package_lock/MODULE.bazel index 957f9b26a..c812bab98 100644 --- a/e2e/npm_translate_package_lock/MODULE.bazel +++ b/e2e/npm_translate_package_lock/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_translate_package_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = ["//:package.json"], diff --git a/e2e/npm_translate_yarn_lock/MODULE.bazel b/e2e/npm_translate_yarn_lock/MODULE.bazel index a4b07e9c9..bb1c70ab2 100644 --- a/e2e/npm_translate_yarn_lock/MODULE.bazel +++ b/e2e/npm_translate_yarn_lock/MODULE.bazel @@ -1,24 +1,27 @@ -module( - name = "e2e_translate_yarn_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) + +pnpm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "pnpm", + dev_dependency = True, +) pnpm.pnpm( name = "pnpm-old-version", pnpm_version = "7.33.3", ) use_repo(pnpm, "pnpm-old-version") -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = ["//:package.json"], diff --git a/e2e/package_json_module/MODULE.bazel b/e2e/package_json_module/MODULE.bazel index d6b31cce7..f30ea4d6b 100644 --- a/e2e/package_json_module/MODULE.bazel +++ b/e2e/package_json_module/MODULE.bazel @@ -1,16 +1,14 @@ -module( - name = "e2e_package_json_module", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", npmrc = "//:.npmrc", diff --git a/e2e/patch_from_repo/MODULE.bazel b/e2e/patch_from_repo/MODULE.bazel index 6e0a7d0ad..caffac86a 100644 --- a/e2e/patch_from_repo/MODULE.bazel +++ b/e2e/patch_from_repo/MODULE.bazel @@ -1,18 +1,22 @@ -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "local_repo", version = "0.0.0") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) +bazel_dep(name = "local_repo", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "local_repo", path = "./local_repo", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = [ diff --git a/e2e/pnpm_lockfiles/MODULE.bazel b/e2e/pnpm_lockfiles/MODULE.bazel index 7b7e77a94..478a7ba51 100644 --- a/e2e/pnpm_lockfiles/MODULE.bazel +++ b/e2e/pnpm_lockfiles/MODULE.bazel @@ -1,26 +1,30 @@ -module( - name = "e2e_pnpm_lockfiles", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") + +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + +node = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) use_repo(node, "nodejs_toolchains") use_repo(node, "nodejs_darwin_amd64") use_repo(node, "nodejs_darwin_arm64") use_repo(node, "nodejs_linux_amd64") use_repo(node, "nodejs_linux_arm64") -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) [ npm.npm_translate_lock( diff --git a/e2e/pnpm_lockfiles/WORKSPACE b/e2e/pnpm_lockfiles/WORKSPACE index fd314270a..a3a0ad66f 100644 --- a/e2e/pnpm_lockfiles/WORKSPACE +++ b/e2e/pnpm_lockfiles/WORKSPACE @@ -11,13 +11,6 @@ load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_re rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) -load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "nodejs", - node_version = DEFAULT_NODE_VERSION, -) - load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") [ diff --git a/e2e/pnpm_repo_install/MODULE.bazel b/e2e/pnpm_repo_install/MODULE.bazel index 651c0ab22..132042d02 100644 --- a/e2e/pnpm_repo_install/MODULE.bazel +++ b/e2e/pnpm_repo_install/MODULE.bazel @@ -1,24 +1,27 @@ -module( - name = "e2e_pnpm_workspace", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + +node = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) use_repo(node, "nodejs_toolchains") use_repo(node, "nodejs_darwin_amd64") use_repo(node, "nodejs_darwin_arm64") use_repo(node, "nodejs_linux_amd64") use_repo(node, "nodejs_linux_arm64") -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", npmrc = "//:.npmrc", @@ -27,5 +30,9 @@ npm.npm_translate_lock( ) use_repo(npm, "npm") -pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +pnpm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "pnpm", + dev_dependency = True, +) use_repo(pnpm, "pnpm") diff --git a/e2e/pnpm_workspace/MODULE.bazel b/e2e/pnpm_workspace/MODULE.bazel index 6d5954021..d2221801c 100644 --- a/e2e/pnpm_workspace/MODULE.bazel +++ b/e2e/pnpm_workspace/MODULE.bazel @@ -1,26 +1,29 @@ -module( - name = "e2e_pnpm_workspace", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + +node = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) use_repo(node, "nodejs_toolchains") use_repo(node, "nodejs_darwin_amd64") use_repo(node, "nodejs_darwin_arm64") use_repo(node, "nodejs_linux_amd64") use_repo(node, "nodejs_linux_arm64") -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", bins = { diff --git a/e2e/pnpm_workspace_deps/MODULE.bazel b/e2e/pnpm_workspace_deps/MODULE.bazel index 497869aa9..0cbc6cd17 100644 --- a/e2e/pnpm_workspace_deps/MODULE.bazel +++ b/e2e/pnpm_workspace_deps/MODULE.bazel @@ -1,16 +1,14 @@ -module( - name = "e2e_pnpm_workspace_deps", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", data = [ diff --git a/e2e/pnpm_workspace_rerooted/MODULE.bazel b/e2e/pnpm_workspace_rerooted/MODULE.bazel index a6ae7f8e6..6771c79ac 100644 --- a/e2e/pnpm_workspace_rerooted/MODULE.bazel +++ b/e2e/pnpm_workspace_rerooted/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_pnpm_workspace_rerooted", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + +node = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) node.toolchain( name = "nodejs", node_version = "16.14.2", @@ -26,7 +25,11 @@ register_toolchains( "@nodejs_toolchains//:all", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", bins = { diff --git a/e2e/rules_foo/WORKSPACE b/e2e/rules_foo/WORKSPACE index e3893c614..94cedf608 100644 --- a/e2e/rules_foo/WORKSPACE +++ b/e2e/rules_foo/WORKSPACE @@ -1,5 +1,4 @@ -# This workspace is loaded as a local_repository -workspace(name = "rules_foo") +workspace(name = "rules_foo") # explicit name required for npm_translate_lock @rules_foo//foo:pnpm-lock.yaml" label in foo_repositories local_repository( name = "aspect_rules_js", @@ -16,7 +15,7 @@ rules_js_register_toolchains(node_version = "16.14.2") load("@rules_foo//foo:repositories.bzl", "foo_repositories") -foo_repositories(name = "foo") +foo_repositories() load("@foo//:npm_repositories.bzl", foo_npm_repositories = "npm_repositories") diff --git a/e2e/rules_foo/foo/repositories.bzl b/e2e/rules_foo/foo/repositories.bzl index feb71bbfb..67efbdd2a 100755 --- a/e2e/rules_foo/foo/repositories.bzl +++ b/e2e/rules_foo/foo/repositories.bzl @@ -2,12 +2,12 @@ load("@aspect_rules_js//npm:repositories.bzl", _npm_translate_lock = "npm_translate_lock") -def foo_repositories(name): +def foo_repositories(): _npm_translate_lock( - name = name, + name = "foo", pnpm_lock = "@rules_foo//foo:pnpm-lock.yaml", # We'll be linking in the @foo repository and not the repository where the pnpm-lock file is located - link_workspace = name, + link_workspace = "foo", # Override the Bazel package where pnpm-lock.yaml is located and link to the specified package instead root_package = "", defs_bzl_filename = "npm_link_all_packages.bzl", diff --git a/e2e/stamped_package_json/MODULE.bazel b/e2e/stamped_package_json/MODULE.bazel index 75d06dfb5..d15e2baff 100644 --- a/e2e/stamped_package_json/MODULE.bazel +++ b/e2e/stamped_package_json/MODULE.bazel @@ -1,12 +1,7 @@ -module( - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) + +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) diff --git a/e2e/update_pnpm_lock/MODULE.bazel b/e2e/update_pnpm_lock/MODULE.bazel index 5f31ee35b..07d84753e 100644 --- a/e2e/update_pnpm_lock/MODULE.bazel +++ b/e2e/update_pnpm_lock/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = [ diff --git a/e2e/update_pnpm_lock_with_import/MODULE.bazel b/e2e/update_pnpm_lock_with_import/MODULE.bazel index 8d3f14959..9997e4156 100644 --- a/e2e/update_pnpm_lock_with_import/MODULE.bazel +++ b/e2e/update_pnpm_lock_with_import/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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, +) # Validate that we can use a yarn.lock file in place of pnpm-lock.yaml npm.npm_translate_lock( diff --git a/e2e/vendored_node/MODULE.bazel b/e2e/vendored_node/MODULE.bazel index 2b1239638..1442154c2 100644 --- a/e2e/vendored_node/MODULE.bazel +++ b/e2e/vendored_node/MODULE.bazel @@ -1,16 +1,10 @@ -module( - name = "e2e_vendored_node", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "platforms", version = "0.0.4") - +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) +bazel_dep(name = "platforms", version = "0.0.9", dev_dependency = True) +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + register_toolchains("//toolchains:all") diff --git a/e2e/vendored_tarfile/MODULE.bazel b/e2e/vendored_tarfile/MODULE.bazel index e23b384a1..aea102a18 100644 --- a/e2e/vendored_tarfile/MODULE.bazel +++ b/e2e/vendored_tarfile/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_vendored_tarfile", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = [ diff --git a/e2e/verify_patches/MODULE.bazel b/e2e/verify_patches/MODULE.bazel index 37b516042..9502299fb 100644 --- a/e2e/verify_patches/MODULE.bazel +++ b/e2e/verify_patches/MODULE.bazel @@ -1,17 +1,16 @@ -module( - name = "e2e_npm_translate_lock", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +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( name = "npm", data = [ diff --git a/e2e/webpack_devserver/MODULE.bazel b/e2e/webpack_devserver/MODULE.bazel index 7d5521409..61660b28c 100644 --- a/e2e/webpack_devserver/MODULE.bazel +++ b/e2e/webpack_devserver/MODULE.bazel @@ -1,13 +1,18 @@ -bazel_dep(name = "aspect_bazel_lib", version = "2.7.0") -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_go", version = "0.46.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True) + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", npmrc = "//:.npmrc", @@ -16,10 +21,18 @@ npm.npm_translate_lock( ) use_repo(npm, "npm") -pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +pnpm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "pnpm", + dev_dependency = True, +) use_repo(pnpm, "pnpm") -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk = use_extension( + "@rules_go//go:extensions.bzl", + "go_sdk", + dev_dependency = True, +) go_sdk.download( name = "go_sdk", version = "1.20.3", diff --git a/e2e/webpack_devserver_esm/MODULE.bazel b/e2e/webpack_devserver_esm/MODULE.bazel index 7d5521409..61660b28c 100644 --- a/e2e/webpack_devserver_esm/MODULE.bazel +++ b/e2e/webpack_devserver_esm/MODULE.bazel @@ -1,13 +1,18 @@ -bazel_dep(name = "aspect_bazel_lib", version = "2.7.0") -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_go", version = "0.46.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", path = "../..", ) -npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True) + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) npm.npm_translate_lock( name = "npm", npmrc = "//:.npmrc", @@ -16,10 +21,18 @@ npm.npm_translate_lock( ) use_repo(npm, "npm") -pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +pnpm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "pnpm", + dev_dependency = True, +) use_repo(pnpm, "pnpm") -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk = use_extension( + "@rules_go//go:extensions.bzl", + "go_sdk", + dev_dependency = True, +) go_sdk.download( name = "go_sdk", version = "1.20.3", diff --git a/e2e/worker/MODULE.bazel b/e2e/worker/MODULE.bazel index b9d8a7f93..dc2483b45 100644 --- a/e2e/worker/MODULE.bazel +++ b/e2e/worker/MODULE.bazel @@ -1,19 +1,18 @@ -module( - name = "e2e_worker", - version = "0.0.0", - compatibility_level = 1, -) - -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") -bazel_dep(name = "aspect_rules_js", version = "0.0.0") +bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True) local_path_override( module_name = "aspect_rules_js", path = "../..", ) -node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1", dev_dependency = True) +bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "rules_nodejs", version = "6.1.0", dev_dependency = True) + +node = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) use_repo(node, "nodejs_toolchains") use_repo(node, "nodejs_darwin_amd64") use_repo(node, "nodejs_darwin_arm64") diff --git a/js/repositories.bzl b/js/repositories.bzl index 7a45d15c0..0a19801bf 100644 --- a/js/repositories.bzl +++ b/js/repositories.bzl @@ -10,8 +10,8 @@ load("//js/private:maybe.bzl", http_archive = "maybe_http_archive") def rules_js_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(