MCPcopy
hub / github.com/prisma/prisma / getNewPatchDevVersion

Function getNewPatchDevVersion

scripts/ci/publish.ts:307–319  ·  view source on GitHub ↗
(packages: Packages, patchBranch: string)

Source from the content-addressed store, hash-verified

305}
306
307async function getNewPatchDevVersion(packages: Packages, patchBranch: string): Promise<string> {
308 const patchMajorMinor = getSemverFromPatchBranch(patchBranch)
309 if (!patchMajorMinor) {
310 throw new Error(`Could not get major and minor for ${patchBranch}`)
311 }
312 const currentPatch = await getCurrentPatchForPatchVersions(patchMajorMinor)
313 const newPatch = currentPatch + 1
314 const newVersion = `${patchMajorMinor.major}.${patchMajorMinor.minor}.${newPatch}`
315 const versions = [...(await getAllVersionsPublishedFor(packages, 'dev', newVersion))]
316 const maxIncrement = getMaxPatchVersionIncrement(versions)
317
318 return `${newVersion}-dev.${maxIncrement + 1}`
319}
320
321function getMaxDevVersionIncrement(versions: string[]): number {
322 const regex = /\d+\.\d+\.\d+-dev\.(\d+)/

Callers 1

publishFunction · 0.85

Tested by

no test coverage detected