pubz 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +34 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1149,13 +1149,13 @@ async function main() {
1149
1149
  process.exit(1);
1150
1150
  }
1151
1151
  let packages = await discoverPackages(cwd);
1152
- const publishablePackages = packages.filter((p) => !p.isPrivate);
1152
+ const publishablePackages = packages.filter((p) => !p.isPrivate || options.skipPublish);
1153
1153
  if (publishablePackages.length === 0) {
1154
1154
  console.log(yellow("No publishable packages found."));
1155
1155
  console.log("");
1156
1156
  console.log(muted("Make sure your packages:"));
1157
1157
  console.log(muted(' - Have a package.json with a "name" field'));
1158
- console.log(muted(' - Do not have "private": true'));
1158
+ console.log(muted(' - Do not have "private": true (or use --skip-publish for private packages)'));
1159
1159
  console.log("");
1160
1160
  process.exit(1);
1161
1161
  }
@@ -1400,8 +1400,10 @@ async function main() {
1400
1400
  console.log("");
1401
1401
  }
1402
1402
  }
1403
- console.log("✅ " + green(bold(`Released v${newVersion}!`)));
1404
- console.log("");
1403
+ if (!options.skipPublish) {
1404
+ console.log("" + green(bold(`Published v${newVersion}!`)));
1405
+ console.log("");
1406
+ }
1405
1407
  const changelog = await generateChangelog(cwd);
1406
1408
  if (changelog.terminal) {
1407
1409
  frameHeader("\uD83D\uDCCB Changelog");
@@ -1438,6 +1440,7 @@ async function main() {
1438
1440
  }
1439
1441
  }
1440
1442
  }
1443
+ const errors = [];
1441
1444
  if (!options.dryRun) {
1442
1445
  let shouldTag;
1443
1446
  let shouldPush = false;
@@ -1464,27 +1467,44 @@ async function main() {
1464
1467
  if (tagResult.success) {
1465
1468
  if (shouldPush) {
1466
1469
  frameLine(dim("Pushing tag to origin..."));
1467
- await pushGitTag(newVersion, cwd, options.dryRun);
1468
- if (releaseNotes && shouldRelease) {
1469
- frameLine(dim("Creating GitHub release..."));
1470
- const releaseResult = await createGitHubRelease(newVersion, releaseNotes, cwd, options.dryRun);
1471
- if (releaseResult.success && releaseResult.url) {
1472
- frameLine(` Release: ${cyan(releaseResult.url)}`);
1473
- } else if (!releaseResult.success) {
1474
- frameLine(yellow(releaseResult.error ?? "Failed to create GitHub release"));
1470
+ const pushResult = await pushGitTag(newVersion, cwd, options.dryRun);
1471
+ if (pushResult.success) {
1472
+ if (releaseNotes && shouldRelease) {
1473
+ frameLine(dim("Creating GitHub release..."));
1474
+ const releaseResult = await createGitHubRelease(newVersion, releaseNotes, cwd, options.dryRun);
1475
+ if (releaseResult.success && releaseResult.url) {
1476
+ frameLine(` Release: ${cyan(releaseResult.url)}`);
1477
+ } else if (!releaseResult.success) {
1478
+ const msg = releaseResult.error ?? "Failed to create GitHub release";
1479
+ frameLine(red(msg));
1480
+ errors.push(msg);
1481
+ }
1475
1482
  }
1483
+ } else {
1484
+ const msg = pushResult.error ?? "Failed to push tag to origin";
1485
+ frameLine(red(msg));
1486
+ errors.push(msg);
1476
1487
  }
1477
1488
  } else {
1478
1489
  frameLine(`Push manually: ${dim(`git push origin v${newVersion}`)}`);
1479
1490
  }
1480
1491
  } else {
1481
- frameLine(red(tagResult.error ?? "Failed to create git tag"));
1492
+ const msg = tagResult.error ?? "Failed to create git tag";
1493
+ frameLine(red(msg));
1494
+ errors.push(msg);
1482
1495
  }
1483
1496
  frameFooter();
1484
1497
  console.log("");
1485
1498
  }
1486
1499
  }
1487
- console.log("\uD83C\uDF89 " + green(bold("Done!")));
1500
+ if (errors.length > 0) {
1501
+ console.log("⚠️ " + yellow(bold("Done with errors:")));
1502
+ for (const err of errors) {
1503
+ console.log(` ${red("•")} ${err}`);
1504
+ }
1505
+ } else {
1506
+ console.log("\uD83C\uDF89 " + green(bold("Done!")));
1507
+ }
1488
1508
  closePrompt();
1489
1509
  }
1490
1510
  main().catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pubz",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Interactive CLI for publishing npm packages (single or monorepo)",
5
5
  "type": "module",
6
6
  "bin": {