@zuke/deno
`@zuke/deno` — typed `DenoTasks` wrappers for the `deno` CLI, for use in
@zuke/deno on JSR ↗ 18 symbols
Symbols
class CoverageThresholdError extends Error Raised when measured coverage falls below a configured threshold.
| Member | Signature | Doc |
|---|---|---|
name | name: string | The error name, "CoverageThresholdError". |
interface CoverageThresholds Line and branch percentage floors; an omitted metric is not enforced.
| Member | Signature | Doc |
|---|---|---|
lines? | lines?: number | Minimum line-coverage percentage (0–100). |
branches? | branches?: number | Minimum branch-coverage percentage (0–100). |
perFile? | perFile?: number | Minimum per-file line-coverage percentage (0–100). Unlike lines (an aggregate over the whole report), this fails the gate when any single instrumented file falls below the floor — so an under-tested file can't hide inside a healthy repo-wide average. Files with no measurable lines are skipped. Note the coverage tool's limit: deno coverage only reports files that were *loaded*, so a source file no test imports at all is invisible to this check (as it is to every coverage metric). |
class DenoCacheSettings extends DenoSettings Settings for deno cache.
| Member | Signature | Doc |
|---|---|---|
reload | reload(): this | Reload remote modules instead of using the cache (--reload). |
frozen | frozen(): this | Error out if the lockfile is out of date (--frozen). See DenoPermissionSettings.frozen for why the name mirrors the real Deno flag rather than PnpmSettings.frozenLockfile()'s naming. |
paths | paths(...paths: PathLike[]): this | The entry points to cache (at least one is required). |
class DenoCheckSettings extends DenoSettings Settings for deno check.
| Member | Signature | Doc |
|---|---|---|
paths | paths(...paths: PathLike[]): this | The files to type-check (at least one is required). |
config | config(path: PathLike): this | Type-check against a specific configuration file (--config) instead of the one Deno would discover by walking up from the checked files. The discovered config decides how bare specifiers resolve, so pointing at another one type-checks the same sources against a different dependency set — for example checking a workspace member against the *published* version of a sibling it declares, rather than the local member that workspace resolution would substitute. |
noLock | noLock(): this | Ignore the lockfile entirely (--no-lock), neither reading nor writing it. Use it for a check whose resolutions are deliberately not the project's: writing them into the committed lock would corrupt it, and reading it would pin the very versions the check is trying to vary. |
frozen | frozen(): this | Error out if the lockfile is out of date (--frozen). See DenoPermissionSettings.frozen for why the name mirrors the real Deno flag rather than PnpmSettings.frozenLockfile()'s naming. |
class DenoCoverageSettings extends DenoSettings Settings for deno coverage.
| Member | Signature | Doc |
|---|---|---|
dir | dir(path: PathLike): this | The coverage profile directory to report on. |
lcov | lcov(): this | Emit lcov instead of the table report (--lcov). |
output | output(path: PathLike): this | Write the report to a file (--output=). |
exclude | exclude(pattern: string): this | Exclude files matching the pattern (--exclude=). |
linesThreshold | linesThreshold(percent: number): this | Fail the gate if line coverage is below percent. deno coverage has no fail-under flag, so DenoTasks.coverage enforces this after parsing the lcov report (and forces --lcov so a report exists to parse). |
branchesThreshold | branchesThreshold(percent: number): this | Fail the gate if branch coverage is below percent (see linesThreshold). |
threshold | threshold(percent: number): this | Fail the gate if either line or branch coverage is below percent. |
perFileThreshold | perFileThreshold(percent: number): this | Fail the gate if any single instrumented file's line coverage is below percent — a per-file floor, so an under-tested file can't hide inside a healthy aggregate (see CoverageThresholds.perFile, which notes the deno coverage limit for files no test loads). |
thresholds | thresholds(): CoverageThresholds | The configured thresholds; read by DenoTasks.coverage. |
outputPath | outputPath(): string | undefined | The --output file path, if output was set; read by the task. |
class DenoDocSettings extends DenoSettings Settings for deno doc.
| Member | Signature | Doc |
|---|---|---|
paths | paths(...paths: PathLike[]): this | The source files (entry points) to document. |
json | json(): this | Output the documentation as JSON (--json). |
frozen | frozen(): this | Error out if the lockfile is out of date (--frozen). See DenoPermissionSettings.frozen for why the name mirrors the real Deno flag rather than PnpmSettings.frozenLockfile()'s naming. |
html | html(): this | Generate static HTML documentation (--html). |
name | name(title: string): this | Title for the generated HTML documentation (--name). |
output | output(dir: PathLike): this | Output directory for HTML documentation (--output). |
private | private(): this | Include private and internal symbols (--private). |
filter | filter(symbol: string): this | Document only the symbol at this dot-separated path (--filter). |
lint | lint(): this | Report documentation diagnostics rather than rendering docs (--lint). |
class DenoFmtSettings extends DenoSettings Settings for deno fmt.
| Member | Signature | Doc |
|---|---|---|
check | check(): this | Verify formatting without writing changes (--check). |
paths | paths(...paths: PathLike[]): this | Restrict formatting to specific files or directories. |
class DenoInstallSettings extends DenoPermissionSettings Settings for deno install.
| Member | Signature | Doc |
|---|---|---|
global | global(): this | Install a global executable (--global/-g) instead of project deps. |
force | force(): this | Overwrite an existing installation (--force/-f). |
root | root(path: PathLike): this | Install root; the binary lands in <root>/bin (--root). |
name | name(value: string): this | Name the installed executable (--name/-n). |
module | module(spec: string): this | The module to install, e.g. npm:cspell@9 (required for a global install). |
moduleArgs | moduleArgs(...args: Array<string | number>): this | Arguments baked into the generated launcher (after the module). |
class DenoLintSettings extends DenoSettings Settings for deno lint.
| Member | Signature | Doc |
|---|---|---|
fix | fix(): this | Apply automatic fixes (--fix). |
paths | paths(...paths: PathLike[]): this | Restrict linting to specific files or directories. |
type DenoPermission = read | write | net | env | run | sys | ffi | import A Deno permission domain, as used by --allow-* flags.
class DenoPermissionSettings extends DenoSettings Base for subcommands that accept --allow-* permission flags.
| Member | Signature | Doc |
|---|---|---|
allowAll | allowAll(): this | Grant all permissions (--allow-all). |
allow | allow(permission: DenoPermission, ...values: string[]): this | Grant one permission, optionally scoped to values (--allow-read=a,b). |
frozen | frozen(): this | Error out if the lockfile is out of date instead of silently updating it (--frozen). Use it whenever the module graph must match the committed deno.lock exactly — running an npm: tool in CI, say, so its transitive tree stays pinned to the audited integrity hashes rather than being resolved afresh. Named frozen — not frozenLockfile — to mirror the real Deno CLI flag exactly. This is a deliberate divergence from PnpmSettings.frozenLockfile() in @zuke/pnpm, which follows pnpm's own flag name instead: guideline 7 (mirror the real CLI) takes priority over cross-package naming symmetry. |
class DenoPublishSettings extends DenoSettings Settings for deno publish.
| Member | Signature | Doc |
|---|---|---|
allowDirty | allowDirty(): this | Publish even with an uncommitted working tree (--allow-dirty). |
allowSlowTypes | allowSlowTypes(): this | Permit slow types in the published package (--allow-slow-types). |
noCheck | noCheck(): this | Skip type-checking before publishing (--no-check). |
dryRun | dryRun(): this | Validate without publishing (--dry-run). |
config | config(path: PathLike): this | Use an explicit config file (--config). |
token | token(value: string): this | Authenticate with a token instead of interactive/OIDC auth (--token). |
class DenoRunSettings extends DenoPermissionSettings Settings for deno run.
| Member | Signature | Doc |
|---|---|---|
script | script(path: PathLike): this | The script to run (required). |
scriptArgs | scriptArgs(...args: Array<string | number>): this | Arguments passed to the script (after the script path). |
config | config(path: PathLike): this | Use an explicit config file (--config). |
reload | reload(): this | Reload the module cache (--reload). |
class DenoSettings extends ToolSettings Base for all deno subcommand settings: binary is the running deno.
const DenoTasks: DenoTasksApi Typed task functions for the deno CLI.
interface DenoTasksApi The shape of DenoTasks.
| Member | Signature | Doc |
|---|---|---|
run | run(configure?: Configure<DenoRunSettings>): Promise<CommandOutput> | Run a script: deno run. |
test | test(configure?: Configure<DenoTestSettings>): Promise<CommandOutput> | Run tests: deno test. |
check | check(configure?: Configure<DenoCheckSettings>): Promise<CommandOutput> | Type-check files: deno check. |
fmt | fmt(configure?: Configure<DenoFmtSettings>): Promise<CommandOutput> | Format files: deno fmt. |
lint | lint(configure?: Configure<DenoLintSettings>): Promise<CommandOutput> | Lint files: deno lint. |
doc | doc(configure?: Configure<DenoDocSettings>): Promise<CommandOutput> | Generate documentation: deno doc. |
cache | cache(configure?: Configure<DenoCacheSettings>): Promise<CommandOutput> | Warm the module cache: deno cache. |
coverage | coverage(configure?: Configure<DenoCoverageSettings>): Promise<CommandOutput> | Report coverage: deno coverage. |
install | install(configure?: Configure<DenoInstallSettings>): Promise<CommandOutput> | Install a script or executable: deno install. |
publish | publish(configure?: Configure<DenoPublishSettings>): Promise<CommandOutput> | Publish a package to JSR: deno publish. |
task | task(configure?: Configure<DenoTaskSettings>): Promise<CommandOutput> | Run a deno.json task: deno task. |
class DenoTaskSettings extends DenoSettings Settings for deno task.
| Member | Signature | Doc |
|---|---|---|
name | name(value: string): this | The task name from deno.json (required). |
taskArgs | taskArgs(...args: Array<string | number>): this | Arguments forwarded to the task. |
frozen | frozen(): this | Error out if the lockfile is out of date (--frozen). See DenoPermissionSettings.frozen for why the name mirrors the real Deno flag rather than PnpmSettings.frozenLockfile()'s naming. |
class DenoTestSettings extends DenoPermissionSettings Settings for deno test.
| Member | Signature | Doc |
|---|---|---|
paths | paths(...paths: PathLike[]): this | Restrict the run to specific test files or directories. |
coverage | coverage(dir: PathLike): this | Collect coverage into the given profile directory (--coverage=). |
filter | filter(pattern: string): this | Only run tests whose name matches (--filter). |
parallel | parallel(): this | Run test files in parallel (--parallel). |
failFast | failFast(): this | Stop on the first failure (--fail-fast). |