@serverkgg/bridge 0.0.3 → 0.0.4
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 +1 -1
- package/package.json +1 -1
- package/src/cli/compile.ts +19 -37
- package/src/cli/main.ts +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ bunx serverk-bridge validate
|
|
|
41
41
|
bunx serverk-bridge compile
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
`validate` checks `serverk.yml` against the real platform schema, verifies the logo and banner, and validates the driver's panel wiring. `compile` produces `dist/bridge
|
|
44
|
+
`validate` checks `serverk.yml` against the real platform schema, verifies the logo and banner, and validates the driver's panel wiring. `compile` produces `dist/bridge`, an amd64 binary — serverk publishes game images for `linux/amd64` only.
|
|
45
45
|
|
|
46
46
|
## Compatibility
|
|
47
47
|
|
package/package.json
CHANGED
package/src/cli/compile.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
amd64: "bun-linux-x64",
|
|
5
|
-
arm64: "bun-linux-arm64",
|
|
6
|
-
};
|
|
3
|
+
const TARGET = "bun-linux-x64";
|
|
7
4
|
|
|
8
5
|
const HELP = `serverk-bridge compile [options]
|
|
9
6
|
|
|
10
7
|
options:
|
|
11
|
-
--arch <amd64|arm64> architecture to compile (repeatable, default: both)
|
|
12
8
|
--entry <path> entrypoint (default: src/main.ts)
|
|
13
9
|
--outdir <path> output directory (default: dist)
|
|
14
10
|
--help show this help`;
|
|
@@ -17,10 +13,6 @@ export const runCompile = async (args: string[]) => {
|
|
|
17
13
|
const { values } = parseArgs({
|
|
18
14
|
args,
|
|
19
15
|
options: {
|
|
20
|
-
arch: {
|
|
21
|
-
type: "string",
|
|
22
|
-
multiple: true,
|
|
23
|
-
},
|
|
24
16
|
entry: {
|
|
25
17
|
type: "string",
|
|
26
18
|
default: "src/main.ts",
|
|
@@ -42,34 +34,24 @@ export const runCompile = async (args: string[]) => {
|
|
|
42
34
|
return;
|
|
43
35
|
}
|
|
44
36
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
values.entry,
|
|
62
|
-
"--outfile",
|
|
63
|
-
outfile,
|
|
64
|
-
],
|
|
65
|
-
{
|
|
66
|
-
stderr: "inherit",
|
|
67
|
-
stdout: "inherit",
|
|
68
|
-
},
|
|
69
|
-
);
|
|
37
|
+
const outfile = `${values.outdir}/bridge`;
|
|
38
|
+
const child = Bun.spawn(
|
|
39
|
+
[
|
|
40
|
+
"bun",
|
|
41
|
+
"build",
|
|
42
|
+
"--compile",
|
|
43
|
+
`--target=${TARGET}`,
|
|
44
|
+
values.entry,
|
|
45
|
+
"--outfile",
|
|
46
|
+
outfile,
|
|
47
|
+
],
|
|
48
|
+
{
|
|
49
|
+
stderr: "inherit",
|
|
50
|
+
stdout: "inherit",
|
|
51
|
+
},
|
|
52
|
+
);
|
|
70
53
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
54
|
+
if ((await child.exited) !== 0) {
|
|
55
|
+
throw new Error("compile failed");
|
|
74
56
|
}
|
|
75
57
|
};
|
package/src/cli/main.ts
CHANGED
|
@@ -11,7 +11,7 @@ const USAGE = `serverk-bridge <command>
|
|
|
11
11
|
commands:
|
|
12
12
|
validate validate serverk.yml, assets, and driver wiring
|
|
13
13
|
schema write the serverk.yml JSON Schema for editor tooling
|
|
14
|
-
compile compile the bridge binary for amd64
|
|
14
|
+
compile compile the bridge binary for amd64
|
|
15
15
|
link use a local bridge checkout while developing
|
|
16
16
|
|
|
17
17
|
run "serverk-bridge <command> --help" for options`;
|