@zuke/jsr
`@zuke/jsr` — tools for the [JSR](https://jsr.io) registry in Zuke builds:
@zuke/jsr on JSR ↗ 10 symbols
Symbols
async function isPublished(pkg: string, version: string, options?: JsrRegistryOptions): Promise<boolean> Whether pkg@version (e.g. @zuke/core, 0.13.0) is already on JSR.
class JsrAddSettings extends JsrSettings Settings for jsr add (install a JSR dependency).
| Member | Signature | Doc |
|---|---|---|
packages | packages(...specs: string[]): this | Package specs to add, e.g. @std/assert (required). |
dev | dev(): this | Add as a development dependency (--save-dev). |
class JsrPublishSettings extends JsrSettings Settings for jsr publish.
| Member | Signature | Doc |
|---|---|---|
dryRun | dryRun(): this | Validate without publishing (--dry-run). |
allowSlowTypes | allowSlowTypes(): this | Permit slow types in the published package (--allow-slow-types). |
allowDirty | allowDirty(): this | Publish even with an uncommitted working tree (--allow-dirty). |
noCheck | noCheck(): this | Skip type-checking before publishing (--no-check). |
provenance | provenance(): this | Attach provenance attestation in CI (--provenance). |
token | token(value: string): this | 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. |
interface JsrRegistryOptions Options shared by the JSR registry helpers.
| Member | Signature | Doc |
|---|---|---|
fetch? | fetch?: fetch | The fetch implementation to use. Defaults to the global fetch; override it to unit-test without network access. |
class JsrRemoveSettings extends JsrSettings Settings for jsr remove.
| Member | Signature | Doc |
|---|---|---|
packages | packages(...names: string[]): this | Package names to remove (required). |
class JsrSettings extends ToolSettings Base for all jsr subcommand settings: the binary is jsr.
const JsrTasks: JsrTasksApi Typed task functions for the jsr CLI.
interface JsrTasksApi The shape of JsrTasks.
| Member | Signature | Doc |
|---|---|---|
publish | publish(configure?: Configure<JsrPublishSettings>): Promise<CommandOutput> | Publish the package: jsr publish. |
add | add(configure?: Configure<JsrAddSettings>): Promise<CommandOutput> | Add a JSR dependency: jsr add. |
remove | remove(configure?: Configure<JsrRemoveSettings>): Promise<CommandOutput> | Remove a dependency: jsr remove. |
async function jsrVersions(pkg: string, options?: JsrRegistryOptions): Promise<Set<string>> The set of published versions of pkg (a scoped name like @zuke/core). Resolves to an empty set if the package is not found on JSR.
function publishedVersions(meta: unknown): Set<string> The set of version strings present in a JSR meta.json payload. Tolerant of malformed input: anything without a versions object yields an empty set.