feat: add phase 6 js_library and ts_library bootstrap
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Rule for running test suites with Bun."""
|
||||
|
||||
load("//internal:js_library.bzl", "BunSourcesInfo")
|
||||
|
||||
|
||||
def _shell_quote(value):
|
||||
return "'" + value.replace("'", "'\"'\"'") + "'"
|
||||
@@ -34,6 +36,11 @@ exec "{bun_bin}" test {src_args} "${{extra_args[@]}}" "$@"
|
||||
transitive_files = []
|
||||
if ctx.attr.node_modules:
|
||||
transitive_files.append(ctx.attr.node_modules[DefaultInfo].files)
|
||||
for dep in ctx.attr.deps:
|
||||
if BunSourcesInfo in dep:
|
||||
transitive_files.append(dep[BunSourcesInfo].transitive_sources)
|
||||
else:
|
||||
transitive_files.append(dep[DefaultInfo].files)
|
||||
|
||||
runfiles = ctx.runfiles(
|
||||
files = [bun_bin] + ctx.files.srcs + ctx.files.data,
|
||||
@@ -56,6 +63,7 @@ bun_test = rule(
|
||||
allow_files = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".cjs"],
|
||||
),
|
||||
"node_modules": attr.label(),
|
||||
"deps": attr.label_list(),
|
||||
"data": attr.label_list(allow_files = True),
|
||||
},
|
||||
test = True,
|
||||
|
||||
Reference in New Issue
Block a user