@nissyai/desktop 0.1.1 → 0.1.3
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/bin/nissy.mjs +19 -0
- package/package.json +4 -4
- package/src/resolve.mjs +10 -0
package/bin/nissy.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import { fileURLToPath } from "node:url";
|
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
cacheRootSegments,
|
|
26
|
+
LAUNCHER_TOOLCHAIN_FILE,
|
|
26
27
|
needsMacReinstall,
|
|
27
28
|
npxChannelEnv,
|
|
28
29
|
resolveLaunchCommand,
|
|
@@ -182,6 +183,24 @@ const childEnv = {
|
|
|
182
183
|
...npxChannelEnv(process.execPath, fileURLToPath(import.meta.url)),
|
|
183
184
|
};
|
|
184
185
|
|
|
186
|
+
// Record the toolchain to a FILE as well as the env, because macOS `open`
|
|
187
|
+
// (LaunchServices) does not pass our env to the app, and a Dock launch never
|
|
188
|
+
// runs this launcher at all. The app's npx self-update reads this to run `npm`
|
|
189
|
+
// and to relaunch via the stable launcher command. Best-effort: never block a
|
|
190
|
+
// launch on it.
|
|
191
|
+
try {
|
|
192
|
+
const toolchainRoot = join(
|
|
193
|
+
...cacheRootSegments({ platform: process.platform, home: homedir(), env: process.env }),
|
|
194
|
+
);
|
|
195
|
+
mkdirSync(toolchainRoot, { recursive: true });
|
|
196
|
+
writeFileSync(
|
|
197
|
+
join(toolchainRoot, LAUNCHER_TOOLCHAIN_FILE),
|
|
198
|
+
JSON.stringify({ node: process.execPath, script: fileURLToPath(import.meta.url) }),
|
|
199
|
+
);
|
|
200
|
+
} catch {
|
|
201
|
+
// Ignore: self-update falls back to the env/persisted value or the manual command.
|
|
202
|
+
}
|
|
203
|
+
|
|
185
204
|
if (foreground) {
|
|
186
205
|
const child = spawn(command, args, { stdio: "inherit", env: childEnv });
|
|
187
206
|
child.on("error", (err) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nissyai/desktop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Launcher for the Nissy desktop app. Resolves the host's app payload and spawns it. Run via `npx @nissyai/desktop`; a global install (`npm i -g @nissyai/desktop`) exposes the `nissy` command.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"src/"
|
|
21
21
|
],
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@nissyai/app-win32-x64": "0.1.
|
|
24
|
-
"@nissyai/app-darwin-arm64": "0.1.
|
|
25
|
-
"@nissyai/app-darwin-x64": "0.1.
|
|
23
|
+
"@nissyai/app-win32-x64": "0.1.3",
|
|
24
|
+
"@nissyai/app-darwin-arm64": "0.1.3",
|
|
25
|
+
"@nissyai/app-darwin-x64": "0.1.3"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/resolve.mjs
CHANGED
|
@@ -72,6 +72,16 @@ export function cacheRootSegments({ platform, home, env }) {
|
|
|
72
72
|
return env.XDG_CACHE_HOME ? [env.XDG_CACHE_HOME, "nissy"] : [home, ".cache", "nissy"];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Filename (under the cache root) where the launcher records the Node toolchain
|
|
77
|
+
* it ran under, so the app's npx self-update can find `npm` and the stable
|
|
78
|
+
* relaunch command WITHOUT relying on inherited env — which macOS `open`
|
|
79
|
+
* (LaunchServices) strips, and which a Dock launch never sets. The app mirrors
|
|
80
|
+
* this path in `apps/desktop/src/main/services/npx-self-update.ts`; keep the
|
|
81
|
+
* two in sync.
|
|
82
|
+
*/
|
|
83
|
+
export const LAUNCHER_TOOLCHAIN_FILE = "launcher-toolchain.json";
|
|
84
|
+
|
|
75
85
|
/**
|
|
76
86
|
* Filesystem-safe, version-pinned cache key for a payload package, e.g.
|
|
77
87
|
* ("@nissyai/app-darwin-x64", "1.2.3") → "nissyai-app-darwin-x64@1.2.3". Version
|