zuke.tools.bun

← Python API reference

@zuke/bun 1.3.0: @zuke/bun — typed BunTasks wrappers for the bun CLI, for use in Zuke build targets (package management, scripts, and the built-in test runner).

Symbols

#

BunAddSettings

class
class BunAddSettings(BunSettings)

Settings for bun add.

  • packages(*specs: str) -> Self

    Package specs to add (required).

  • dev() -> Self

    Add to devDependencies (--dev).

  • optional() -> Self

    Add to optionalDependencies (--optional).

  • exact() -> Self

    Pin the exact version (--exact).

  • global_() -> Self

    Install globally (--global).

#

BunInstallSettings

class
class BunInstallSettings(BunSettings)

Settings for bun install.

  • production() -> Self

    Install without devDependencies (--production).

  • frozen_lockfile() -> Self

    Fail if the lockfile is out of date (--frozen-lockfile).

#

BunRemoveSettings

class
class BunRemoveSettings(BunSettings)

Settings for bun remove.

  • packages(*names: str) -> Self

    Package names to remove (required).

#

BunRunSettings

class
class BunRunSettings(BunSettings)

Settings for bun run.

  • script(name: str) -> Self

    The package.json script to run (required).

  • script_args(*args: str | float) -> Self

    Arguments forwarded to the script.

#

BunSettings

class
class BunSettings(ToolSettings)

Base for all bun subcommand settings: binary is bun from PATH.

#

BunTasks

class
class BunTasks

Typed task functions for the bun CLI.

  • static async install(ctx: ServiceContext, configure: Callable[[BunInstallSettings], BunInstallSettings] | None=None) -> ExecResult

    Install dependencies: bun install.

  • static async add(ctx: ServiceContext, configure: Callable[[BunAddSettings], BunAddSettings] | None=None) -> ExecResult

    Add dependencies: bun add.

  • static async remove(ctx: ServiceContext, configure: Callable[[BunRemoveSettings], BunRemoveSettings] | None=None) -> ExecResult

    Remove dependencies: bun remove.

  • static async run(ctx: ServiceContext, configure: Callable[[BunRunSettings], BunRunSettings] | None=None) -> ExecResult

    Run a package.json script: bun run.

  • static async x(ctx: ServiceContext, configure: Callable[[BunXSettings], BunXSettings] | None=None) -> ExecResult

    Execute a package binary: bun x (bunx).

  • static async test(ctx: ServiceContext, configure: Callable[[BunTestSettings], BunTestSettings] | None=None) -> ExecResult

    Run the test suite: bun test.

#

BunTestSettings

class
class BunTestSettings(BunSettings)

Settings for bun test.

  • paths(*patterns: str) -> Self

    Test file or directory patterns to run; omit to run all tests.

  • coverage() -> Self

    Collect coverage (--coverage).

  • bail() -> Self

    Stop after the first failure (--bail).

#

BunXSettings

class
class BunXSettings(BunSettings)

Settings for bun x (the bunx package runner).

  • command(name: str) -> Self

    The package binary to execute (required).

  • exec_args(*args: str | float) -> Self

    Arguments forwarded to the command.