diff --git a/MODULE.bazel b/MODULE.bazel index bf370ec1b44..48931476567 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -57,7 +57,10 @@ npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") npm.npm_translate_lock( name = "flatbuffers_npm", npmrc = "//:.npmrc", - pnpm_lock = "//:pnpm-lock.yaml", + pnpm_lock = "//ts:pnpm-lock.yaml", + # Override the Bazel package where pnpm-lock.yaml is located and link + # to the specified package instead. + root_package = "ts", verify_node_modules_ignored = "//:.bazelignore", ) use_repo(npm, "flatbuffers_npm") diff --git a/reflection/BUILD.bazel b/reflection/BUILD.bazel index 7ab995e7f5c..ec14e5263a6 100644 --- a/reflection/BUILD.bazel +++ b/reflection/BUILD.bazel @@ -10,7 +10,7 @@ filegroup( # flatbuffer_ts_library() only supports .fbs file but not filegroups exports_files( srcs = ["reflection.fbs"], - visibility = ["//visibility:public"], + visibility = ["//reflection/ts:__pkg__"], ) filegroup( diff --git a/ts/BUILD.bazel b/ts/BUILD.bazel index 261baa08720..5dd6e203464 100644 --- a/ts/BUILD.bazel +++ b/ts/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//npm:defs.bzl", "npm_package") load("@aspect_rules_ts//ts:defs.bzl", "ts_project") -load("@flatbuffers_npm//:npm_link_all_packages.bzl", "npm_link_all_packages") +load("@flatbuffers_npm//:defs.bzl", "npm_link_all_packages") filegroup( name = "distribution", diff --git a/ts/pnpm-lock.yaml b/ts/pnpm-lock.yaml new file mode 120000 index 00000000000..c8d5d6ebce4 --- /dev/null +++ b/ts/pnpm-lock.yaml @@ -0,0 +1 @@ +../pnpm-lock.yaml \ No newline at end of file diff --git a/ts/repositories.bzl b/ts/repositories.bzl index 284d3d2ac72..3e66915b7e2 100644 --- a/ts/repositories.bzl +++ b/ts/repositories.bzl @@ -16,7 +16,6 @@ def flatbuffers_npm(name): # $ bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only update_pnpm_lock = False, verify_node_modules_ignored = "@com_github_google_flatbuffers//:.bazelignore", - defs_bzl_filename = "npm_link_all_packages.bzl", data = [ "@com_github_google_flatbuffers//:package.json", ],