refactor: remove unused run_npm from NodeInfo provider
diff --git a/docs/Core.md b/docs/Core.md index 93f4b8a..4f0ec33 100644 --- a/docs/Core.md +++ b/docs/Core.md
@@ -142,7 +142,7 @@ **USAGE** <pre> -node_toolchain(<a href="#node_toolchain-name">name</a>, <a href="#node_toolchain-headers">headers</a>, <a href="#node_toolchain-npm">npm</a>, <a href="#node_toolchain-npm_files">npm_files</a>, <a href="#node_toolchain-npm_path">npm_path</a>, <a href="#node_toolchain-run_npm">run_npm</a>, <a href="#node_toolchain-target_tool">target_tool</a>, <a href="#node_toolchain-target_tool_path">target_tool_path</a>) +node_toolchain(<a href="#node_toolchain-name">name</a>, <a href="#node_toolchain-headers">headers</a>, <a href="#node_toolchain-npm">npm</a>, <a href="#node_toolchain-npm_files">npm_files</a>, <a href="#node_toolchain-npm_path">npm_path</a>, <a href="#node_toolchain-target_tool">target_tool</a>, <a href="#node_toolchain-target_tool_path">target_tool_path</a>) </pre> Defines a node toolchain for a platform. @@ -217,12 +217,6 @@ Defaults to `""` -<h4 id="node_toolchain-run_npm">run_npm</h4> - -(*<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>*): A template file that allows us to execute npm - -Defaults to `None` - <h4 id="node_toolchain-target_tool">target_tool</h4> (*<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>*): A hermetically downloaded nodejs executable target for this target's platform.
diff --git a/nodejs/private/nodejs_repo_host_os_alias.bzl b/nodejs/private/nodejs_repo_host_os_alias.bzl index 81064f7..b283ee3 100644 --- a/nodejs/private/nodejs_repo_host_os_alias.bzl +++ b/nodejs/private/nodejs_repo_host_os_alias.bzl
@@ -8,11 +8,6 @@ # Base BUILD file for this repository repository_ctx.file("BUILD.bazel", """# Generated by nodejs_repo_host_os_alias.bzl package(default_visibility = ["//visibility:public"]) -# aliases for exports_files -alias(name = "run_npm.sh.template", actual = "@{node_repository}_{os_name}//:run_npm.sh.template") -alias(name = "run_npm.bat.template", actual = "@{node_repository}_{os_name}//:run_npm.bat.template") - -# aliases for other aliases alias(name = "node_bin", actual = "@{node_repository}_{os_name}//:node_bin") alias(name = "npm_bin", actual = "@{node_repository}_{os_name}//:npm_bin") alias(name = "npx_bin", actual = "@{node_repository}_{os_name}//:npx_bin")
diff --git a/nodejs/repositories.bzl b/nodejs/repositories.bzl index ecb2396..17f4d98 100644 --- a/nodejs/repositories.bzl +++ b/nodejs/repositories.bzl
@@ -300,27 +300,10 @@ executable = True, ) - # This template file is used by the packager tool - # `yarn publish` is not ready for use under Bazel, see https://github.com/yarnpkg/yarn/issues/610 - if repository_ctx.attr.platform.startswith("windows"): - run_npm = """ -"{node}" "{script}" TMPL_args %* -""" - else: - run_npm = """ -"{node}" "{script}" TMPL_args "$@" -""" - - repository_ctx.file("run_npm.template", content = run_npm.format( - node = repository_ctx.path(node_entry), - script = repository_ctx.path(npm_script), - )) - # Base BUILD file for this repository build_content = """# Generated by node_repositories.bzl package(default_visibility = ["//visibility:public"]) exports_files([ - "run_npm.template", "{node_entry}", "{npm_entry}", "{npx_entry}" @@ -375,7 +358,6 @@ target_tool = ":node_bin", npm = ":npm", npm_files = [":npm_files"], - run_npm = ":run_npm.template", headers = ":headers", ) """
diff --git a/nodejs/toolchain.bzl b/nodejs/toolchain.bzl index 546105a..5655730 100644 --- a/nodejs/toolchain.bzl +++ b/nodejs/toolchain.bzl
@@ -26,8 +26,6 @@ "npm_files": """Files required in runfiles to make the npm executable available. May be empty if the npm_path points to a locally installed npm binary.""", - "run_npm": """A template for a script that wraps npm. - On Windows, this is a Batch script, otherwise it uses Bash.""", "headers": """\ (struct) Information about the header files, with fields: * providers_map: a dict of string to provider instances. The key should be @@ -96,7 +94,6 @@ tool_files = tool_files, npm_path = npm_path, npm_files = npm_files, - run_npm = ctx.file.run_npm, headers = struct( providers_map = { "CcInfo": ctx.attr.headers[CcInfo], @@ -143,10 +140,6 @@ doc = "Files required in runfiles to run npm.", mandatory = False, ), - "run_npm": attr.label( - doc = "A template file that allows us to execute npm", - allow_single_file = True, - ), "headers": attr.label( doc = "A cc_library that contains the Node/v8 header files for this target platform.", ),