Configs2026年7月14日·1 分钟阅读

Wireit — Smart npm Script Orchestrator by Google

Wireit upgrades npm, pnpm, and Yarn scripts with dependency graphs, caching, watch mode, and incremental builds — all configured directly in package.json without a separate build tool.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Wireit Script Orchestrator
直接安装命令
npx -y tokrepo@latest install 6bab1117-7f1c-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Wireit is a build orchestration tool by Google that enhances existing npm/pnpm/Yarn scripts with dependency graphs, file-based caching, incremental builds, and watch mode. Instead of replacing your build tool, Wireit wraps your existing scripts and adds intelligence: it skips tasks when inputs have not changed, runs independent tasks in parallel, and watches files for automatic rebuilds.

What Wireit Does

  • Adds dependency graphs between npm scripts so tasks run in correct order
  • Caches task outputs based on input file fingerprints to skip unchanged work
  • Runs independent tasks in parallel for faster builds
  • Provides file-watch mode that reruns tasks when source files change
  • Works across monorepo packages with cross-package dependencies

Architecture Overview

Wireit reads its configuration from the wireit key in package.json. Each script entry declares its command, input files, output files, and dependencies on other scripts. When a script is invoked, Wireit builds a DAG of all dependencies, fingerprints input files, and checks a local cache. If the fingerprint matches a cached run, it restores outputs from cache instead of re-executing. Independent branches of the DAG run concurrently.

Self-Hosting & Configuration

  • Install as a dev dependency; no global install required
  • All configuration lives in package.json under the wireit key
  • Specify input files with glob patterns in the files array
  • Declare task dependencies with the dependencies array referencing other script names
  • Enable watch mode by running the script with WIREIT_WATCH=true or --watch flag

Key Features

  • Zero migration cost — works with existing npm scripts; just wrap with wireit
  • Input-based caching skips tasks when source files have not changed
  • Cross-package dependencies in monorepos via colon-separated package references
  • Parallel execution of independent tasks in the dependency graph
  • GitHub Actions cache integration for sharing build caches across CI runs

Comparison with Similar Tools

  • Turborepo — monorepo-focused build system; Wireit works at the script level without a separate config file
  • Nx — full monorepo toolkit with generators; Wireit is lighter, enhancing existing scripts
  • GNU Make — classic build tool with Makefile syntax; Wireit uses package.json natively
  • Task — Go-based task runner with YAML config; Wireit integrates directly into the npm ecosystem
  • Lerna — monorepo version/publish tool; Wireit focuses on build orchestration and caching

FAQ

Q: Does Wireit replace my build tools (tsc, esbuild, Webpack)? A: No. Wireit wraps your existing scripts and adds caching, dependencies, and parallelism. Your build tools run unchanged.

Q: Does Wireit work with pnpm and Yarn? A: Yes. Wireit works with any package manager that runs scripts from package.json.

Q: How does caching work? A: Wireit fingerprints all files listed in the files array. If the fingerprint matches a previous run, it restores outputs from a local cache directory.

Q: Can I share caches across CI runs? A: Yes. Wireit supports GitHub Actions cache integration and can store/restore caches from remote storage.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产