@linxiraos/editor 1.1.15 → 1.1.17

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 CHANGED
@@ -1,21 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Eugene Yakhnenko
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eugene Yakhnenko
4
+ Copyright (c) 2026 Linxira-OS (Zeta)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @linxiraos/editor
2
+
3
+ Zeta's bundled terminal editor (vendored [TTT Editor](https://github.com/eugenioenko/ttt) v1.5.0, MIT).
4
+
5
+ This package installs the editor binary for your platform via `optionalDependencies` and provides a `zeta-editor` launcher that execs it.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install -g @linxiraos/editor
11
+ zeta-editor # launches the editor
12
+ ```
13
+
14
+ Or as a dependency:
15
+
16
+ ```sh
17
+ npm install @linxiraos/editor
18
+ npx zeta-editor --version
19
+ ```
20
+
21
+ ## Platform support
22
+
23
+ | Package | OS | Arch | Status |
24
+ |---|---|---|---|
25
+ | `@linxiraos/editor-windows-x64` | Windows | x64 | supported |
26
+ | `@linxiraos/editor-linux-x64` | Linux | x64 | supported |
27
+
28
+ Only **x64 (amd64)** builds of Linux and Windows are provided. macOS and ARM (arm64/armv7) builds are **not** available yet. On unsupported platforms the launcher exits with a clear error; the rest of Zeta is unaffected.
29
+
30
+ ## License
31
+
32
+ The vendored editor is MIT-licensed (see [upstream](https://github.com/eugenioenko/ttt)). Zeta packaging is part of [linxira-zeta](https://github.com/Linxira-OS/linxira-zeta) (MIT).
@@ -5,19 +5,30 @@
5
5
  const { existsSync } = require("node:fs");
6
6
  const path = require("node:path");
7
7
 
8
+ // npm package names use "windows"; Node's process.platform is "win32".
9
+ const PKG_PLATFORM = process.platform === "win32" ? "windows" : process.platform;
8
10
  const EXE = process.platform === "win32" ? "ttt.exe" : "ttt-linux-x64";
9
- const candidates = [
10
- path.join(__dirname, "..", `@linxiraos/editor-${process.platform}-${process.arch}`, "bin", EXE),
11
- ];
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.
12
16
  let found;
13
- for (const c of candidates) {
14
- 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;
15
27
  }
16
28
  if (!found) {
17
- console.error(`@linxiraos/editor: no binary for ${process.platform}-${process.arch}. Install the matching @linxiraos/editor-* package.`);
18
- 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);
19
31
  }
20
- const { spawnSync } = require("node:child_process");
21
- const r = spawnSync(found, process.argv.slice(2), { stdio: "inherit" });
22
- if (r.error) throw r.error;
23
- 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.15",
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.15",
16
- "@linxiraos/editor-linux-x64": "1.1.15"
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.17",
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
+ ]
26
26
  }