rules_nixpkgs
rules_nixpkgs copied to clipboard
Update rules_nodejs version
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 node_toolchain rule:
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"],
)
Thank you for this contribution! Just out of interest: Is there a specific new feature this unblocks for you?
Just playing around with mono repo setups built on top of nix and bazel.