Wireit
Upgrade your npm, pnpm, or yarn scripts with dependency graphs, caching, and watch mode
Repository Health
Technical Analysis
Wireit is a build-orchestration tool from Google that upgrades existing npm, pnpm, and yarn scripts without requiring you to replace npm run. By moving a script’s command into a wireit section of package.json, Wireit gains the ability to run dependent scripts in the correct order (in parallel where safe), skip scripts whose inputs haven’t changed since the last successful run, and cache output locally or in GitHub Actions so CI and local builds can reuse prior results instead of recomputing them.
It is designed for incremental adoption: scripts that aren’t configured for Wireit continue to work as plain npm scripts and can still be declared as dependencies, so teams can convert one script at a time. This makes it a natural fit for npm workspaces and other JavaScript monorepos where scripts across packages need to run in dependency order.
What You Get
- Automatic ordering and parallel execution of dependent npm/pnpm/yarn scripts based on a declared dependency graph
- Incremental builds that skip a script entirely when its declared input files haven’t changed
- Local and GitHub Actions output caching, so identical inputs reuse a prior run’s output instead of re-executing
- Built-in watch mode that re-runs a script (and its dependents) whenever its input files change
- Cross-package dependency syntax (
<relative-path>:<script-name>) for npm workspaces and other monorepos - A VSCode extension that adds hover documentation, autocomplete, and diagnostics for
wireitconfig inpackage.json
Common Use Cases
- Speeding up monorepo CI by caching and skipping unchanged build/test/lint scripts across packages
- Wiring cross-package build order in npm/pnpm workspaces without a separate task runner
- Adding watch-and-rebuild behavior to a TypeScript or bundler script without extra tooling
- Avoiding redundant test runs in CI by caching zero-output scripts (e.g.
output: []) that only need to pass once per input set
Under The Hood
Architecture Wireit’s cli.ts entry point resolves the invoked npm/pnpm/yarn script name, then analyzer.ts walks the wireit section of package.json (and cross-package references via relative paths) to build a dependency graph of scripts. executor.ts walks that graph, launching independent branches concurrently via script-child-process.ts while respecting per-script dependencies ordering, and fingerprint.ts computes a content hash over each script’s declared files glob to decide whether a run can be skipped or served from cache. The caching/ directory implements both a local .wireit cache and a GitHub Actions cache backend, and watcher.ts re-triggers the executor when watched input files change. A language-server.ts/ide.ts pair backs the companion VSCode extension with hover docs and diagnostics. Tech Stack The project is a TypeScript codebase (99.7% of source) built with tsc, distributed as a single wireit npm bin, with zero required runtime dependencies for its core logic beyond Node’s built-ins and a small glob-matching library; the VSCode extension is a separate workspace inside the same repo. Code Quality The src/test/ directory contains dozens of dedicated suites (basic.test.ts, caching, freshness.test.ts, watch.test.ts, errors-*.test.ts, diagnostic.test.ts, and more), indicating deliberate coverage of caching correctness, error paths, and IDE diagnostics rather than only happy-path behavior; the code is written in strict TypeScript with typed config parsing and explicit error/diagnostic objects rather than thrown strings. API Design The public surface is deliberately minimal — a single wireit value substituted into existing scripts entries plus a declarative wireit config block — so adopting it requires no new command vocabulary beyond npm run, though the full feature set (files/output globs, cross-package dependency syntax, environment variables) does require reading the README to use well.
Used by 2 apps in this directory
authentik
Authentication · Security
The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.
likec4
Developer Tools · Devops
Define your software architecture as code and get always up-to-date, interactive C4 diagrams generated automatically from a DSL.