()
| 27 | |
| 28 | // This is the primary control function for this script. |
| 29 | async function main() { |
| 30 | clear(); |
| 31 | |
| 32 | await checkNPMPermissions(); |
| 33 | |
| 34 | const sha = await getPreviousCommitSha(); |
| 35 | const [shortCommitLog, formattedCommitLog] = await getCommitLog(sha); |
| 36 | |
| 37 | console.log(''); |
| 38 | console.log( |
| 39 | 'This release includes the following commits:', |
| 40 | chalk.gray(shortCommitLog) |
| 41 | ); |
| 42 | console.log(''); |
| 43 | |
| 44 | const releaseType = await getReleaseType(); |
| 45 | |
| 46 | const path = join(ROOT_PATH, PACKAGE_PATHS[0]); |
| 47 | const previousVersion = readJsonSync(path).version; |
| 48 | const {major, minor, patch} = semver(previousVersion); |
| 49 | const nextVersion = |
| 50 | releaseType === 'minor' |
| 51 | ? `${major}.${minor + 1}.0` |
| 52 | : `${major}.${minor}.${patch + 1}`; |
| 53 | |
| 54 | updateChangelog(nextVersion, formattedCommitLog); |
| 55 | |
| 56 | await reviewChangelogPrompt(); |
| 57 | |
| 58 | updatePackageVersions(previousVersion, nextVersion); |
| 59 | updateManifestVersions(previousVersion, nextVersion); |
| 60 | |
| 61 | console.log(''); |
| 62 | console.log( |
| 63 | `Packages and manifests have been updated from version ${chalk.bold( |
| 64 | previousVersion |
| 65 | )} to ${chalk.bold(nextVersion)}` |
| 66 | ); |
| 67 | console.log(''); |
| 68 | |
| 69 | await commitPendingChanges(previousVersion, nextVersion); |
| 70 | |
| 71 | printFinalInstructions(); |
| 72 | } |
| 73 | |
| 74 | async function commitPendingChanges(previousVersion, nextVersion) { |
| 75 | console.log(''); |
no test coverage detected