supacode 0.0.0-bootstrap.0 → 0.0.46-nightly.20261003.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 CHANGED
@@ -1,5 +1,3 @@
1
- # supacode
1
+ # Server
2
2
 
3
- Initial package registration for Supacode release automation. This bootstrap version contains no application executable.
4
-
5
- Project: https://github.com/supabitapp/supacode-next
3
+ Node.js WebSocket server for the Supacode app.
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ const { spawnSync } = require("node:child_process");
4
+ const { constants } = require("node:os");
5
+ const { dirname, join } = require("node:path");
6
+
7
+ const SUPPORTED = ["darwin-arm64", "linux-arm64", "linux-x64", "win32-arm64", "win32-x64"];
8
+ const key = process.platform + "-" + process.arch;
9
+
10
+ let packageDir;
11
+ try {
12
+ packageDir = dirname(require.resolve("@supabitapp/supacode-" + key + "/package.json"));
13
+ } catch {
14
+ process.stderr.write(
15
+ [
16
+ "supacode: no Supacode CLI build is available for this platform (" + key + ").",
17
+ "Supported platforms: " + SUPPORTED.join(", ") + ".",
18
+ "If yours is listed, reinstall supacode so npm fetches its optional dependency.",
19
+ "The desktop app and release archives are at https://github.com/supabitapp/supacode-next/releases",
20
+ "",
21
+ ].join("\n"),
22
+ );
23
+ process.exit(1);
24
+ }
25
+
26
+ const executable = join(packageDir, process.platform === "win32" ? "supacode.exe" : "supacode");
27
+ const result = spawnSync(executable, process.argv.slice(2), { stdio: "inherit" });
28
+ if (result.error) {
29
+ process.stderr.write("supacode: failed to start " + executable + ": " + result.error.message + "\n");
30
+ process.exit(1);
31
+ }
32
+ // A child killed by a signal has no status; report it the way a shell would.
33
+ process.exit(result.status ?? 128 + (constants.signals[result.signal] || 1));
package/dist/bin.mjs ADDED
@@ -0,0 +1,27 @@
1
+ import { spawn } from "node:child_process";
2
+ import { constants } from "node:os";
3
+ import { dirname, join } from "node:path";
4
+ import { createRequire } from "node:module";
5
+ const require = createRequire(import.meta.url);
6
+ const executableName = process.platform === "win32" ? "supacode.exe" : "supacode";
7
+ const executable = join(dirname(require.resolve("@supabitapp/supacode-" + process.platform + "-" + process.arch + "/package.json")), executableName);
8
+ const ipc = process.send !== undefined;
9
+ const child = spawn(executable, process.argv.slice(2), {
10
+ stdio: ipc ? ["inherit", "inherit", "inherit", "ipc"] : "inherit",
11
+ });
12
+ const fail = (error) => {
13
+ if (!error) return;
14
+ process.stderr.write("supacode: " + error.message + "\n");
15
+ child.kill("SIGTERM");
16
+ process.exitCode = 1;
17
+ };
18
+ if (ipc) {
19
+ process.on("message", (message) => { if (child.connected) child.send(message, fail); });
20
+ child.on("message", (message) => { if (process.connected) process.send(message, fail); });
21
+ process.on("disconnect", () => { if (child.connected) child.disconnect(); });
22
+ }
23
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
24
+ process.on(signal, () => child.kill(signal));
25
+ }
26
+ child.on("error", (error) => { fail(error); process.exit(1); });
27
+ child.on("exit", (code, signal) => process.exit(code ?? 128 + (constants.signals[signal] || 1)));
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "supacode",
3
- "version": "0.0.0-bootstrap.0",
4
- "description": "Supacode initial package registration for release automation; not an installable release.",
3
+ "version": "0.0.46-nightly.20261003.8",
4
+ "description": "Supacode CLI. Installs the self-contained executable for this platform.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/supabitapp/supacode-next.git"
8
+ "url": "https://github.com/supabitapp/supacode-next",
9
+ "directory": "apps/server"
10
+ },
11
+ "bin": {
12
+ "supacode": "./bin/supacode.js"
9
13
  },
10
14
  "files": [
11
- "README.md"
15
+ "bin",
16
+ "dist"
12
17
  ],
13
- "publishConfig": {
14
- "access": "public",
15
- "tag": "bootstrap"
18
+ "optionalDependencies": {
19
+ "@supabitapp/supacode-darwin-arm64": "0.0.46-nightly.20261003.8",
20
+ "@supabitapp/supacode-linux-arm64": "0.0.46-nightly.20261003.8",
21
+ "@supabitapp/supacode-linux-x64": "0.0.46-nightly.20261003.8",
22
+ "@supabitapp/supacode-win32-arm64": "0.0.46-nightly.20261003.8",
23
+ "@supabitapp/supacode-win32-x64": "0.0.46-nightly.20261003.8"
16
24
  }
17
25
  }