ripencli 0.2.8 → 0.2.9

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 +19 -10
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -62,9 +62,13 @@ async function fetchVersions(packageName) {
62
62
  date: times[v] ? new Date(times[v]).toISOString().split("T")[0] : "",
63
63
  tag: tagByVersion[v]
64
64
  })).sort((a, b) => {
65
- const pa = a.version.split(".").map(Number);
66
- const pb = b.version.split(".").map(Number);
65
+ const pa = a.version.replace(/-.*$/, "").split(".").map(Number);
66
+ const pb = b.version.replace(/-.*$/, "").split(".").map(Number);
67
67
  for (let i = 0; i < 3; i++) if ((pb[i] ?? 0) !== (pa[i] ?? 0)) return (pb[i] ?? 0) - (pa[i] ?? 0);
68
+ const aHas = a.version.includes("-");
69
+ const bHas = b.version.includes("-");
70
+ if (aHas && !bHas) return 1;
71
+ if (!aHas && bHas) return -1;
68
72
  return 0;
69
73
  });
70
74
  } catch {
@@ -124,12 +128,17 @@ async function fetchLatestVersion(packageName) {
124
128
  }
125
129
  }
126
130
  function isNewerVersion(current, latest) {
127
- const a = current.split(".").map(Number);
128
- const b = latest.split(".").map(Number);
131
+ const baseA = current.replace(/-.*$/, "");
132
+ const baseB = latest.replace(/-.*$/, "");
133
+ const a = baseA.split(".").map(Number);
134
+ const b = baseB.split(".").map(Number);
129
135
  for (let i = 0; i < 3; i++) {
130
136
  if ((b[i] ?? 0) > (a[i] ?? 0)) return true;
131
137
  if ((b[i] ?? 0) < (a[i] ?? 0)) return false;
132
138
  }
139
+ const currentHasPrerelease = current.includes("-");
140
+ const latestHasPrerelease = latest.includes("-");
141
+ if (currentHasPrerelease && !latestHasPrerelease) return true;
133
142
  return false;
134
143
  }
135
144
  async function fetchRepoUrl(packageName) {
@@ -985,21 +994,21 @@ function PackageList({ packages, onToggle, onToggleGroup, onToggleMany, onSelect
985
994
  })
986
995
  }),
987
996
  /* @__PURE__ */ jsx(Box, {
988
- width: 10,
997
+ width: 14,
989
998
  children: /* @__PURE__ */ jsx(Text, {
990
999
  color: "gray",
991
1000
  children: "current"
992
1001
  })
993
1002
  }),
994
1003
  /* @__PURE__ */ jsx(Box, {
995
- width: 10,
1004
+ width: 14,
996
1005
  children: /* @__PURE__ */ jsx(Text, {
997
1006
  color: "gray",
998
1007
  children: "target"
999
1008
  })
1000
1009
  }),
1001
1010
  /* @__PURE__ */ jsx(Box, {
1002
- width: 10,
1011
+ width: 14,
1003
1012
  children: /* @__PURE__ */ jsx(Text, {
1004
1013
  color: "gray",
1005
1014
  children: "latest"
@@ -1073,21 +1082,21 @@ function PackageList({ packages, onToggle, onToggleGroup, onToggleMany, onSelect
1073
1082
  })
1074
1083
  }),
1075
1084
  /* @__PURE__ */ jsx(Box, {
1076
- width: 10,
1085
+ width: 14,
1077
1086
  children: /* @__PURE__ */ jsx(Text, {
1078
1087
  color: "red",
1079
1088
  children: pkg.current
1080
1089
  })
1081
1090
  }),
1082
1091
  /* @__PURE__ */ jsx(Box, {
1083
- width: 10,
1092
+ width: 14,
1084
1093
  children: /* @__PURE__ */ jsx(Text, {
1085
1094
  color: "greenBright",
1086
1095
  children: pkg.targetVersion ?? pkg.latest
1087
1096
  })
1088
1097
  }),
1089
1098
  /* @__PURE__ */ jsx(Box, {
1090
- width: 10,
1099
+ width: 14,
1091
1100
  children: /* @__PURE__ */ jsx(Text, {
1092
1101
  color: "gray",
1093
1102
  children: pkg.latest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripencli",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Interactive dependency updater for npm, pnpm, and yarn",
5
5
  "license": "MIT",
6
6
  "author": {