{"record":{"id":"1af8b74034ee4d3e","repo":"EveryInc/compound-engineering-plugin","slug":"unsupported-version-format-version","errorCode":null,"errorMessage":"Unsupported version format: ${version}","messagePattern":"Unsupported version format: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/release/components.ts","lineNumber":169,"sourceCode":"  }\n\n  return warnings\n}\n\nexport function applyOverride(\n  inferred: BumpLevel | null,\n  override: BumpOverride,\n): BumpLevel | null {\n  if (override === \"auto\") return inferred\n  return override\n}\n\nexport function bumpVersion(version: string, bump: BumpLevel | null): string | null {\n  if (!bump) return null\n\n  const match = /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(version)\n  if (!match) {\n    throw new Error(`Unsupported version format: ${version}`)\n  }\n\n  const major = Number(match[1])\n  const minor = Number(match[2])\n  const patch = Number(match[3])\n\n  switch (bump) {\n    case \"major\":\n      return `${major + 1}.0.0`\n    case \"minor\":\n      return `${major}.${minor + 1}.0`\n    case \"patch\":\n      return `${major}.${minor}.${patch + 1}`\n  }\n}\n\nexport async function loadCurrentVersions(cwd = process.cwd()): Promise<VersionSources> {\n  const root = await readJson<RootPackageJson>(`${cwd}/package.json`)","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/release/components.ts#L151-L187","documentation":"`bumpVersion()` only accepts strict semantic versions of the form `major.minor.patch` (three integers, no `v` prefix, no prerelease/build suffix). If `bump` is non-null and the version string does not match `^(\\d+)\\.(\\d+)\\.(\\d+)$`, it throws this error instead of guessing an increment.","triggerScenarios":"Calling `bumpVersion(version, bump)` with values like `\"1.2.3-beta.1\"`, `\"v2.0.0\"`, `\"1.2\"`, `\"1.2.3.4\"`, or an empty string, while `bump` is a valid `BumpLevel`.","commonSituations":"A plugin.json or package.json version carrying a prerelease tag; versions accidentally prefixed with `v`; hand-edited versions with missing components; versions synced from tools that emit prerelease strings.","solutions":["Normalize the version to `major.minor.patch` before calling (strip `v`, drop prerelease suffixes)","Fix the source manifest's version field in package.json / plugin.json","If you need prerelease support, strip the suffix manually and handle it yourself — the function only bumps release versions","Validate with a regex before calling to avoid the throw"],"exampleFix":"// before\nbumpVersion(\"1.2.3-beta.1\", \"minor\") // throws\n// after\nbumpVersion(\"1.2.3-beta.1\".split(\"-\")[0]!, \"minor\") // \"1.3.0\"","handlingStrategy":"validation","validationCode":"const SEMVER = /^(\\d+)\\.(\\d+)\\.(\\d+)$/u\nif (!SEMVER.test(version)) throw new Error(`Normalize to x.y.z before bumping: ${version}`)\nconst next = bumpVersion(version, bump)","typeGuard":"function isPlainSemver(v: string): v is `${number}.${number}.${number}` {\n  return /^(\\d+)\\.(\\d+)\\.(\\d+)$/.test(v)\n}","tryCatchPattern":"try {\n  const next = bumpVersion(version, bump)\n} catch (error) {\n  if (String(error).includes(\"Unsupported version format\")) {\n    console.error(`Version \"${version}\" must be major.minor.patch with no prefix or prerelease`)\n  } else throw error\n}","preventionTips":["Keep release versions bare `x.y.z` — no `v` prefix, no prerelease suffix","Let release automation write versions instead of hand-editing","Add a semver-format check to release validation before bumping"],"tags":["release","semver","validation"],"backgroundTag":"unsupported-version-format","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}