1- import { gatherBumpInfo } from '../bump/gatherBumpInfo ' ;
1+ import { bumpInMemory } from '../bump/bumpInMemory ' ;
22import type { BeachballOptions } from '../types/BeachballOptions' ;
33import { gitFailFast , getBranchName , getCurrentHash , git } from 'workspace-tools' ;
44import prompts from 'prompts' ;
@@ -12,11 +12,21 @@ import type { PackageInfos } from '../types/PackageInfo';
1212
1313/**
1414 * Potentially bump, publish, and push package changes depending on options.
15+ * @param oldPackageInfos Pre-read package info prior to version bumps
16+ * @param bumpInfo Pre-calculated bump info from `validate()` (can be undefined for tests)
1517 */
16- export async function publish ( options : BeachballOptions , oldPackageInfos : PackageInfos ) : Promise < void > ;
18+ export async function publish (
19+ options : BeachballOptions ,
20+ oldPackageInfos : PackageInfos ,
21+ bumpInfo ?: PublishBumpInfo
22+ ) : Promise < void > ;
1723/** @deprecated Must provide the package infos */
1824export async function publish ( options : BeachballOptions ) : Promise < void > ;
19- export async function publish ( options : BeachballOptions , oldPackageInfos ?: PackageInfos ) : Promise < void > {
25+ export async function publish (
26+ options : BeachballOptions ,
27+ oldPackageInfos ?: PackageInfos ,
28+ bumpInfo ?: PublishBumpInfo
29+ ) : Promise < void > {
2030 console . log ( '\nPreparing to publish' ) ;
2131
2232 const { path : cwd , branch, registry, tag } = options ;
@@ -66,7 +76,7 @@ export async function publish(options: BeachballOptions, oldPackageInfos?: Packa
6676 gitFailFast ( [ 'checkout' , '-b' , publishBranch ] , { cwd } ) ;
6777
6878 console . log ( `\nGathering info ${ options . bump ? 'to bump versions' : 'about versions and changes' } ` ) ;
69- const bumpInfo : PublishBumpInfo = gatherBumpInfo ( options , oldPackageInfos ) ;
79+ bumpInfo ||= bumpInMemory ( options , oldPackageInfos ) ;
7080
7181 // eslint-disable-next-line etc/no-deprecated
7282 if ( options . new ) {
0 commit comments