Dashboard › craft › Craft static bumpVersion pattern across…
019db1ee-c08f-7a26-b68a-dea0d9370615| Project | Hits | Last recalled |
|---|---|---|
| opencode-lore | 1 | 19d ago |
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).