@rehpic/vcli 0.1.0-beta.78.1 → 0.1.0-beta.79.1

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.
package/dist/index.js CHANGED
@@ -5909,44 +5909,47 @@ bridgeCommand.command("status").description("Show bridge status").action(() => {
5909
5909
  ` Status: ${s.running ? `Running (PID ${s.pid})` : "Not running"}`
5910
5910
  );
5911
5911
  });
5912
- function detectInstallMethod() {
5912
+ function detectInstallMethod(version) {
5913
5913
  const execPath = process.argv[1] ?? "";
5914
+ const pkg = `@rehpic/vcli@${version}`;
5914
5915
  if (execPath.includes(".volta")) {
5915
5916
  return {
5916
5917
  method: "volta",
5917
- command: ["volta", "install", "@rehpic/vcli@latest"]
5918
+ command: ["volta", "install", pkg]
5918
5919
  };
5919
5920
  }
5920
5921
  if (execPath.includes("pnpm")) {
5921
5922
  return {
5922
5923
  method: "pnpm",
5923
- command: ["pnpm", "add", "-g", "@rehpic/vcli@latest"]
5924
+ command: ["pnpm", "add", "-g", pkg]
5924
5925
  };
5925
5926
  }
5926
5927
  if (execPath.includes("yarn")) {
5927
5928
  return {
5928
5929
  method: "yarn",
5929
- command: ["yarn", "global", "add", "@rehpic/vcli@latest"]
5930
+ command: ["yarn", "global", "add", pkg]
5930
5931
  };
5931
5932
  }
5932
5933
  return {
5933
5934
  method: "npm",
5934
- command: ["npm", "install", "-g", "@rehpic/vcli@latest"]
5935
+ command: ["npm", "install", "-g", pkg]
5935
5936
  };
5936
5937
  }
5937
5938
  async function checkForUpdate() {
5938
5939
  try {
5939
5940
  const { execSync: exec } = await import("child_process");
5940
- const latest = exec("npm view @rehpic/vcli version", {
5941
+ const tagsRaw = exec("npm view @rehpic/vcli dist-tags --json", {
5941
5942
  encoding: "utf-8",
5942
5943
  timeout: 1e4
5943
5944
  }).trim();
5945
+ const tags = JSON.parse(tagsRaw);
5946
+ const latest = tags.latest?.includes("beta") ? tags.beta ?? tags.latest : tags.latest ?? tags.beta ?? "";
5944
5947
  const pkg = await Promise.resolve().then(() => (init_package(), package_exports));
5945
5948
  const current = pkg.default?.version ?? pkg.version ?? "0.0.0";
5946
5949
  return {
5947
5950
  current,
5948
5951
  latest,
5949
- hasUpdate: latest !== current && !current.includes("beta")
5952
+ hasUpdate: Boolean(latest) && latest !== current
5950
5953
  };
5951
5954
  } catch {
5952
5955
  return null;
@@ -5966,7 +5969,7 @@ program.command("update").description("Update the CLI to the latest version").ac
5966
5969
  return;
5967
5970
  }
5968
5971
  s.stop(`Update available: ${updateInfo.current} \u2192 ${updateInfo.latest}`);
5969
- const install = detectInstallMethod();
5972
+ const install = detectInstallMethod(updateInfo.latest);
5970
5973
  log.info(`Install method: ${install.method}`);
5971
5974
  s.start("Stopping bridge service...");
5972
5975
  const wasRunning = getBridgeStatus().running;