@scp-dev/relay-server 0.0.0-stage → 0.1.0

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,3 +1,7 @@
1
- # Temporary Holding Version
1
+ # SCP relay server
2
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.
3
+ Run `npx @scp-dev/relay-server serve` or install with `npm install -g @scp-dev/relay-server`.
4
+ The wrapper selects a native binary through optional dependencies. Node 18 or later is required.
5
+ Set `SCP_RELAY_BINARY` to use a binary at a custom path.
6
+
7
+ See the [self-host guide](https://scp.dev/docs/self-host) for storage, dashboard and administration.
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require("node:child_process");
3
+
4
+ let binary = process.env.SCP_RELAY_BINARY;
5
+ if (!binary) {
6
+ let key = `${process.platform}-${process.arch}`;
7
+ if (process.platform === "linux") {
8
+ key += process.report.getReport().header.glibcVersionRuntime ? "-gnu" : "-musl";
9
+ }
10
+ const name = `@scp-dev/relay-server-${key}`;
11
+ try {
12
+ binary = require.resolve(`${name}/bin/scp-relay${process.platform === "win32" ? ".exe" : ""}`);
13
+ } catch {
14
+ console.error(`Missing relay binary package ${name}. Install with optional dependencies enabled on a supported platform, or set SCP_RELAY_BINARY.`);
15
+ process.exit(1);
16
+ }
17
+ }
18
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
19
+ for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => child.kill(signal));
20
+ child.on("error", (error) => {
21
+ console.error(`Cannot start SCP relay: ${error.message}`);
22
+ process.exitCode = 1;
23
+ });
24
+ child.on("exit", (code, signal) => {
25
+ if (signal) {
26
+ process.removeAllListeners(signal);
27
+ process.kill(process.pid, signal);
28
+ } else process.exitCode = code ?? 1;
29
+ });
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@scp-dev/relay-server",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Self-hosted SCP relay server",
5
+ "bin": {
6
+ "scp-relay": "bin/scp-relay.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "@scp-dev/relay-server-darwin-arm64": "0.1.0",
10
+ "@scp-dev/relay-server-darwin-x64": "0.1.0",
11
+ "@scp-dev/relay-server-linux-x64-gnu": "0.1.0",
12
+ "@scp-dev/relay-server-linux-arm64-gnu": "0.1.0",
13
+ "@scp-dev/relay-server-linux-x64-musl": "0.1.0",
14
+ "@scp-dev/relay-server-win32-x64": "0.1.0"
15
+ },
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "files": [
20
+ "bin",
21
+ "README.md"
22
+ ],
23
+ "license": "Apache-2.0",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/scphq/scp.git",
27
+ "directory": "crates/npm/relay-server"
28
+ },
29
+ "homepage": "https://scp.dev",
30
+ "publishConfig": {
31
+ "access": "public"
32
+ }
33
+ }