@e6code/e6 0.0.0-stage → 0.0.43-nightly.20261017.102

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/e6.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ const { spawnSync } = require("node:child_process");
4
+ const { existsSync } = require("node:fs");
5
+ const { constants } = require("node:os");
6
+ const { dirname, join } = require("node:path");
7
+
8
+ const SUPPORTED = ["darwin-arm64", "linux-arm64", "linux-x64", "win32-arm64", "win32-x64"];
9
+ const key = process.platform + "-" + process.arch;
10
+
11
+ let packageDir;
12
+ try {
13
+ packageDir = dirname(require.resolve("@e6code/e6-" + key + "/package.json"));
14
+ } catch {
15
+ process.stderr.write(
16
+ [
17
+ "e6: no E6 Code CLI build is available for this platform (" + key + ").",
18
+ "Supported platforms: " + SUPPORTED.join(", ") + ".",
19
+ "If yours is listed, reinstall @e6code/e6 so npm fetches its optional dependency.",
20
+ "The desktop app and release archives are at https://github.com/Emikael/e6code/releases",
21
+ "",
22
+ ].join("\n"),
23
+ );
24
+ process.exit(1);
25
+ }
26
+
27
+ const executableNames = process.platform === "win32" ? ["e6.exe"] : ["e6"];
28
+ const executable = executableNames
29
+ .map((name) => join(packageDir, name))
30
+ .find((candidate) => existsSync(candidate));
31
+ if (!executable) {
32
+ process.stderr.write("e6: the platform package has no e6 or e6 executable.\n");
33
+ process.exit(1);
34
+ }
35
+ const result = spawnSync(executable, process.argv.slice(2), { stdio: "inherit" });
36
+ if (result.error) {
37
+ process.stderr.write("e6: failed to start " + executable + ": " + result.error.message + "\n");
38
+ process.exit(1);
39
+ }
40
+ // A child killed by a signal has no status; report it the way a shell would.
41
+ process.exit(result.status ?? 128 + (constants.signals[result.signal] || 1));
package/dist/bin.mjs ADDED
@@ -0,0 +1,49 @@
1
+ import { spawn } from "node:child_process";
2
+ import { existsSync } from "node:fs";
3
+ import { constants } from "node:os";
4
+ import { dirname, join } from "node:path";
5
+ import { createRequire } from "node:module";
6
+ const require = createRequire(import.meta.url);
7
+ const executableNames = process.platform === "win32" ? ["e6.exe"] : ["e6"];
8
+ const packageNames = ["e6"];
9
+ let executable;
10
+ for (const packageName of packageNames) {
11
+ let packageDir;
12
+ try {
13
+ packageDir = dirname(require.resolve("@e6code" + "/" + packageName + "-" + process.platform + "-" + process.arch + "/package.json"));
14
+ } catch {
15
+ continue;
16
+ }
17
+ for (const executableName of executableNames) {
18
+ const candidate = join(packageDir, executableName);
19
+ if (existsSync(candidate)) {
20
+ executable = candidate;
21
+ break;
22
+ }
23
+ }
24
+ if (executable) break;
25
+ }
26
+ if (!executable) {
27
+ process.stderr.write("e6: no E6 Code CLI build is available for this platform.\n");
28
+ process.exit(1);
29
+ }
30
+ const ipc = process.send !== undefined;
31
+ const child = spawn(executable, process.argv.slice(2), {
32
+ stdio: ipc ? ["inherit", "inherit", "inherit", "ipc"] : "inherit",
33
+ });
34
+ const fail = (error) => {
35
+ if (!error) return;
36
+ process.stderr.write("e6: " + error.message + "\n");
37
+ child.kill("SIGTERM");
38
+ process.exitCode = 1;
39
+ };
40
+ if (ipc) {
41
+ process.on("message", (message) => { if (child.connected) child.send(message, fail); });
42
+ child.on("message", (message) => { if (process.connected) process.send(message, fail); });
43
+ process.on("disconnect", () => { if (child.connected) child.disconnect(); });
44
+ }
45
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
46
+ process.on(signal, () => child.kill(signal));
47
+ }
48
+ child.on("error", (error) => { fail(error); process.exit(1); });
49
+ child.on("exit", (code, signal) => process.exit(code ?? 128 + (constants.signals[signal] || 1)));
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@e6code/e6",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.43-nightly.20261017.102",
4
+ "description": "E6 Code CLI. Installs the self-contained executable for this platform.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Emikael/e6code",
9
+ "directory": "apps/server"
10
+ },
11
+ "bin": {
12
+ "e6": "./bin/e6.js"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "dist"
17
+ ],
18
+ "optionalDependencies": {
19
+ "@e6code/e6-darwin-arm64": "0.0.43-nightly.20261017.102",
20
+ "@e6code/e6-linux-arm64": "0.0.43-nightly.20261017.102",
21
+ "@e6code/e6-linux-x64": "0.0.43-nightly.20261017.102",
22
+ "@e6code/e6-win32-arm64": "0.0.43-nightly.20261017.102",
23
+ "@e6code/e6-win32-x64": "0.0.43-nightly.20261017.102"
24
+ }
25
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.