made-in-common

tsnapi

Library public API snapshot testing for runtime exports and type declarations.

by made-in-common

TypeScript

TypeScript83.2%
Vue15.5%
JavaScript0.9%
CSS0.4%
HTML0.1%

Commit activity

Last 12 weeks · 6 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
62
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
jycouet

Given: the DTS snapshot renders: The signature of is dropped (and nested namespaces lose everything below the first level), so changes to namespace member signatures don't invalidate the snapshot. Context: trying tsnapi in sveltejs/cli (sveltejs/cli#1162), where exposes most of its API through namespaces (, ...) - none of those signatures end up guarded.

jycouet · 4mo ago
jycouet

Given: the DTS snapshot only shows - the shape of is absent, so changing it doesn't invalidate the snapshot even though it changes the public contract. Would you consider inlining (or additionally emitting) declarations reachable from exports, possibly behind an option? Context: trying tsnapi in sveltejs/cli (sveltejs/cli#1162). Related but separate from #31.

jycouet · 4mo ago
antfu

Summary Extends the breaking-changes guard from #33 to the Vitest integration. delegated entirely to Vitest's , which overwrites snapshot files unconditionally on . A removed or narrowed export would slip through silently — exactly what the guard the CLI and rolldown plugin already have is meant to prevent. Changes Guard in the Vitest integration: runs before each , detecting update mode via Vitest's snapshot state (). On a removed/narrowed export it throws — failing the test and leaving the snapshot file on disk untouched. option added to (inherited by ). New exported — a pure, Vitest-independent helper (caller supplies + existing content), reusable for custom snapshot flows. README: new "Breaking changes guard" subsection under Vitest. Note on the escape hatch Vitest's CLI (cac) rejects unknown flags, so cannot be passed through . For the Vitest integration the escape hatches are the env var or the option — documented explicitly. Verification Unit tests in (9 cases, both surfaces). Also verified end-to-end against live runs: Breaking change → tests fail with , snapshot on disk unchanged. Additive change → passes through and updates (this repo's own run confirms it). → breaking update allowed through. Full suite (145), typecheck, and lint all pass. 🤖 Generated with Claude Code

antfu · 4mo ago
Structured data for AI agents

Repository: made-in-common/tsnapi. Description: Library public API snapshot testing for runtime exports and type declarations. Stars: 206, Forks: 3. Primary language: TypeScript. Languages: TypeScript (83.2%), Vue (15.5%), JavaScript (0.9%), CSS (0.4%), HTML (0.1%). License: MIT. Topics: snapshot, snapshot-testing. Latest release: v1.6.1 (3w ago). Open PRs: 0, open issues: 0. Last activity: 18h ago. Community health: 62%. Top contributors: antfu, antfubot, jycouet.