ADR-001: TypeScript toolchain — pnpm, Biome, vitest, Node task runner

Status

Accepted

Date

2026-08-26

Deciders

@bitskrieg (Chris Apsey)

Tags

toolchain, build, testing

Context

This is the agency’s first TypeScript repository under the claude-quickstart standards, which mandate specific Rust tooling (cargo fmt/clippy, cargo-nextest, cargo xtask). pi extensions are TypeScript-by-construction (pi loads .ts via jiti; the ecosystem we vendor — gotgenes, pi-web-access — is TypeScript). We need a toolchain that preserves the standards' properties (one formatter+linter gate, one test runner, one mandatory task entrypoint, no loose shell automation) with TS-native tools.

Decision

  • Package manager: pnpm ≥ 9 with workspaces (pnpm-workspace.yaml, workspace:* protocol for intra-repo deps).

  • Format + lint: Biome (one tool ≈ fmt+clippy), config in biome.json, CI-blocking; noNonNullAssertion as the unwrap-ban analogue.

  • Types: tsc --noEmit per package against tsconfig.base.json (strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes).

  • Tests: vitest (the pi-ecosystem norm; fast-check for property tests when parsers appear).

  • Task runner: node tools/task.mjs — the cargo xtask analogue with the same verb vocabulary (fmt lint typecheck test spdx plan-lint check-docs validate). No .sh automation; hooks call the runner.

  • License mechanics: AGPL-3.0-or-later with SPDX headers on .ts/.mjs, enforced at pre-commit (staged blobs) and task spdx.

Alternatives Considered

  1. npm workspaces — no workspace:* protocol (uses bare *, weaker intent), slower installs, and the vendored ecosystem (gotgenes) is pnpm-native. Rejected for fidelity + speed.

  2. ESLint + Prettier — two tools, two configs, plugin-resolution drift; Biome gives one CI-blocking gate matching the "fmt+clippy" shape. Rejected for operational surface.

  3. Jest / node:test — Jest is heavier and slower under ESM+TS; node:test lacks the ecosystem’s fixture/reporting conventions. vitest matches the packages we bundle and the pi ecosystem. Rejected accordingly.

  4. Bun / Deno toolchains — pi runs extensions under Node/jiti; introducing a second runtime for tooling adds drift risk for zero runtime benefit here.

Consequences

  • Developers learn one entrypoint (node tools/task.mjs … / pnpm task …).

  • The pre-push battery is task validate; CI will run the same verb — parity between local and server gates.

  • workspace:* deps must be resolved to pinned versions at publish (pnpm does this automatically on pnpm publish).

Edit this page · latest