MCPcopy
hub / github.com/prisma/prisma / getNewIntegrationVersion

Function getNewIntegrationVersion

scripts/ci/publish.ts:221–243  ·  view source on GitHub ↗

* Takes the max dev version + 1 * For now supporting X.Y.Z-dev.# * @param packages Local package definitions

(packages: Packages, branch: string)

Source from the content-addressed store, hash-verified

219 * @param packages Local package definitions
220 */
221async function getNewIntegrationVersion(packages: Packages, branch: string): Promise<string> {
222 const before = Math.round(performance.now())
223 console.log('\nCalculating new integration version...')
224 // Why are we calling zeroOutPatch?
225 // Because here we're only interested in the 2.5.0 <- the next minor stable version
226 // If the current version would be 2.4.7, we would end up with 2.5.7
227 const nextStable = zeroOutPatch((await getNextMinorStable())!)
228
229 console.log(`getNewIntegrationVersion: Next minor stable: ${nextStable}`)
230
231 const branchWithoutPrefix = branch.replace(/^integration\//, '')
232 const versionNameSlug = `${nextStable}-integration-${slugify(branchWithoutPrefix)}`
233
234 const versions = await getAllVersionsPublishedFor(packages, 'integration', versionNameSlug)
235 const maxIntegration = getMaxIntegrationVersionIncrement(versions)
236
237 const version = `${versionNameSlug}.${maxIntegration + 1}`
238
239 // TODO: can we remove this?
240 console.log(`Got ${version} in ${Math.round(performance.now()) - before}ms`)
241
242 return version
243}
244
245// This function gets the current "patchMajorMinor" (major and minor of the patch branch),
246// then retrieves the current versions of @prisma/client from npm,

Callers 1

publishFunction · 0.85

Calls 6

zeroOutPatchFunction · 0.85
getNextMinorStableFunction · 0.85
slugifyFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected