nairon-bench 0.2.1 → 0.2.2

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/index.js +54 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24596,6 +24596,16 @@ var BOLD3 = "\x1B[1m";
24596
24596
  var RESET3 = "\x1B[0m";
24597
24597
  var MAGENTA3 = "\x1B[35m";
24598
24598
  var CHANGELOG = [
24599
+ {
24600
+ version: "0.2.2",
24601
+ date: "2026-02-14",
24602
+ title: "Upgrade Command Fixes",
24603
+ highlights: [
24604
+ "nb upgrade now shows What's New from GitHub releases",
24605
+ "Fixed bun command for global package install",
24606
+ "Slack notifications now include release highlights"
24607
+ ]
24608
+ },
24599
24609
  {
24600
24610
  version: "0.2.0",
24601
24611
  date: "2026-02-14",
@@ -24727,10 +24737,7 @@ var upgradeCommand = defineCommand2({
24727
24737
  console.log(` ${DIM3}Run 'nb upgrade --changelog' to see past releases${RESET3}`);
24728
24738
  return;
24729
24739
  }
24730
- const newReleases = getNewReleases(currentVersion, latestVersion);
24731
- if (newReleases.length > 0) {
24732
- showWhatsNew(newReleases);
24733
- }
24740
+ await showWhatsNewRemote(currentVersion, latestVersion);
24734
24741
  if (args.check) {
24735
24742
  console.log();
24736
24743
  console.log(` ${DIM3}Run 'nb upgrade' to install${RESET3}`);
@@ -24741,11 +24748,10 @@ var upgradeCommand = defineCommand2({
24741
24748
  console.log(` ${CYAN3}↓${RESET3} Upgrading to ${GREEN3}v${latestVersion}${RESET3}...`);
24742
24749
  console.log();
24743
24750
  try {
24744
- try {
24745
- execSync6("bun add -g nairon-bench@latest", { stdio: "inherit" });
24746
- } catch {
24747
- execSync6("npm install -g nairon-bench@latest", { stdio: "inherit" });
24748
- }
24751
+ execSync6("npm install -g nairon-bench@latest", {
24752
+ stdio: "inherit",
24753
+ env: { ...process.env, npm_config_fund: "false" }
24754
+ });
24749
24755
  console.log();
24750
24756
  console.log(` ${GREEN3}✓${RESET3} Upgraded to ${GREEN3}v${latestVersion}${RESET3}`);
24751
24757
  console.log();
@@ -24754,8 +24760,6 @@ var upgradeCommand = defineCommand2({
24754
24760
  console.log();
24755
24761
  console.log(` ${YELLOW3}⚠${RESET3} Upgrade failed`);
24756
24762
  console.log(` ${DIM3}Try running manually:${RESET3}`);
24757
- console.log(` ${CYAN3}bun add -g nairon-bench@latest${RESET3}`);
24758
- console.log(` ${DIM3}or${RESET3}`);
24759
24763
  console.log(` ${CYAN3}npm install -g nairon-bench@latest${RESET3}`);
24760
24764
  }
24761
24765
  }
@@ -24787,6 +24791,44 @@ function getNewReleases(currentVersion, latestVersion) {
24787
24791
  return compareVersions(entry.version, currentVersion) > 0 && compareVersions(entry.version, latestVersion) <= 0;
24788
24792
  });
24789
24793
  }
24794
+ async function showWhatsNewRemote(currentVersion, latestVersion) {
24795
+ const localReleases = getNewReleases(currentVersion, latestVersion);
24796
+ if (localReleases.length > 0) {
24797
+ showWhatsNew(localReleases);
24798
+ return;
24799
+ }
24800
+ try {
24801
+ const response = await fetch(`https://api.github.com/repos/ObaidUr-Rahmaan/nairon-bench/releases`, { headers: { "User-Agent": "nairon-bench-cli" } });
24802
+ if (!response.ok) {
24803
+ return;
24804
+ }
24805
+ const releases = await response.json();
24806
+ const newReleases = releases.filter((r3) => {
24807
+ const version2 = r3.tag_name.replace(/^v/, "");
24808
+ return compareVersions(version2, currentVersion) > 0 && compareVersions(version2, latestVersion) <= 0;
24809
+ }).slice(0, 3);
24810
+ if (newReleases.length === 0)
24811
+ return;
24812
+ console.log(` ${BOLD3}${MAGENTA3}What's New${RESET3}`);
24813
+ console.log();
24814
+ for (const release of newReleases) {
24815
+ const version2 = release.tag_name.replace(/^v/, "");
24816
+ const date = new Date(release.published_at).toISOString().split("T")[0];
24817
+ console.log(` ${CYAN3}${BOLD3}v${version2}${RESET3} ${DIM3}(${date})${RESET3}`);
24818
+ console.log(` ${release.name || `Release ${version2}`}`);
24819
+ console.log();
24820
+ const lines = (release.body || "").split(`
24821
+ `);
24822
+ const highlights = lines.filter((l2) => l2.trim().startsWith("-") || l2.trim().startsWith("*")).slice(0, 4).map((l2) => l2.replace(/^[\s\-\*]+/, "").trim());
24823
+ for (const highlight of highlights) {
24824
+ if (highlight) {
24825
+ console.log(` ${GREEN3}•${RESET3} ${highlight}`);
24826
+ }
24827
+ }
24828
+ console.log();
24829
+ }
24830
+ } catch {}
24831
+ }
24790
24832
  function showWhatsNew(releases) {
24791
24833
  console.log(` ${BOLD3}${MAGENTA3}What's New${RESET3}`);
24792
24834
  console.log();
@@ -24826,7 +24868,7 @@ function showFullChangelog() {
24826
24868
  // package.json
24827
24869
  var package_default = {
24828
24870
  name: "nairon-bench",
24829
- version: "0.2.1",
24871
+ version: "0.2.2",
24830
24872
  description: "AI workflow benchmarking CLI",
24831
24873
  type: "module",
24832
24874
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nairon-bench",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "AI workflow benchmarking CLI",
5
5
  "type": "module",
6
6
  "bin": {