feat: add docs

This commit is contained in:
Eric
2026-03-04 14:38:30 +01:00
parent d5b3f5c5ac
commit 075a1159cf
15 changed files with 321 additions and 26 deletions

View File

@@ -51,16 +51,27 @@ exec "${{bun_bin}}" --bun run "${{entry_point}}" "$@"
bun_binary = rule(
implementation = _bun_binary_impl,
doc = """Runs a JS/TS entry point with Bun as an executable target.
Use this rule for non-test scripts and CLIs that should run via `bazel run`.
""",
attrs = {
"entry_point": attr.label(
mandatory = True,
allow_single_file = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".cjs"],
doc = "Path to the main JS/TS file to execute.",
),
"node_modules": attr.label(
doc = "Optional label providing Bun/npm package files in runfiles.",
),
"data": attr.label_list(
allow_files = True,
doc = "Additional runtime files required by the program.",
),
"node_modules": attr.label(),
"data": attr.label_list(allow_files = True),
"working_dir": attr.string(
default = "workspace",
values = ["workspace", "entry_point"],
doc = "Working directory at runtime: `workspace` root or `entry_point` directory.",
),
},
executable = True,