feat: add docs

This commit is contained in:
eric
2026-03-04 14:38:30 +01:00
parent f7586a76e4
commit b20a60c863
15 changed files with 321 additions and 26 deletions

View File

@@ -61,25 +61,47 @@ def _bun_bundle_impl(ctx):
bun_bundle = rule(
implementation = _bun_bundle_impl,
doc = """Bundles one or more JS/TS entry points using Bun build.
Each entry point produces one output JavaScript artifact.
""",
attrs = {
"entry_points": attr.label_list(
mandatory = True,
allow_files = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".cjs"],
doc = "Entry files to bundle.",
),
"node_modules": attr.label(
doc = "Optional label providing Bun/npm package files for resolution.",
),
"deps": attr.label_list(
doc = "Source/library dependencies that provide transitive inputs.",
),
"data": attr.label_list(
allow_files = True,
doc = "Additional non-source files needed during bundling.",
),
"node_modules": attr.label(),
"deps": attr.label_list(),
"data": attr.label_list(allow_files = True),
"target": attr.string(
default = "browser",
values = ["browser", "node", "bun"],
doc = "Bun build target environment.",
),
"format": attr.string(
default = "esm",
values = ["esm", "cjs", "iife"],
doc = "Output module format.",
),
"minify": attr.bool(
default = False,
doc = "If true, minifies bundle output.",
),
"sourcemap": attr.bool(
default = False,
doc = "If true, emits source maps.",
),
"external": attr.string_list(
doc = "Package names to treat as externals (not bundled).",
),
"minify": attr.bool(default = False),
"sourcemap": attr.bool(default = False),
"external": attr.string_list(),
},
toolchains = ["//bun:toolchain_type"],
)