Skip to content

Commit e8dcb18

Browse files
committed
debugging
1 parent dc919a0 commit e8dcb18

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

src/__e2e__/publishRegistry.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ describe('publish command (registry)', () => {
161161
it('will perform retries', async () => {
162162
registry.stop();
163163

164-
// hide the errors for this test--it's supposed to have errors, and showing them is misleading
165-
logs.init(false);
164+
logs.init(true);
165+
// // hide the errors for this test--it's supposed to have errors, and showing them is misleading
166+
// logs.init(false);
166167

167168
factory = new RepositoryFactory('single');
168169
factory.init();

src/__fixtures__/mockLogs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function initMockLogs(opts?: MockLogsOptions | boolean | MockLogMethod[])
4444

4545
const logs: MockLogs = {
4646
mocks: {} as MockLogs['mocks'],
47-
realConsole: { ...console },
47+
realConsole: { ...require('console') },
4848
init: (shouldLog = alsoLog) => {
4949
logs.restore(); // clear any previous mocks
5050
mockedMethods.forEach(method => {

src/__fixtures__/repository.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ${gitResult.stderr.toString()}`);
7777
return gitResult;
7878
}
7979

80-
/** Log the results of a git command to stdio (for debugging) */
80+
/** Log the results of a git command to non-wrapped console.log (for debugging) */
8181
async gitConsoleLog(args: string[]) {
8282
realConsole.log(`$ git ${args.join(' ')}`);
8383
const res = await execa('git', args, { cwd: this.rootPath, all: true, reject: false });

src/publish/publishToRegistry.ts

+7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export async function publishToRegistry(originalBumpInfo: BumpInfo, options: Bea
1818
const bumpInfo = _.cloneDeep(originalBumpInfo);
1919
const { modifiedPackages, newPackages, packageInfos } = bumpInfo;
2020

21+
console.log('Bumping versions');
2122
if (options.bump) {
2223
await performBump(bumpInfo, options);
2324
}
25+
console.log('Finished bumping versions');
2426

2527
const succeededPackages = new Set<string>();
2628

2729
let invalid = false;
30+
console.log('Validating versions');
2831
if (!(await validatePackageVersions(bumpInfo, registry))) {
2932
displayManualRecovery(bumpInfo, succeededPackages);
3033
invalid = true;
@@ -37,16 +40,20 @@ export async function publishToRegistry(originalBumpInfo: BumpInfo, options: Bea
3740
process.exit(1);
3841
}
3942

43+
console.log('Validation passed');
4044
// get the packages to publish, reducing the set by packages that don't need publishing
4145
const packagesToPublish = toposortPackages([...modifiedPackages, ...newPackages], packageInfos).filter(pkg => {
4246
const { publish, reasonToSkip } = shouldPublishPackage(bumpInfo, pkg);
4347
if (!publish) {
4448
console.log(`Skipping publish - ${reasonToSkip}`);
49+
} else {
50+
console.log('Publishing - ' + pkg);
4551
}
4652
return publish;
4753
});
4854

4955
// performing publishConfig and workspace version overrides requires this procedure to ONLY be run right before npm publish, but NOT in the git push
56+
console.log('Performing publish overrides');
5057
performPublishOverrides(packagesToPublish, bumpInfo.packageInfos);
5158

5259
// if there is a prepublish hook perform a prepublish pass, calling the routine on each package

src/publish/validatePackageDependencies.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { shouldPublishPackage } from './shouldPublishPackage';
55
* Validate no private package is listed as package dependency for packages which will be published.
66
*/
77
export function validatePackageDependencies(bumpInfo: BumpInfo): boolean {
8+
console.log('Validating package dependencies');
89
let hasErrors: boolean = false;
910
const { modifiedPackages, newPackages, packageInfos } = bumpInfo;
1011

0 commit comments

Comments
 (0)