code: async function nextVersion (bumpType, version) {
    if (utils.isNightly(version) || utils.isBeta(version)) {
      switch (bumpType) {
        case 'nightly':
          version = await utils.nextNightly(version)
          break
        case 'beta':
          version = await utils.nextBeta(version)
          break
        case 'stable':
          version = semver.valid(semver.coerce(version))
          break
        default:
          throw new Error('Invalid bump type.')
      }
    } else if (utils.isStable(version)) {
      switch (bumpType) {
        case 'nightly':
          version = utils.nextNightly(version)
          break
        case 'beta':
          throw new Error('Cannot bump to beta from stable.')
        case 'stable':
          version = semver.inc(version, 'patch')
          break
        default:
          throw new Error('Invalid bump type.')
      }
    } else {
      throw new Error(`Invalid current version: ${version}`)
    }
    return version
  }
docs: get next version for release based on [nightly, beta, stable]