* Takes the max dev version + 1 * For now supporting X.Y.Z-dev.# * @param packages Local package definitions
(packages: Packages, branch: string)
| 219 | * @param packages Local package definitions |
| 220 | */ |
| 221 | async 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, |
no test coverage detected