@rightkit/release 0.2.110 → 0.2.111

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/development.mjs CHANGED
@@ -88,7 +88,11 @@ function install(descriptor, { root, platform, env, run, sinceMs = null }) {
88
88
  const { bundleRoot, installer: app } = resolveTauriBundleDirectory(descriptor, { root, platform, env, sinceMs });
89
89
  const built = path.resolve(bundleRoot, "..", "..", path.basename(descriptor.expectedInstalledPath));
90
90
  assertNonEmptyExecutable(built);
91
- const result = run(app, ["/S"], { cwd: root, env, stdio: "inherit", windowsHide: true, shell: false });
91
+ // Tauri's silent installer force-kills a running copy of the app (utils.nsh: IfSilent kill). When it
92
+ // was running, pass /R so the installer relaunches it as the user (RunAsUser, outside this process tree).
93
+ const running = isWindowsProcessRunning(path.basename(descriptor.expectedInstalledPath), { run });
94
+ if (running) console.log(`right-release dev: ${descriptor.productName} is running; the installer will close it and relaunch it`);
95
+ const result = run(app, windowsInstallerArguments({ running }), { cwd: root, env, stdio: "inherit", windowsHide: true, shell: false });
92
96
  if (result.status !== 0) throw new Error(`development installer failed (${result.status}): ${app}`);
93
97
  const installed = path.resolve(root, descriptor.expectedInstalledPath);
94
98
  assertInstalledExecutableMatches(built, installed);
@@ -142,6 +146,14 @@ export function resolveTauriBundleDirectory(descriptor, { root, platform, env =
142
146
  return { bundleRoot, installer: candidates[0] };
143
147
  }
144
148
 
149
+ export function windowsInstallerArguments({ running = false } = {}) { return running ? ["/S", "/R"] : ["/S"]; }
150
+
151
+ export function isWindowsProcessRunning(imageName, { run = spawnSync, systemRoot = process.env.SystemRoot ?? "C:\\Windows" } = {}) {
152
+ const result = run(path.join(systemRoot, "System32", "tasklist.exe"), ["/FI", `IMAGENAME eq ${imageName}`, "/FO", "CSV", "/NH"], { encoding: "utf8", windowsHide: true, shell: false });
153
+ if (result.status !== 0 || typeof result.stdout !== "string") return false;
154
+ return result.stdout.toLowerCase().includes(`"${imageName.toLowerCase()}"`);
155
+ }
156
+
145
157
  export function assertInstalledExecutableMatches(built, installed, read = readFileSync) {
146
158
  assertNonEmptyExecutable(built);
147
159
  assertNonEmptyExecutable(installed);
@@ -212,6 +224,13 @@ export function resolvePnpmCli({ root, env = process.env } = {}) {
212
224
  const parent = path.dirname(dir);
213
225
  if (parent === dir) break;
214
226
  }
227
+ // A global pnpm (no Corepack in Node >= 25) exposes its JS entry only through its PATH shim.
228
+ for (const dir of String(env.PATH ?? env.Path ?? "").split(path.delimiter).filter(Boolean)) {
229
+ const shim = path.join(dir, "pnpm.CMD");
230
+ if (!existsSync(shim)) continue;
231
+ const match = /"%~dp0\\([^"]*pnpm\.(?:mjs|cjs|js))"/i.exec(readFileSync(shim, "utf8"));
232
+ if (match) candidates.push(path.resolve(dir, match[1]));
233
+ }
215
234
  const selected = candidates.find((candidate) => existsSync(candidate));
216
235
  if (!selected) throw new Error("could not resolve pnpm JavaScript CLI entrypoint; install/pin pnpm through Corepack");
217
236
  return selected;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.110",
3
+ "version": "0.2.111",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "@rightkit/logs": "0.1.4",
23
23
  "@rightkit/platform-ui": "0.1.1",
24
24
  "@rightkit/qa": "0.2.1",
25
- "@rightkit/release": "0.2.110",
25
+ "@rightkit/release": "0.2.111",
26
26
  "@rightkit/tauri": "0.1.1",
27
27
  "@rightkit/updates": "0.2.4"
28
28
  },
@@ -120,7 +120,8 @@
120
120
  "0.2.106",
121
121
  "0.2.107",
122
122
  "0.2.108",
123
- "0.2.109"
123
+ "0.2.109",
124
+ "0.2.110"
124
125
  ],
125
126
  "@rightkit/qa": [
126
127
  "0.1.0",