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 inbiome.json, CI-blocking;noNonNullAssertionas theunwrap-ban analogue. -
Types:
tsc --noEmitper package againsttsconfig.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— thecargo xtaskanalogue with the same verb vocabulary (fmt lint typecheck test spdx plan-lint check-docs validate). No.shautomation; hooks call the runner. -
License mechanics: AGPL-3.0-or-later with SPDX headers on
.ts/.mjs, enforced at pre-commit (staged blobs) andtask spdx.
Alternatives Considered
-
npm workspaces — no
workspace:*protocol (uses bare*, weaker intent), slower installs, and the vendored ecosystem (gotgenes) is pnpm-native. Rejected for fidelity + speed. -
ESLint + Prettier — two tools, two configs, plugin-resolution drift; Biome gives one CI-blocking gate matching the "fmt+clippy" shape. Rejected for operational surface.
-
Jest / node:test — Jest is heavier and slower under ESM+TS;
node:testlacks the ecosystem’s fixture/reporting conventions. vitest matches the packages we bundle and the pi ecosystem. Rejected accordingly. -
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 onpnpm publish).