Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (semver.prerelease(bumpVersion)) {
args.push('--exact')
}
}
if (process.env.CI) {
args.push('--yes')
}
info(`📦 Bumping ${packageName} packages and generating changelogs...`)
let releaseVersion
try {
await runCommandAsync('lerna', [
'version',
...args,
'--include-merged-tags',
'--no-push',
'--no-git-tag-version',
'--force-publish=*',
'--conventional-commits'
])
releaseVersion = await syncRootPackageVersion(true)
info(`📦 Done bumping ${packageName} to ${releaseVersion}!`)
} catch (err) {
error(err)
process.exit(1)
}
return Promise.all(getPackages().map(async pkg => {
if (pkg.private) {
info(`${pkg.name} is private.`)
} else {
const toTag = `${pkg.name}@${versionToTag}`
info(`📦 Running 'dist-tag ${command} ${toTag} ${tag}'...`)
try {
await runCommandAsync('npm', ['dist-tag', command, toTag, tag])
} catch (err) {
error(err)
}
info(`📦 ${toTag} tags were successfully updated!`)
}
}))
}
return Promise.all(usedPackages.map(async pkg => {
if (linkCommand === 'link') {
await runCommandAsync('lerna', ['exec', '--scope', pkg.name, '--', 'yarn', linkCommand])
}
await runCommandAsync('yarn', [linkCommand, pkg.name, '--cwd', appDir])
info(`${linkCommand}ing ${pkg.name} in ${appDir}`)
}))
}
return Promise.all(usedPackages.map(async pkg => {
if (linkCommand === 'link') {
await runCommandAsync('lerna', ['exec', '--scope', pkg.name, '--', 'yarn', linkCommand])
}
await runCommandAsync('yarn', [linkCommand, pkg.name, '--cwd', appDir])
info(`${linkCommand}ing ${pkg.name} in ${appDir}`)
}))
}