runStabilityTck
@rotorsoft/act-root / act-tck/src / runStabilityTck
Function: runStabilityTck()
runStabilityTck(
options):void
Defined in: libs/act-tck/src/stability-tck.ts:61
Snapshot-based public-API stability check. Walks each entry file plus everything it re-exports through relative imports, and compares the concatenated text against a committed Vitest snapshot.
Catches accidental rename / removal / signature drift on the public surface before a build merges. Any change that affects re-exports shows up as a snapshot diff in the PR; reviewers either accept the change (update the snapshot deliberately) or push back.
Point it at the built declarations (.d.ts) to record the surface
alone: a change to implementation then leaves the snapshot alone, and
doc comments still show. That needs a build first. Point it at source
(.ts) to skip the build, at the cost of a snapshot that also moves
with every implementation change. It follows from "./relative.js"
re-exports transitively, to .d.ts from a declaration and to .ts
from source; non-relative paths (other packages, node:)
stop the walk — drift in another package's surface is that package's
stability TCK to catch.
Parameters
options
See StabilityTckOptions.
Returns
void
Example
import path from "node:path";
import { runStabilityTck } from "@rotorsoft/act-tck";
runStabilityTck({
name: "@rotorsoft/act-http",
entryPoints: {
"/api": path.resolve("src/api/index.ts"),
"/webhook": path.resolve("src/webhook/index.ts"),
"/sse": path.resolve("src/sse/index.ts"),
"/receiver": path.resolve("src/receiver/index.ts"),
},
});