From 8f5f70f7373f4227e2e5f22eba12ee92d60e0aa1 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 4 Apr 2024 10:30:07 +0200 Subject: [PATCH] build: add beta --- scripts/release.mjs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/release.mjs b/scripts/release.mjs index a119502e42..eedf30779a 100644 --- a/scripts/release.mjs +++ b/scripts/release.mjs @@ -28,8 +28,6 @@ let { // (semver.prerelease(currentVersion) && semver.prerelease(currentVersion)[0]) const EXPECTED_BRANCH = 'v2' -const incrementVersion = (increment) => - semver.inc(currentVersion, increment, preId) const bin = (name) => resolve(__dirname, '../node_modules/.bin/' + name) /** * @param bin {string} @@ -137,6 +135,11 @@ async function main() { message: `Select release type for ${chalk.bold.white(name)}`, choices: versionIncrements .map((i) => `${i}: ${name} (${semver.inc(version, i, preId)})`) + .concat( + optionTag === 'beta' + ? [`beta: ${name} (${semver.inc(version, 'prerelease', 'beta')})`] + : [] + ) .concat(['custom']), }) @@ -176,10 +179,8 @@ async function main() { return } - if (!noDepsUpdate) { - step('\nUpdating versions in package.json files...') - await updateVersions(pkgWithVersions) - } + step('\nUpdating versions in package.json files...') + await updateVersions(pkgWithVersions) step('\nUpdating lock...') await runIfNotDry(`pnpm`, ['install']) @@ -260,8 +261,10 @@ async function updateVersions(packageList) { return Promise.all( packageList.map(({ pkg, version, path, name }) => { pkg.version = version - updateDeps(pkg, 'dependencies', packageList) - updateDeps(pkg, 'peerDependencies', packageList) + if (!noDepsUpdate) { + updateDeps(pkg, 'dependencies', packageList) + updateDeps(pkg, 'peerDependencies', packageList) + } const content = JSON.stringify(pkg, null, 2) + '\n' return isDryRun ? dryRun('write', [name], {