antfu-collective / bumpp

Interactive CLI that bumps your version numbers and more
https://jstools.dev/version-bump-prompt/
MIT License
597 stars 43 forks source link

`Failed to locate the previous tag v0.1.0` if package version starts at 0.0.0 with no previous tags #52

Open mkpoli opened 6 days ago

mkpoli commented 6 days ago

Describe the bug

If the package has no previous versions and/or starts with 0.0.0 rather than 0.1.0, it is impossible to bump from 0.0.0 to 0.1.0. It will prompt Failed to locate the previous tag v0.1.0.

Reproduction

bun init
{
  "name": "bumper",
  "module": "index.ts",
  "type": "module",
  "private": true,
  "version": "0.1.0",
  "devDependencies": {
    "@types/bun": "latest",
    "bumpp": "^9.7.1"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  }
}
bunx bumpp

image

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 106.01 GB / 127.92 GB
  Binaries:
    Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.5.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.10.0 - C:\Program Files\nodejs\pnpm.CMD
    bun: 1.1.30 - ~\.bun\bin\bun.EXE
  Browsers:
    Chrome: 129.0.6668.100
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355

Used Package Manager

bun

Validations

Contributions

mkpoli commented 6 days ago

Apparently the error is cause by the following code, however even if I turned the print-commits off it still persists.

https://github.com/antfu-collective/bumpp/blob/e461b8fddde1bff03523aac8b5c9103f66de22bd/src/print-commits.ts#L111-L117