Skip to content

Commit

Permalink
Fix Bzlmod (#8503)
Browse files Browse the repository at this point in the history
* Fix Bzlmod npm repo name

* Fix Bazel integration tests with Bzlmod
  • Loading branch information
mering authored Jan 23, 2025
1 parent 69ac6a7 commit ad6d663
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ bazel_dep(

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
name = "flatbuffers_npm",
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
use_repo(npm, "flatbuffers_npm")

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_linux_amd64")

rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")

Expand Down
12 changes: 12 additions & 0 deletions tests/bazel_repository_test_dir/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module(name = "bazel_repository_test")

bazel_dep(name = "flatbuffers", repo_name = "com_github_google_flatbuffers")
local_path_override(
module_name = "flatbuffers",
path = "../../",
)

bazel_dep(
name = "rules_cc",
version = "0.0.16",
)
23 changes: 19 additions & 4 deletions tests/ts/bazel_repository_test_dir/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
module(name = "bazel_repository_test")

bazel_dep(name = "flatbuffers", repo_name = "com_github_google_flatbuffers")

local_path_override(
module_name = "com_github_google_flatbuffers",
module_name = "flatbuffers",
path = "../../../",
)

bazel_dep(
name = "aspect_rules_esbuild",
version = "0.15.0",
)
bazel_dep(
name = "aspect_rules_js",
version = "1.34.1",
)
bazel_dep(
name = "aspect_rules_ts",
version = "1.4.5",
)
bazel_dep(
name = "rules_nodejs",
version = "5.8.3",
)

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
Expand All @@ -19,6 +35,5 @@ use_repo(npm, "npm")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_linux_amd64")

rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext.deps()
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
use_repo(rules_ts_ext, "npm_typescript")

0 comments on commit ad6d663

Please sign in to comment.