@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.
Files changed (3) hide show
  1. package/LICENSE +1 -0
  2. package/bin/zeta-editor.js +20 -11
  3. package/package.json +24 -24
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2026 Eugene Yakhnenko
4
+ Copyright (c) 2026 Linxira-OS (Zeta)
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
@@ -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 candidates = [
12
- path.join(__dirname, "..", "..", `editor-${PKG_PLATFORM}-${process.arch}`, "bin", EXE),
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
- for (const c of candidates) {
16
- if (existsSync(c)) { found = c; break; }
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
- console.error(`@linxiraos/editor: no binary for ${process.platform}-${process.arch}. Install the matching @linxiraos/editor-* package.`);
20
- process.exit(1);
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 { spawnSync } = require("node:child_process");
23
- const r = spawnSync(found, process.argv.slice(2), { stdio: "inherit" });
24
- if (r.error) throw r.error;
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
- "name": "@linxiraos/editor",
3
- "version": "1.1.16",
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.16",
16
- "@linxiraos/editor-linux-x64": "1.1.16"
17
- },
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
- "files": [
22
- "bin",
23
- "LICENSE",
24
- "VENDOR.md"
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
  }