@telpin-sistemas/orqen-desktop 0.1.6 → 0.1.8
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/README.md +1 -1
- package/bin/orqen-desktop.js +32 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -13,4 +13,4 @@ That is all: npm installs the app for your system (Windows x64, macOS Apple Sili
|
|
|
13
13
|
|
|
14
14
|
- `orqen-desktop --wait` keeps the terminal attached (to see the app's log).
|
|
15
15
|
- Linux needs the usual desktop libraries: `libxkbcommon-x11-0 libvulkan1 libwayland-client0 libfontconfig1`.
|
|
16
|
-
- Update
|
|
16
|
+
- Click **Update ORQEN** in the bottom bar, then reopen the app when the update is installed. From a terminal, run `orqen update --desktop` with the standalone CLI.
|
package/bin/orqen-desktop.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// The app itself is a native binary that npm brings in the package of this platform (@telpin-sistemas/orqen-desktop-<os>-<cpu>);
|
|
4
4
|
// the orqen CLI comes as a dependency, so nothing else has to be downloaded or put in the PATH by hand.
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
|
-
import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
|
-
import { homedir } from "node:os";
|
|
8
|
+
import { homedir, tmpdir } from "node:os";
|
|
9
9
|
import { delimiter, dirname, join } from "node:path";
|
|
10
10
|
|
|
11
11
|
const require = createRequire(import.meta.url);
|
|
@@ -33,10 +33,15 @@ if (process.platform !== "win32") { try { chmodSync(bin, 0o755); } catch { /* re
|
|
|
33
33
|
// 2. the orqen CLI that came with it: the app runs it, and so do the agents inside the app (`orqen` in their PATH)
|
|
34
34
|
const env = { ...process.env };
|
|
35
35
|
const extra = [];
|
|
36
|
+
const manifest = require.resolve("../package.json");
|
|
37
|
+
delete env.ORQEN_DESKTOP_NPM_MANIFEST;
|
|
36
38
|
let cli;
|
|
37
39
|
try { cli = join(dirname(require.resolve("@telpin-sistemas/orqen/package.json")), "dist", "index.js"); } catch { cli = undefined; }
|
|
38
40
|
if (cli && existsSync(cli)) {
|
|
39
|
-
if (!args.includes("--cli"))
|
|
41
|
+
if (!args.includes("--cli")) {
|
|
42
|
+
extra.push("--node", process.execPath, "--cli", cli);
|
|
43
|
+
env.ORQEN_DESKTOP_NPM_MANIFEST = manifest;
|
|
44
|
+
}
|
|
40
45
|
try {
|
|
41
46
|
const shim = join(homedir(), ".orqen", "npm-bin");
|
|
42
47
|
mkdirSync(shim, { recursive: true });
|
|
@@ -48,6 +53,30 @@ if (cli && existsSync(cli)) {
|
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
const finalArgs = [...extra, ...args.filter((a) => a !== "--wait")];
|
|
56
|
+
// Windows locks a running executable. Keep the npm copy free for an in-app update.
|
|
57
|
+
if (process.platform === "win32") {
|
|
58
|
+
try {
|
|
59
|
+
const cache = join(env.LOCALAPPDATA || tmpdir(), "orqen", "npm-desktop", require(manifest).version);
|
|
60
|
+
const cachedBin = join(cache, "orqen-desktop.exe");
|
|
61
|
+
if (!existsSync(cachedBin)) {
|
|
62
|
+
mkdirSync(cache, { recursive: true });
|
|
63
|
+
const staging = mkdtempSync(join(cache, "copy-"));
|
|
64
|
+
const stagedBin = join(staging, "orqen-desktop.exe");
|
|
65
|
+
try {
|
|
66
|
+
copyFileSync(bin, stagedBin);
|
|
67
|
+
try { renameSync(stagedBin, cachedBin); }
|
|
68
|
+
catch (e) { if (!existsSync(cachedBin)) throw e; }
|
|
69
|
+
} finally {
|
|
70
|
+
if (existsSync(stagedBin)) unlinkSync(stagedBin);
|
|
71
|
+
rmdirSync(staging);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
bin = cachedBin;
|
|
75
|
+
} catch (e) {
|
|
76
|
+
fail(`could not prepare the Windows executable: ${e.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
51
80
|
if (process.env.ORQEN_DESKTOP_DRY) {
|
|
52
81
|
console.log(JSON.stringify({ bin, args: finalArgs, path: (env.PATH ?? "").split(delimiter)[0] }));
|
|
53
82
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telpin-sistemas/orqen-desktop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/sistemas-telpin/orqen-gui",
|
|
6
6
|
"repository": {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"node": ">=20.12"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@telpin-sistemas/orqen": ">=0.1.
|
|
23
|
+
"@telpin-sistemas/orqen": ">=0.1.5"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@telpin-sistemas/orqen-desktop-win32-x64": "0.1.
|
|
27
|
-
"@telpin-sistemas/orqen-desktop-darwin-arm64": "0.1.
|
|
28
|
-
"@telpin-sistemas/orqen-desktop-darwin-x64": "0.1.
|
|
29
|
-
"@telpin-sistemas/orqen-desktop-linux-x64": "0.1.
|
|
26
|
+
"@telpin-sistemas/orqen-desktop-win32-x64": "0.1.8",
|
|
27
|
+
"@telpin-sistemas/orqen-desktop-darwin-arm64": "0.1.8",
|
|
28
|
+
"@telpin-sistemas/orqen-desktop-darwin-x64": "0.1.8",
|
|
29
|
+
"@telpin-sistemas/orqen-desktop-linux-x64": "0.1.8"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"orqen",
|