Open
Conversation
Contributor
|
Thank you for this contribution! Just out of interest: Is there a specific new feature this unblocks for you? |
|
@malt3 This would be useful for any project that uses rules_js >= 2.0 which in turn sets a minimum rules_nodejs >= 6.0.0. I was able to get this PR working for my use case with a minor tweak to not use the deprecated diff --git a/private/common.bzl b/private/common.bzl
index a93d3c0..a4c5c47 100644
--- a/private/common.bzl
+++ b/private/common.bzl
@@ -1,5 +1,5 @@
load("@rules_nixpkgs_core//:nixpkgs.bzl", "nixpkgs_package")
-load("@rules_nodejs//nodejs/private:toolchains_repo.bzl", "PLATFORMS")
+load("@rules_nodejs//nodejs/private:nodejs_toolchains_repo.bzl", "PLATFORMS")
def _mk_mapping(rules_nodejs_platform_name):
@@ -41,10 +41,17 @@ pkgs.buildEnv {{
visibility = ["//visibility:public"],
)
- load("@rules_nodejs//nodejs:toolchain.bzl", "node_toolchain")
- node_toolchain(
+ filegroup(
+ name = "npm",
+ srcs = ["bin/npm"],
+ visibility = ["//visibility:public"],
+ )
+
+ load("@rules_nodejs//nodejs:toolchain.bzl", "nodejs_toolchain")
+ nodejs_toolchain(
name = "nodejs_nix_impl",
- target_tool = ":nodejs",
+ node = ":nodejs",
+ npm = ":npm",
visibility = ["//visibility:public"],
) |
Author
Just playing around with mono repo setups built on top of nix and bazel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.