mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Fix npm bzlmod (#8506)
* Restrict visibility of exported file * Align npm_translate_lock attrs * Remove defs_bzl_filename attr * Align root_package with pnpm-lock.yaml location Use a symlink to avoid copying the file.
This commit is contained in:
@@ -57,7 +57,10 @@ npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
|
|||||||
npm.npm_translate_lock(
|
npm.npm_translate_lock(
|
||||||
name = "flatbuffers_npm",
|
name = "flatbuffers_npm",
|
||||||
npmrc = "//:.npmrc",
|
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",
|
verify_node_modules_ignored = "//:.bazelignore",
|
||||||
)
|
)
|
||||||
use_repo(npm, "flatbuffers_npm")
|
use_repo(npm, "flatbuffers_npm")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ filegroup(
|
|||||||
# flatbuffer_ts_library() only supports .fbs file but not filegroups
|
# flatbuffer_ts_library() only supports .fbs file but not filegroups
|
||||||
exports_files(
|
exports_files(
|
||||||
srcs = ["reflection.fbs"],
|
srcs = ["reflection.fbs"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//reflection/ts:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
||||||
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
|
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(
|
filegroup(
|
||||||
name = "distribution",
|
name = "distribution",
|
||||||
|
|||||||
1
ts/pnpm-lock.yaml
generated
Symbolic link
1
ts/pnpm-lock.yaml
generated
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../pnpm-lock.yaml
|
||||||
@@ -16,7 +16,6 @@ def flatbuffers_npm(name):
|
|||||||
# $ bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only
|
# $ bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only
|
||||||
update_pnpm_lock = False,
|
update_pnpm_lock = False,
|
||||||
verify_node_modules_ignored = "@com_github_google_flatbuffers//:.bazelignore",
|
verify_node_modules_ignored = "@com_github_google_flatbuffers//:.bazelignore",
|
||||||
defs_bzl_filename = "npm_link_all_packages.bzl",
|
|
||||||
data = [
|
data = [
|
||||||
"@com_github_google_flatbuffers//:package.json",
|
"@com_github_google_flatbuffers//:package.json",
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user