Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Silic0nS0ldier committed Dec 6, 2023
1 parent 1d62185 commit 581e8d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 0 additions & 2 deletions lib/private/extensions/nodejs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ def _nodejs_impl(mctx):
target_tool = "@%s_%s//:node_bin" % (attrs.name, platform["id"]),
)
# Toolchain registrations without triggering eager downloading
# TODO Rename this to something more appropriate
nodejs_toolchains(
name = attrs.name,
node_version = attrs.node_version,
)
nodejs_download(
name = "%s_host" % attrs.name,
Expand Down
20 changes: 11 additions & 9 deletions lib/private/repositories/nodejs_download/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,11 @@ def _prepare_node(repository_ctx):
package(default_visibility = ["//visibility:public"])
exports_files([
"run_npm.sh.template",
"run_npm.bat.template",{node_bin_export}{npm_bin_export}{npx_bin_export}{yarn_bin_export}
"run_npm.bat.template",
"{node_bin_export}",
"{npm_bin_export}",
"{npx_bin_export}",
"{yarn_bin_export}",
"{node_entry}",
"{npm_entry}",
"{yarn_entry}",
Expand All @@ -450,19 +454,17 @@ def _prepare_node(repository_ctx):
)
filegroup(
name = "yarn_files",
srcs = {yarn_files_glob}[":node_files"],
srcs = glob(["bin/yarnpkg/**"]) + [":node_files"],
)
filegroup(
name = "npm_files",
srcs = {npm_files_glob}[":node_files"],
srcs = glob(["bin/nodejs/**"]) + [":node_files"],
)
""").format(
node_bin_export = ("\n \"%s\"," % node_bin),
npm_bin_export = ("\n \"%s\"," % npm_bin),
npx_bin_export = ("\n \"%s\"," % npx_bin),
npm_files_glob = "glob([\"bin/nodejs/**\"]) + ",
yarn_bin_export = ("\n \"%s\"," % yarn_bin),
yarn_files_glob = "glob([\"bin/yarnpkg/**\"]) + ",
node_bin_export = node_bin,
npm_bin_export = npm_bin,
npx_bin_export = npx_bin,
yarn_bin_export = yarn_bin,
node_bin_label = node_bin_label,
npm_bin_label = npm_bin_label,
npx_bin_label = npx_bin_label,
Expand Down
4 changes: 2 additions & 2 deletions lib/private/repositories/nodejs_toolchains.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Public API NodeJS repositories, plus some legacy cruft that `yarn_install` needs.
Public API NodeJS repositories.
"""

load("//lib/private:utils/platform.bzl", "PLATFORMS")
Expand Down Expand Up @@ -43,5 +43,5 @@ def _nodejs_toolchains_impl(repository_ctx):

nodejs_toolchains = repository_rule(
_nodejs_toolchains_impl,
attrs = {"node_version": attr.string()},
attrs = {},
)

0 comments on commit 581e8d1

Please sign in to comment.