zuke.tools.tsx

← Python API reference

@zuke/tsx 1.0.1: @zuke/tsx — typed tsx task wrappers for Zuke builds.

Symbols

#

TsxCommonSettings

class
class TsxCommonSettings(ToolSettings)

Options shared by every tsx invocation: the entry point and how to load it.

  • script(path: str) -> Self

    The entry point to execute (required).

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

    Arguments passed to the script (after the entry point).

  • tsconfig(path: str) -> Self

    Use an explicit tsconfig.json (--tsconfig).

  • env_file(path: str) -> Self

    Load environment variables from a file (--env-file).

  • no_cache() -> Self

    Disable the file-system transpile cache (--no-cache).

  • no_warnings() -> Self

    Suppress Node warnings (--no-warnings).

  • conditions(*names: str) -> Self

    Custom export conditions to resolve (--conditions); repeatable.

  • import_module(*modules: str) -> Self

    Preload a module before the entry point (--import); repeatable.

#

TsxSettings

class
class TsxSettings(TsxCommonSettings)

Settings for tsx <file>.

#

TsxTasks

class
class TsxTasks

Typed task functions for the tsx TypeScript runner.

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

    Run a TypeScript entry point: tsx <file>.

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

    Re-run an entry point on changes: tsx watch <file>.

#

TsxWatchSettings

class
class TsxWatchSettings(TsxCommonSettings)

Settings for tsx watch <file>.

  • no_clear_screen() -> Self

    Keep prior output between reruns (--clear-screen=false).

  • include(*paths: str) -> Self

    Additional paths to watch (--include); repeatable.

  • exclude(*paths: str) -> Self

    Paths to ignore while watching (--exclude); repeatable.