ripencli 0.1.2 → 0.1.4

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +19 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -54,7 +54,7 @@ ripen --help
54
54
  2. Runs the appropriate `outdated --json` command to find outdated packages
55
55
  3. Shows them in a colorful interactive list
56
56
  4. Press `v` on any package to pick a specific version from the npm registry
57
- 5. Press `c` to see GitHub release notes between your current and target version
57
+ 5. Press `c` to see GitHub release notes between your current and target version, you see all release notes
58
58
  6. Select the ones you want and press enter — ripen runs the update commands for you
59
59
 
60
60
  When using `ripen -g`, all available package managers are checked in parallel so you see every global package in one place.
package/dist/cli.js CHANGED
@@ -17,6 +17,16 @@ function detectPackageManager(cwd) {
17
17
  if (existsSync(join(cwd, "package-lock.json"))) return "npm";
18
18
  return "npm";
19
19
  }
20
+ /**
21
+ * Detect which package manager installed ripen globally
22
+ * by checking the path of the running script.
23
+ */
24
+ function detectGlobalInstallManager() {
25
+ const scriptPath = (process.argv[1] ?? "").replace(/\\/g, "/").toLowerCase();
26
+ if (scriptPath.includes("/pnpm/") || scriptPath.includes("/pnpm-global/")) return "pnpm";
27
+ if (scriptPath.includes("/yarn/")) return "yarn";
28
+ return "npm";
29
+ }
20
30
  function hasPackageJson(cwd) {
21
31
  return existsSync(join(cwd, "package.json"));
22
32
  }
@@ -1708,7 +1718,7 @@ function SelfUpdatePrompt({ currentVersion, latestVersion, updating, error, onUp
1708
1718
  }
1709
1719
  //#endregion
1710
1720
  //#region src/ui/App.tsx
1711
- function App({ project, global, version }) {
1721
+ function App({ project, global, version, installManager }) {
1712
1722
  const { exit } = useApp();
1713
1723
  const [screen, setScreen] = useState("self-update-check");
1714
1724
  const [latestVersion, setLatestVersion] = useState(null);
@@ -1805,8 +1815,12 @@ function App({ project, global, version }) {
1805
1815
  const handleSelfUpdate = async () => {
1806
1816
  setSelfUpdating(true);
1807
1817
  try {
1808
- await execa("npm", [
1809
- "install",
1818
+ await execa(installManager, installManager === "yarn" ? [
1819
+ "global",
1820
+ "add",
1821
+ `ripencli@${latestVersion}`
1822
+ ] : [
1823
+ "add",
1810
1824
  "--global",
1811
1825
  `ripencli@${latestVersion}`
1812
1826
  ]);
@@ -2083,7 +2097,8 @@ if (!isGlobal && !hasPackageJson(cwd)) {
2083
2097
  const { waitUntilExit } = render(/* @__PURE__ */ jsx(App, {
2084
2098
  project: getProjectInfo(cwd),
2085
2099
  global: isGlobal,
2086
- version: VERSION
2100
+ version: VERSION,
2101
+ installManager: detectGlobalInstallManager()
2087
2102
  }));
2088
2103
  await waitUntilExit();
2089
2104
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripencli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Interactive dependency updater for npm, pnpm, and yarn",
5
5
  "type": "module",
6
6
  "bin": {