zuke.tools.pnpm

← Python API reference

@zuke/pnpm 1.2.0: @zuke/pnpm — typed PnpmTasks wrappers for the pnpm CLI, for use in Zuke build targets (including builds that drive Node/workspace projects).

Symbols

#

PnpmAddSettings

class
class PnpmAddSettings(PnpmSettings)

Settings for pnpm add.

  • packages(*specs: str) -> Self

    Package specs to add (required).

  • save_dev() -> Self

    Save to devDependencies (--save-dev).

  • save_exact() -> Self

    Pin the exact version (--save-exact).

  • global_() -> Self

    Install globally (--global).

#

PnpmDlxSettings

class
class PnpmDlxSettings(PnpmSettings)

Settings for pnpm dlx.

  • command(name: str) -> Self

    The command to execute (required).

  • package(spec: str) -> Self

    The package providing the command (--package=).

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

    Arguments forwarded to the command.

#

PnpmInstallSettings

class
class PnpmInstallSettings(PnpmSettings)

Settings for pnpm install.

  • frozen_lockfile() -> Self

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

  • prod() -> Self

    Install without devDependencies (--prod).

#

PnpmPublishSettings

class
class PnpmPublishSettings(PnpmSettings)

Settings for pnpm publish.

  • tag(name: str) -> Self

    Publish under a dist-tag (--tag=).

  • access(level: Literal['public', 'restricted']) -> Self

    Set the package access level (--access=).

  • no_git_checks() -> Self

    Skip the clean-working-tree checks (--no-git-checks).

  • dry_run() -> Self

    Report what would be published without uploading (--dry-run).

#

PnpmRemoveSettings

class
class PnpmRemoveSettings(PnpmSettings)

Settings for pnpm remove.

  • packages(*names: str) -> Self

    Package names to remove (required).

#

PnpmRunSettings

class
class PnpmRunSettings(PnpmSettings)

Settings for pnpm run.

  • script(name: str) -> Self

    The package.json script to run (required).

  • filter(pattern: str) -> Self

    Restrict to matching workspace packages (--filter).

  • if_present() -> Self

    Do not fail when the script is missing (--if-present).

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

    Arguments forwarded to the script.

#

PnpmSettings

class
class PnpmSettings(ToolSettings)

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

#

PnpmTasks

class
class PnpmTasks

Typed task functions for the pnpm CLI.

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

    Install dependencies: pnpm install.

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

    Add dependencies: pnpm add.

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

    Remove dependencies: pnpm remove.

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

    Run a package.json script: pnpm run.

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

    Download and execute a package binary: pnpm dlx.

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

    Publish the package: pnpm publish.