Task runnerConfiguration

Configuration

Full reference for all task runner options

Configuration

All options are passed to defaultTaskRunner as the second argument.

Caching

OptionTypeDefaultDescription
cacheDirectorystring.task-runner-cacheCache storage directory
maxCacheSizestringunlimitedMax cache size (e.g., "1GB")
maxCacheAgenumber7 days (ms)Max cache entry age
skipNxCachebooleanfalseSkip reading from cache
dryRunbooleanfalseCompute hashes without executing
cacheDiagnosticsbooleanfalseLog cache miss reasons

Targets

These keys live on a TargetConfiguration (under targetDefaults or a project's own targets) and are carried onto each Task at graph creation.

OptionTypeDefaultDescription
outputsOutputSpec[][]Glob patterns, negations (!dist/cache/**), or { auto: true } markers. See Outputs
whenWhenCondition-Predicate gating execution. Failing tasks are marked "skipped", not failed
alwaysbooleanfalseRun after the main graph completes, even on upstream failures. See always
warningPatternstring | string[]-JS-flavor regex(es); first match flips TaskResult.hadWarnings
cacheOnWarningbooleantrueWhen false, exit-0 runs that tripped warningPattern are not seeded into the cache
cacheRestoreCacheRestoreOptions{ preserveMtime: true, preservePerms: true }Per-target cache rehydration controls (see below)

when

when accepts the following predicates. All positive clauses must match (AND); array values mean any-of (OR). not.* mirrors apply the inverse.

ClauseTypeNotes
osNodePlatform | NodePlatform[]process.platform values ("linux", "darwin", "win32", ...). "windows" is sugar for "win32".
envEnvMatcher | EnvMatcher[]A bare string asserts the var is set & non-empty; the object form supports equals or exists.
branchstring | string[]Matches the current git rev-parse --abbrev-ref HEAD. Detached HEAD never matches.
cibooleanDetects CI via the CI env var (truthy, not "false"/"0").
when: { os: ["linux", "darwin"], ci: true, env: { name: "DEPLOY_TOKEN", exists: true } }

Tasks whose when returns false are recorded with status "skipped" (not "failure") and never reach the executor.

always-tasks

Targets marked always: true run sequentially after the main task graph completes, even if upstream tasks failed. They:

  • bypass the cache (no lookup, no fingerprint, no store) — cleanup tasks are expected to run every invocation;
  • still honour when, so a notify-on-deploy task can stay branch-gated;
  • are skipped on SIGINT — the user's explicit ask is to stop now;
  • are not part of the dependency graph and never block other tasks.

warningPattern & cacheOnWarning

warningPattern is one or more JavaScript regex sources scanned against the task's combined terminal output after a 0-exit. The first match sets TaskResult.hadWarnings = true. With cacheOnWarning: false, a warning-tainted run still surfaces hadWarnings but is not written to the local or remote cache.

build: {
    warningPattern: ["\\bwarning\\b", "TS\\d{4}"],
    cacheOnWarning: false,
}

outputs

Each entry is one of:

FormBehavior
"dist/**" (string)Glob relative to workspace root. Literal paths and metacharacters (* ? [ ] { }) both supported.
"!dist/cache/**"Negation — applied to the combined positive set after expansion.
{ auto: true }Use the file-access tracker's recorded writes for this run. No-op when tracking isn't active.

Resolved paths are deduped, sorted, and filtered to files inside the workspace before archiving.

cacheRestore

Per-target overrides for how cached outputs are rehydrated.

FieldTypeDefaultDescription
preserveMtimebooleantrueRestore each file's mtime from the captured tar header (second precision).
preservePermsbooleantrueRestore POSIX mode bits (low 12 bits). Ignored on Windows.

Flip individually when downstream tooling needs the legacy "now"-stamped behaviour (e.g. bundlers that use newer-than-source heuristics).

Inputs

OptionTypeDefaultDescription
namedInputsNamedInputs{}Named input definitions
targetDefaultsRecord{}Default target configurations
envVarsstring[][]Env vars to include in hash
globalInputsstring[]lockfiles + tsconfig.base.json + tsconfig.json + .envFiles that bust all caches
globalEnvstring[][]Env vars that bust all caches
smartLockfileHashingbooleanfalsePer-package lockfile hashing
frameworkInferencebooleanfalseAuto-detect framework env vars

Auto-Fingerprinting

OptionTypeDefaultDescription
autoFingerprintbooleanfalseEnable auto-fingerprinting mode
fingerprintEnvPatternsstring[][]Env var patterns to fingerprint
untrackedEnvVarsstring[][]Env vars to exclude from fingerprint

Execution

OptionTypeDefaultDescription
parallelnumber | boolean3Max parallel tasks

Remote Cache

OptionTypeDefaultDescription
remoteCache.urlstring-Cache server URL. HTTP: https://.... REAPI: grpcs://host:port (TLS) or grpc://host:port (cleartext)
remoteCache.tokenstring-HTTP Authorization: Bearer … token. HTTP-only — REAPI uses bearerToken
remoteCache.teamIdstring-Team / namespace for cache isolation
remoteCache.mode"read" | "readwrite" | "write""readwrite"Canonical read/write flag (replaces the removed read / write boolean pair)
remoteCache.backend"http" | "reapi""http"Wire protocol selector. "reapi" requires the optional peers @grpc/grpc-js + @grpc/proto-loader
remoteCache.compression"gzip" | "brotli""gzip"HTTP-only tarball compression
remoteCache.signing{ secret: string, verifyOnDownload?: boolean }-HTTP HMAC-SHA256 signing. Secret must be ≥ 16 chars. Streaming verification on download
remoteCache.bearerTokenstring-REAPI bearer token. Refused over grpc:// unless allowInsecureBearer: true
remoteCache.instanceNamestring-REAPI instance_name for multi-tenant servers
remoteCache.allowInsecureBearerbooleanfalseOpt out of REAPI's cleartext-bearer guard (loopback / mesh-mTLS sidecar only)
remoteCache.timeoutnumber30000Per-call request timeout in ms
remoteCache.onUploadError(hash, error) => void-Surfaces fire-and-forget upload errors (otherwise silently dropped)

The earlier read / write boolean pair was removed in favor of mode. There is no automatic migration — translate manually:

// before
remoteCache: { url, token, read: true, write: false }
// after
remoteCache: { url, token, mode: "read" }

Output

OptionTypeDefaultDescription
summarizebooleanfalseGenerate JSON run summary
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues