zuke.tools.jsr

← Python API reference

@zuke/jsr 1.0.2: @zuke/jsr — tools for the [JSR](https://jsr.io) registry in Zuke builds: typed JsrTasks wrappers for the jsr CLI (publish, add, remove), plus read-only registry queries to check which versions are already published.

Symbols

#

JsrAddSettings

class
class JsrAddSettings(JsrSettings)

Settings for jsr add (install a JSR dependency).

  • packages(*specs: str) -> Self

    Package specs to add, e.g. @std/assert (required).

  • dev() -> Self

    Add as a development dependency (--save-dev).

#

JsrPublishSettings

class
class JsrPublishSettings(JsrSettings)

Settings for jsr publish.

  • dry_run() -> Self

    Validate without publishing (--dry-run).

  • allow_slow_types() -> Self

    Permit slow types in the published package (--allow-slow-types).

  • allow_dirty() -> Self

    Publish even with an uncommitted working tree (--allow-dirty).

  • no_check() -> Self

    Skip type-checking before publishing (--no-check).

  • provenance() -> Self

    Attach provenance attestation in CI (--provenance).

  • token(value: str) -> Self

    Authenticate with a token instead of the interactive flow (--token). Registered with the run's redactor, so every *rendering* of the command masks it — a dry-run echo, a failure message. That is as far as it goes: jsr publish accepts the token only as a flag, so the value still reaches the child's argv, where ps and /proc/<pid>/cmdline expose it to every other user on the host and to every process the build starts. There is no environment variable to move it to. On GitHub Actions, prefer OIDC and pass no token at all: the publish is authenticated by the workflow's identity, so there is no credential to expose. This is for the cases where that is not available.

#

JsrRemoveSettings

class
class JsrRemoveSettings(JsrSettings)

Settings for jsr remove.

  • packages(*names: str) -> Self

    Package names to remove (required).

#

JsrSettings

class
class JsrSettings(ToolSettings)

Base for all jsr subcommand settings: the binary is jsr.

#

JsrTasks

class
class JsrTasks

Typed task functions for the jsr CLI.

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

    Publish the package: jsr publish.

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

    Add a JSR dependency: jsr add.

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

    Remove a dependency: jsr remove.