@serverkgg/bridge 0.1.2 → 0.1.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/package.json +3 -2
- package/rules/package.md +65 -0
- package/src/blog/articleFrontmatter.test.ts +10 -10
- package/src/blog/compile.test.ts +9 -9
- package/src/bot/botDeploy.test.ts +16 -16
- package/src/bot/botEnvironment.test.ts +8 -8
- package/src/bot/botIdentity.test.ts +12 -12
- package/src/bot/botPanel.test.ts +13 -13
- package/src/bot/botPanel.ts +4 -4
- package/src/bot/botState.test.ts +3 -3
- package/src/bot/botTerminal.test.ts +5 -5
- package/src/bot/botVariables.test.ts +8 -8
- package/src/bot/detect/botToken.test.ts +6 -6
- package/src/bot/detect/detect.test.ts +21 -21
- package/src/bot/detect/detectTable.test.ts +5 -5
- package/src/bot/detect/envExample.test.ts +2 -2
- package/src/bot/detect/envScan.test.ts +4 -4
- package/src/bot/detect/inferBotPlatform.test.ts +4 -4
- package/src/bot/detect/keys.test.ts +3 -3
- package/src/bot/detect/sensitiveKey.test.ts +5 -5
- package/src/bot/detect/serverkJson.test.ts +5 -5
- package/src/catalogs/curseforge.test.ts +35 -35
- package/src/catalogs/thunderstore.test.ts +9 -9
- package/src/cli/detectTable.test.ts +3 -3
- package/src/cli/link.test.ts +11 -11
- package/src/cli/main.ts +8 -0
- package/src/cli/rules.test.ts +198 -0
- package/src/cli/rules.ts +188 -0
- package/src/cli/validate.test.ts +179 -31
- package/src/cli/validate.ts +44 -0
- package/src/codecs/ini.test.ts +13 -13
- package/src/codecs/javaProperties.test.ts +11 -11
- package/src/codecs/sourceCfg.test.ts +14 -14
- package/src/codecs/xmlProperties.test.ts +10 -10
- package/src/core/bridgePort.test.ts +6 -6
- package/src/core/bridgeUserError.test.ts +4 -4
- package/src/core/bridgeValue.test.ts +5 -5
- package/src/core/describeDownloadFailure.test.ts +12 -12
- package/src/core/describeDownloadFailure.ts +10 -10
- package/src/guides/markdown.test.ts +31 -31
- package/src/install/installStamp.test.ts +9 -9
- package/src/manifest/extension.ts +36 -0
- package/src/manifest/index.ts +1 -0
- package/src/manifest/manifest.test.ts +208 -90
- package/src/manifest/manifest.ts +34 -0
- package/src/net/loopback.test.ts +10 -10
- package/src/presence/rosterSync.test.ts +7 -7
- package/src/probes/a2s.test.ts +5 -5
- package/src/probes/minecraftPing.test.ts +17 -17
- package/src/probes/raknetPing.test.ts +13 -13
- package/src/protocol/bridgePreview.ts +1 -0
- package/src/rcon/rconAccess.test.ts +20 -20
- package/src/rcon/rconAccess.ts +14 -14
- package/src/rcon/rconClient.test.ts +49 -49
- package/src/rcon/rconFrame.test.ts +14 -14
- package/src/rcon/rconIds.test.ts +4 -4
- package/src/rcon/rconWriter.test.ts +6 -6
- package/src/runtime/bridgeActivity.test.ts +15 -15
- package/src/runtime/bridgeBackupLease.test.ts +9 -9
- package/src/runtime/bridgeConfigReader.test.ts +5 -5
- package/src/runtime/bridgeConsoleHandler.test.ts +8 -8
- package/src/runtime/bridgeContext.test.ts +5 -5
- package/src/runtime/bridgeDriver.test.ts +94 -94
- package/src/runtime/bridgeEvents.test.ts +15 -15
- package/src/runtime/bridgeFiles.test.ts +54 -54
- package/src/runtime/bridgeInstall.test.ts +10 -10
- package/src/runtime/bridgeLiveConfig.test.ts +6 -6
- package/src/runtime/bridgePending.test.ts +6 -6
- package/src/runtime/bridgeRedaction.test.ts +16 -16
- package/src/runtime/bridgeRegistry.test.ts +84 -52
- package/src/runtime/bridgeRegistry.ts +2 -2
- package/src/runtime/bridgeServer.test.ts +31 -31
- package/src/runtime/bridgeSetup.test.ts +27 -27
- package/src/runtime/bridgeSetup.ts +1 -1
- package/src/runtime/bridgeSetupHandlers.test.ts +13 -13
- package/src/runtime/bridgeSignal.test.ts +7 -7
- package/src/runtime/bridgeSupervisor.test.ts +42 -42
- package/src/runtime/serve.ts +4 -4
- package/src/steam/avatars.test.ts +13 -13
- package/src/steam/steamApp.test.ts +8 -8
- package/src/steam/steamcmd.test.ts +17 -17
- package/src/steam/steamcmd.ts +4 -4
- package/src/steam/steamcmdNarrator.test.ts +4 -4
- package/src/steam/workshop.test.ts +5 -5
- package/src/utils/changedSettingKeys.test.ts +5 -5
- package/src/utils/describeExecFailure.test.ts +4 -4
- package/src/utils/describeExecFailure.ts +1 -1
- package/src/utils/sameSettingValue.test.ts +7 -7
- package/src/utils/token.test.ts +7 -7
- package/src/wine/protonCommand.test.ts +5 -5
- package/src/wine/wineCommand.test.ts +6 -6
- package/src/wine/winePrefix.test.ts +6 -6
- package/src/wire/activity.test.ts +8 -8
- package/src/wire/panel.test.ts +28 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect,
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
2
|
import type { BridgeContext } from "../context";
|
|
3
3
|
import { INSTALL_STAMP_FILE, parseStamp, readStamp, writeStamp } from "./installStamp";
|
|
4
4
|
|
|
@@ -31,7 +31,7 @@ const testContext = (seed: Record<string, string> = {}) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
describe("parseStamp", () => {
|
|
34
|
-
|
|
34
|
+
it("reads a json object", () => {
|
|
35
35
|
expect(
|
|
36
36
|
parseStamp<TestStamp>(
|
|
37
37
|
JSON.stringify({
|
|
@@ -43,7 +43,7 @@ describe("parseStamp", () => {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
it("returns null for anything that is not a json object", () => {
|
|
47
47
|
expect(parseStamp("")).toBeNull();
|
|
48
48
|
expect(parseStamp("{")).toBeNull();
|
|
49
49
|
expect(parseStamp("null")).toBeNull();
|
|
@@ -53,13 +53,13 @@ describe("parseStamp", () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
describe("readStamp", () => {
|
|
56
|
-
|
|
56
|
+
it("returns null when the stamp file is absent", async () => {
|
|
57
57
|
const { context } = testContext();
|
|
58
58
|
|
|
59
59
|
expect(await readStamp(context)).toBeNull();
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
it("reads the stamp the writer left behind", async () => {
|
|
63
63
|
const { context } = testContext();
|
|
64
64
|
|
|
65
65
|
await writeStamp<TestStamp>(context, {
|
|
@@ -73,7 +73,7 @@ describe("readStamp", () => {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
it("writes pretty json ending in a newline", async () => {
|
|
77
77
|
const { context, stored } = testContext();
|
|
78
78
|
|
|
79
79
|
await writeStamp(context, {
|
|
@@ -83,7 +83,7 @@ describe("readStamp", () => {
|
|
|
83
83
|
expect(stored.get(INSTALL_STAMP_FILE)).toBe('{\n "buildId": "1"\n}\n');
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
it("honours a custom stamp path", async () => {
|
|
87
87
|
const { context, stored } = testContext();
|
|
88
88
|
|
|
89
89
|
await writeStamp(
|
|
@@ -100,7 +100,7 @@ describe("readStamp", () => {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
it("returns null when the read fails after the file was seen", async () => {
|
|
104
104
|
const context = {
|
|
105
105
|
files: {
|
|
106
106
|
async exists() {
|
|
@@ -115,7 +115,7 @@ describe("readStamp", () => {
|
|
|
115
115
|
expect(await readStamp(context)).toBeNull();
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
it("returns null when the stamp file is corrupt", async () => {
|
|
119
119
|
const { context } = testContext({
|
|
120
120
|
[INSTALL_STAMP_FILE]: "not json",
|
|
121
121
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export enum ManifestExtensionKind {
|
|
4
|
+
Mods = "mods",
|
|
5
|
+
Plugins = "plugins",
|
|
6
|
+
Addons = "addons",
|
|
7
|
+
Modpacks = "modpacks",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum ManifestExtensionSource {
|
|
11
|
+
Modrinth = "modrinth",
|
|
12
|
+
CurseForge = "curseforge",
|
|
13
|
+
Hangar = "hangar",
|
|
14
|
+
Thunderstore = "thunderstore",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const EXTENSIONS_LIMIT = Object.values(ManifestExtensionKind).length;
|
|
18
|
+
|
|
19
|
+
export const EXTENSION_SOURCES_LIMIT = Object.values(ManifestExtensionSource).length;
|
|
20
|
+
|
|
21
|
+
export const manifestExtensionSchema = z.object({
|
|
22
|
+
kind: z.enum(ManifestExtensionKind).meta({
|
|
23
|
+
description: "What the customer adds to the game: mods, plugins, add-ons or modpacks.",
|
|
24
|
+
}),
|
|
25
|
+
sources: z.array(z.enum(ManifestExtensionSource)).max(EXTENSION_SOURCES_LIMIT).default([]).meta({
|
|
26
|
+
description:
|
|
27
|
+
"The catalogs the panel installs this kind from. Leave it empty when the customer adds them by hand through the files.",
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type ManifestExtension = z.infer<typeof manifestExtensionSchema>;
|
|
32
|
+
|
|
33
|
+
export const manifestExtensionsSchema = z.array(manifestExtensionSchema).max(EXTENSIONS_LIMIT).default([]).meta({
|
|
34
|
+
description:
|
|
35
|
+
"What a customer can add to this game, and from which catalogs. The public pages claim only what is declared here; declare nothing when the game takes no additions.",
|
|
36
|
+
});
|