-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
npm_translate_lock
(…
…#1876) This prevents an error such as the following when trying to run a `js_binary` defined in another module with Bzlmod: ``` ERROR: .../external/rules_pyright~/BUILD:6:23: no such package '@@[unknown repo 'rules_pyright~' requested from @@rules_pyright~]//': The repository '@@[unknown repo 'rules_pyright~' requested from @@rules_pyright~]' could not be resolved: No repository visible as '@rules_pyright~' from repository '@@rules_pyright~' and referenced by '@@rules_pyright~//:pyright__entry_point' ```
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
other_module |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Disabling pnpm [hoisting](https://pnpm.io/npmrc#hoist) by setting `hoist=false` is recommended on | ||
# projects using rules_js so that pnpm outside of Bazel lays out a node_modules tree similar to what | ||
# rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules) | ||
hoist=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
load("@npm_other_module//:defs.bzl", "npm_link_all_packages") | ||
load("@npm_other_module//:pyright/package_json.bzl", pyright = "bin") | ||
|
||
npm_link_all_packages(name = "node_modules") | ||
|
||
pyright.pyright_binary( | ||
name = "pyright", | ||
env = {"BAZEL_BINDIR": "."}, # Allow the binary to be run outside bazel | ||
visibility = ["//visibility:public"], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module(name = "other_module") | ||
|
||
bazel_dep(name = "aspect_rules_js", version = "0.0.0") | ||
|
||
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") | ||
npm.npm_translate_lock( | ||
name = "npm_other_module", | ||
npmrc = "//:.npmrc", | ||
pnpm_lock = "//:pnpm-lock.yaml", | ||
verify_node_modules_ignored = "//:.bazelignore", | ||
) | ||
use_repo(npm, "npm_other_module") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Marker file that this folder is the root of a Bazel workspace. | ||
# See MODULE.bazel for dependencies and setup. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"pyright": "1.1.373" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.