@linxiraos/editor 1.1.16 → 1.1.18
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/LICENSE +1 -0
- package/bin/zeta-editor.js +20 -11
- package/package.json +24 -24
package/LICENSE
CHANGED
package/bin/zeta-editor.js
CHANGED
|
@@ -8,18 +8,27 @@ const path = require("node:path");
|
|
|
8
8
|
// npm package names use "windows"; Node's process.platform is "win32".
|
|
9
9
|
const PKG_PLATFORM = process.platform === "win32" ? "windows" : process.platform;
|
|
10
10
|
const EXE = process.platform === "win32" ? "ttt.exe" : "ttt-linux-x64";
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const PKG = `@linxiraos/editor-${PKG_PLATFORM}-${process.arch}`;
|
|
12
|
+
|
|
13
|
+
// Resolve through Node's own algorithm: optionalDependencies may land flat in
|
|
14
|
+
// node_modules/@linxiraos/ or nested under our package's node_modules
|
|
15
|
+
// depending on the surrounding dependency tree.
|
|
14
16
|
let found;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
try {
|
|
18
|
+
const pkgDir = path.dirname(require.resolve(`${PKG}/package.json`, { paths: [__dirname, ...module.paths] }));
|
|
19
|
+
const candidate = path.join(pkgDir, "bin", EXE);
|
|
20
|
+
if (existsSync(candidate)) found = candidate;
|
|
21
|
+
} catch {
|
|
22
|
+
// fall through to the legacy flat-layout probe below
|
|
23
|
+
}
|
|
24
|
+
if (!found) {
|
|
25
|
+
const flat = path.join(__dirname, "..", "..", PKG, "bin", EXE);
|
|
26
|
+
if (existsSync(flat)) found = flat;
|
|
17
27
|
}
|
|
18
28
|
if (!found) {
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
console.error(`@linxiraos/editor: no binary for ${process.platform}-${process.arch}. Install the matching @linxiraos/editor-* package.`);
|
|
30
|
+
process.exit(1);
|
|
21
31
|
}
|
|
22
|
-
const {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
process.exit(r.status ?? 0);
|
|
32
|
+
const { spawn } = require("node:child_process");
|
|
33
|
+
const child = spawn(found, process.argv.slice(2), { stdio: "inherit" });
|
|
34
|
+
child.on("exit", code => process.exit(code ?? 0));
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
"name": "@linxiraos/editor",
|
|
3
|
+
"version": "1.1.18",
|
|
4
|
+
"description": "Zeta terminal IDE (vendored TTT Editor v1.5.0) — single-binary terminal text editor",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Linxira-OS/linxira-zeta.git",
|
|
9
|
+
"directory": "editor"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"zeta-editor": "./bin/zeta-editor.js"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@linxiraos/editor-windows-x64": "1.1.18",
|
|
16
|
+
"@linxiraos/editor-linux-x64": "1.1.18"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"bin",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"VENDOR.md"
|
|
25
|
+
]
|
|
26
26
|
}
|