diff --git a/deploy/BUILD.bazel b/deploy/BUILD.bazel index 1d13b40ec1..72b84a0555 100644 --- a/deploy/BUILD.bazel +++ b/deploy/BUILD.bazel @@ -36,8 +36,10 @@ ts_project( js_binary( name = "release", - data = [":release_src"], - entry_point = "release.ts", + data = [ + ":release_src" + ], + entry_point = "release.js", ) js_test( diff --git a/js/rules.bzl b/js/rules.bzl index a634c867e3..851477d730 100644 --- a/js/rules.bzl +++ b/js/rules.bzl @@ -3,11 +3,16 @@ load("@aspect_rules_js//npm:defs.bzl", _npm_link_package = "npm_link_package", _ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin") load("//js/copy_to_local:copy_to_local.bzl", _copy_to_local = "copy_to_local") -def js_binary(name, **kwargs): - _js_binary(name = name, **kwargs) +def _apply_env_defaults(d): + return d | {"NODE_PATH": "."} -def js_test(name, **kwargs): - _js_test(name = name, env = {"NODE_PATH": "."}, **kwargs) +def js_binary(name, env = {}, **kwargs): + env = _apply_env_defaults(env) + _js_binary(name = name, env = env, **kwargs) + +def js_test(name, env = {}, **kwargs): + env = _apply_env_defaults(env) + _js_test(name = name, env = env, **kwargs) def js_library(name, **kwargs): _js_library(name = name, **kwargs) @@ -18,8 +23,10 @@ def copy_to_bin(name, **kwargs): def pkg_npm(name, **kwargs): _pkg_npm(name = name, **kwargs) -def js_run_binary(name, **kwargs): - _js_run_binary(name = name, env = {"NODE_PATH": "."}, **kwargs) +def js_run_binary(name, env = {}, **kwargs): + env = _apply_env_defaults(env) + + _js_run_binary(name = name, env = env, **kwargs) def npm_link_package(name, **kwargs): _npm_link_package(name = name, **kwargs)