diff --git a/src/__e2e__/publishRegistry.test.ts b/src/__e2e__/publishRegistry.test.ts index 15d1ab575..0d8f6b45b 100644 --- a/src/__e2e__/publishRegistry.test.ts +++ b/src/__e2e__/publishRegistry.test.ts @@ -161,8 +161,9 @@ describe('publish command (registry)', () => { it('will perform retries', async () => { registry.stop(); - // hide the errors for this test--it's supposed to have errors, and showing them is misleading - logs.init(false); + logs.init(true); + // // hide the errors for this test--it's supposed to have errors, and showing them is misleading + // logs.init(false); factory = new RepositoryFactory('single'); factory.init(); diff --git a/src/__fixtures__/mockLogs.ts b/src/__fixtures__/mockLogs.ts index c6db65f5e..45e83a964 100644 --- a/src/__fixtures__/mockLogs.ts +++ b/src/__fixtures__/mockLogs.ts @@ -44,7 +44,7 @@ export function initMockLogs(opts?: MockLogsOptions | boolean | MockLogMethod[]) const logs: MockLogs = { mocks: {} as MockLogs['mocks'], - realConsole: { ...console }, + realConsole: { ...require('console') }, init: (shouldLog = alsoLog) => { logs.restore(); // clear any previous mocks mockedMethods.forEach(method => { diff --git a/src/__fixtures__/repository.ts b/src/__fixtures__/repository.ts index 498c2752a..a499f771f 100644 --- a/src/__fixtures__/repository.ts +++ b/src/__fixtures__/repository.ts @@ -77,7 +77,7 @@ ${gitResult.stderr.toString()}`); return gitResult; } - /** Log the results of a git command to stdio (for debugging) */ + /** Log the results of a git command to non-wrapped console.log (for debugging) */ async gitConsoleLog(args: string[]) { realConsole.log(`$ git ${args.join(' ')}`); const res = await execa('git', args, { cwd: this.rootPath, all: true, reject: false }); diff --git a/src/publish/publishToRegistry.ts b/src/publish/publishToRegistry.ts index 6ae9d7f1f..2a64f2062 100644 --- a/src/publish/publishToRegistry.ts +++ b/src/publish/publishToRegistry.ts @@ -18,13 +18,16 @@ export async function publishToRegistry(originalBumpInfo: BumpInfo, options: Bea const bumpInfo = _.cloneDeep(originalBumpInfo); const { modifiedPackages, newPackages, packageInfos } = bumpInfo; + console.log('Bumping versions'); if (options.bump) { await performBump(bumpInfo, options); } + console.log('Finished bumping versions'); const succeededPackages = new Set(); let invalid = false; + console.log('Validating versions'); if (!(await validatePackageVersions(bumpInfo, registry))) { displayManualRecovery(bumpInfo, succeededPackages); invalid = true; @@ -37,16 +40,20 @@ export async function publishToRegistry(originalBumpInfo: BumpInfo, options: Bea process.exit(1); } + console.log('Validation passed'); // get the packages to publish, reducing the set by packages that don't need publishing const packagesToPublish = toposortPackages([...modifiedPackages, ...newPackages], packageInfos).filter(pkg => { const { publish, reasonToSkip } = shouldPublishPackage(bumpInfo, pkg); if (!publish) { console.log(`Skipping publish - ${reasonToSkip}`); + } else { + console.log('Publishing - ' + pkg); } return publish; }); // performing publishConfig and workspace version overrides requires this procedure to ONLY be run right before npm publish, but NOT in the git push + console.log('Performing publish overrides'); performPublishOverrides(packagesToPublish, bumpInfo.packageInfos); // if there is a prepublish hook perform a prepublish pass, calling the routine on each package diff --git a/src/publish/validatePackageDependencies.ts b/src/publish/validatePackageDependencies.ts index c8832585e..a042738e3 100644 --- a/src/publish/validatePackageDependencies.ts +++ b/src/publish/validatePackageDependencies.ts @@ -5,6 +5,7 @@ import { shouldPublishPackage } from './shouldPublishPackage'; * Validate no private package is listed as package dependency for packages which will be published. */ export function validatePackageDependencies(bumpInfo: BumpInfo): boolean { + console.log('Validating package dependencies'); let hasErrors: boolean = false; const { modifiedPackages, newPackages, packageInfos } = bumpInfo;