@adhdev/daemon-core 0.9.82-rc.313 → 0.9.82-rc.314
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/commands/upgrade-helper.d.ts +12 -0
- package/dist/index.js +43 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/commands/upgrade-helper.ts +52 -30
package/dist/index.mjs
CHANGED
|
@@ -311,10 +311,10 @@ function readInjected(value) {
|
|
|
311
311
|
}
|
|
312
312
|
function getDaemonBuildInfo() {
|
|
313
313
|
if (cached) return cached;
|
|
314
|
-
const commit = readInjected(true ? "
|
|
315
|
-
const commitShort = readInjected(true ? "
|
|
316
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
317
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
314
|
+
const commit = readInjected(true ? "f236ed7432cf04dbcfd2e530fa6c69e77e809c80" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "f236ed74" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.314" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-18T04:15:40.033Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -41820,39 +41820,48 @@ function removeDaemonPidFile() {
|
|
|
41820
41820
|
} catch {
|
|
41821
41821
|
}
|
|
41822
41822
|
}
|
|
41823
|
+
function safeRemoveStaleEntry(target, label) {
|
|
41824
|
+
try {
|
|
41825
|
+
fs24.rmSync(target, { recursive: true, force: true });
|
|
41826
|
+
appendUpgradeLog(`${label}: ${target}`);
|
|
41827
|
+
} catch (error) {
|
|
41828
|
+
appendUpgradeLog(`Skipped locked stale entry (${error?.code || "error"}): ${target} \u2014 ${error?.message || String(error)}`);
|
|
41829
|
+
}
|
|
41830
|
+
}
|
|
41823
41831
|
function cleanupStaleGlobalInstallDirs(pkgName, surface) {
|
|
41824
|
-
|
|
41825
|
-
|
|
41826
|
-
|
|
41827
|
-
|
|
41828
|
-
|
|
41829
|
-
|
|
41830
|
-
|
|
41831
|
-
|
|
41832
|
-
|
|
41833
|
-
|
|
41834
|
-
|
|
41835
|
-
|
|
41836
|
-
|
|
41837
|
-
|
|
41838
|
-
|
|
41839
|
-
|
|
41840
|
-
|
|
41841
|
-
|
|
41842
|
-
|
|
41843
|
-
|
|
41844
|
-
|
|
41845
|
-
|
|
41846
|
-
|
|
41847
|
-
|
|
41832
|
+
try {
|
|
41833
|
+
const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
|
|
41834
|
+
const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
|
|
41835
|
+
if (!npmRoot) return;
|
|
41836
|
+
const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
|
|
41837
|
+
const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
|
|
41838
|
+
const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
|
|
41839
|
+
const binNames = /* @__PURE__ */ new Set([packageBaseName]);
|
|
41840
|
+
if (pkgName === "@adhdev/daemon-standalone") {
|
|
41841
|
+
binNames.add("adhdev-standalone");
|
|
41842
|
+
}
|
|
41843
|
+
if (pkgName.startsWith("@")) {
|
|
41844
|
+
const [scope, name] = pkgName.split("/");
|
|
41845
|
+
const scopeDir = path35.join(npmRoot, scope);
|
|
41846
|
+
if (!fs24.existsSync(scopeDir)) return;
|
|
41847
|
+
for (const entry of fs24.readdirSync(scopeDir)) {
|
|
41848
|
+
if (!entry.startsWith(`.${name}-`)) continue;
|
|
41849
|
+
safeRemoveStaleEntry(path35.join(scopeDir, entry), "Removed stale scoped staging dir");
|
|
41850
|
+
}
|
|
41851
|
+
} else {
|
|
41852
|
+
for (const entry of fs24.readdirSync(npmRoot)) {
|
|
41853
|
+
if (!entry.startsWith(`.${pkgName}-`)) continue;
|
|
41854
|
+
safeRemoveStaleEntry(path35.join(npmRoot, entry), "Removed stale staging dir");
|
|
41855
|
+
}
|
|
41848
41856
|
}
|
|
41849
|
-
|
|
41850
|
-
|
|
41851
|
-
|
|
41852
|
-
|
|
41853
|
-
|
|
41854
|
-
appendUpgradeLog(`Removed stale bin staging entry: ${path35.join(binDir, entry)}`);
|
|
41857
|
+
if (fs24.existsSync(binDir)) {
|
|
41858
|
+
for (const entry of fs24.readdirSync(binDir)) {
|
|
41859
|
+
if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
|
|
41860
|
+
safeRemoveStaleEntry(path35.join(binDir, entry), "Removed stale bin staging entry");
|
|
41861
|
+
}
|
|
41855
41862
|
}
|
|
41863
|
+
} catch (error) {
|
|
41864
|
+
appendUpgradeLog(`Stale staging cleanup skipped (${error?.code || "error"}): ${error?.message || String(error)}`);
|
|
41856
41865
|
}
|
|
41857
41866
|
}
|
|
41858
41867
|
function spawnDetachedDaemonUpgradeHelper(payload) {
|