blob: a3c8a15a146bf6c4cdf376d97f5bc2f3eaf82172 [file] [log] [blame]
"Internal implementation details"
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_bazel_lib//lib:utils.bzl", bazel_lib_utils = "utils")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
package(default_visibility = ["//visibility:public"])
exports_files(glob(["*.bzl"]))
exports_files([
"js_binary.sh.tpl",
"node_wrapper.bat",
"node_wrapper.sh",
"npm_wrapper.bat",
"npm_wrapper.sh",
"js_image_layer.mjs",
])
bzl_library(
name = "js_info_files",
srcs = ["js_info_files.bzl"],
deps = [
":js_helpers",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if bazel_lib_utils.is_bazel_7_or_greater() else []),
)
bzl_library(
name = "js_binary",
srcs = ["js_binary.bzl"],
deps = [
":bash",
":js_helpers",
"@aspect_bazel_lib//lib:copy_to_bin",
"@aspect_bazel_lib//lib:directory_path",
"@aspect_bazel_lib//lib:expand_make_vars",
"@aspect_bazel_lib//lib:paths",
"@aspect_bazel_lib//lib:windows_utils",
"@bazel_skylib//lib:dicts",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if bazel_lib_utils.is_bazel_7_or_greater() else []),
)
bzl_library(
name = "js_helpers",
srcs = ["js_helpers.bzl"],
deps = [
":js_info",
"//npm:providers",
"@aspect_bazel_lib//lib:copy_to_bin",
],
)
bzl_library(
name = "js_library",
srcs = ["js_library.bzl"],
deps = [
":js_helpers",
":js_info",
"@aspect_bazel_lib//lib:copy_to_bin",
"@bazel_skylib//lib:dicts",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if bazel_lib_utils.is_bazel_7_or_greater() else []),
)
bzl_library(
name = "js_run_binary",
srcs = ["js_run_binary.bzl"],
deps = [
":js_helpers",
":js_info_files",
":js_library",
"@aspect_bazel_lib//lib:copy_to_bin",
"@aspect_bazel_lib//lib:run_binary",
"@bazel_skylib//lib:dicts",
],
)
bzl_library(
name = "js_run_devserver",
srcs = ["js_run_devserver.bzl"],
deps = [
":js_binary",
":js_helpers",
"@bazel_skylib//lib:dicts",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if bazel_lib_utils.is_bazel_7_or_greater() else []),
)
bzl_library(
name = "js_info",
srcs = ["js_info.bzl"],
visibility = ["//js:__subpackages__"],
)
bzl_library(
name = "bash",
srcs = ["bash.bzl"],
visibility = ["//js:__subpackages__"],
)
bzl_library(
name = "js_image_layer",
srcs = ["js_image_layer.bzl"],
deps = [
"@aspect_bazel_lib//lib:tar",
"@bazel_skylib//lib:paths",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if bazel_lib_utils.is_bazel_7_or_greater() else []),
)
copy_to_bin(
name = "js_devserver_entrypoint",
srcs = ["js_run_devserver.mjs"],
)