DashboardcraftCraft static bumpVersion pattern across…

Craft static bumpVersion pattern across targets

Category: architecture
Confidence: 0.90
ID: 019db1ee-c08f-7a26-b68a-dea0d9370615
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 1
Source session: (none)
Created: 2026-07-28 10:15:42
Updated: 2026-07-28 10:15:42

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 19d ago

Content

Craft auto version bumping is opt-in per target class via a static bumpVersion(rootDir, newVersion): Promise<boolean> method. src/utils/versionBump.ts discovers which target classes have it via hasBumpVersion(), calls each unique class once in config order (not per-target-instance), and records bumpable vs skipped. Returning false means no-op (e.g., no package.json found); throwing fails the whole release with context. Targets implementing it today: npm, pypi, crates, gem, pubDev, hex, nuget. github target intentionally has none. Tests live in src/__tests__/versionBump.test.ts with a hoisted mockSpawnProcess + mockHasExecutable pattern that also stubs runWithExecutable to re-invoke the mocks (since real runWithExecutable internally calls unmocked hasExecutable).

Move to: