@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.
Files changed (94) hide show
  1. package/package.json +3 -2
  2. package/rules/package.md +65 -0
  3. package/src/blog/articleFrontmatter.test.ts +10 -10
  4. package/src/blog/compile.test.ts +9 -9
  5. package/src/bot/botDeploy.test.ts +16 -16
  6. package/src/bot/botEnvironment.test.ts +8 -8
  7. package/src/bot/botIdentity.test.ts +12 -12
  8. package/src/bot/botPanel.test.ts +13 -13
  9. package/src/bot/botPanel.ts +4 -4
  10. package/src/bot/botState.test.ts +3 -3
  11. package/src/bot/botTerminal.test.ts +5 -5
  12. package/src/bot/botVariables.test.ts +8 -8
  13. package/src/bot/detect/botToken.test.ts +6 -6
  14. package/src/bot/detect/detect.test.ts +21 -21
  15. package/src/bot/detect/detectTable.test.ts +5 -5
  16. package/src/bot/detect/envExample.test.ts +2 -2
  17. package/src/bot/detect/envScan.test.ts +4 -4
  18. package/src/bot/detect/inferBotPlatform.test.ts +4 -4
  19. package/src/bot/detect/keys.test.ts +3 -3
  20. package/src/bot/detect/sensitiveKey.test.ts +5 -5
  21. package/src/bot/detect/serverkJson.test.ts +5 -5
  22. package/src/catalogs/curseforge.test.ts +35 -35
  23. package/src/catalogs/thunderstore.test.ts +9 -9
  24. package/src/cli/detectTable.test.ts +3 -3
  25. package/src/cli/link.test.ts +11 -11
  26. package/src/cli/main.ts +8 -0
  27. package/src/cli/rules.test.ts +198 -0
  28. package/src/cli/rules.ts +188 -0
  29. package/src/cli/validate.test.ts +179 -31
  30. package/src/cli/validate.ts +44 -0
  31. package/src/codecs/ini.test.ts +13 -13
  32. package/src/codecs/javaProperties.test.ts +11 -11
  33. package/src/codecs/sourceCfg.test.ts +14 -14
  34. package/src/codecs/xmlProperties.test.ts +10 -10
  35. package/src/core/bridgePort.test.ts +6 -6
  36. package/src/core/bridgeUserError.test.ts +4 -4
  37. package/src/core/bridgeValue.test.ts +5 -5
  38. package/src/core/describeDownloadFailure.test.ts +12 -12
  39. package/src/core/describeDownloadFailure.ts +10 -10
  40. package/src/guides/markdown.test.ts +31 -31
  41. package/src/install/installStamp.test.ts +9 -9
  42. package/src/manifest/extension.ts +36 -0
  43. package/src/manifest/index.ts +1 -0
  44. package/src/manifest/manifest.test.ts +208 -90
  45. package/src/manifest/manifest.ts +34 -0
  46. package/src/net/loopback.test.ts +10 -10
  47. package/src/presence/rosterSync.test.ts +7 -7
  48. package/src/probes/a2s.test.ts +5 -5
  49. package/src/probes/minecraftPing.test.ts +17 -17
  50. package/src/probes/raknetPing.test.ts +13 -13
  51. package/src/protocol/bridgePreview.ts +1 -0
  52. package/src/rcon/rconAccess.test.ts +20 -20
  53. package/src/rcon/rconAccess.ts +14 -14
  54. package/src/rcon/rconClient.test.ts +49 -49
  55. package/src/rcon/rconFrame.test.ts +14 -14
  56. package/src/rcon/rconIds.test.ts +4 -4
  57. package/src/rcon/rconWriter.test.ts +6 -6
  58. package/src/runtime/bridgeActivity.test.ts +15 -15
  59. package/src/runtime/bridgeBackupLease.test.ts +9 -9
  60. package/src/runtime/bridgeConfigReader.test.ts +5 -5
  61. package/src/runtime/bridgeConsoleHandler.test.ts +8 -8
  62. package/src/runtime/bridgeContext.test.ts +5 -5
  63. package/src/runtime/bridgeDriver.test.ts +94 -94
  64. package/src/runtime/bridgeEvents.test.ts +15 -15
  65. package/src/runtime/bridgeFiles.test.ts +54 -54
  66. package/src/runtime/bridgeInstall.test.ts +10 -10
  67. package/src/runtime/bridgeLiveConfig.test.ts +6 -6
  68. package/src/runtime/bridgePending.test.ts +6 -6
  69. package/src/runtime/bridgeRedaction.test.ts +16 -16
  70. package/src/runtime/bridgeRegistry.test.ts +84 -52
  71. package/src/runtime/bridgeRegistry.ts +2 -2
  72. package/src/runtime/bridgeServer.test.ts +31 -31
  73. package/src/runtime/bridgeSetup.test.ts +27 -27
  74. package/src/runtime/bridgeSetup.ts +1 -1
  75. package/src/runtime/bridgeSetupHandlers.test.ts +13 -13
  76. package/src/runtime/bridgeSignal.test.ts +7 -7
  77. package/src/runtime/bridgeSupervisor.test.ts +42 -42
  78. package/src/runtime/serve.ts +4 -4
  79. package/src/steam/avatars.test.ts +13 -13
  80. package/src/steam/steamApp.test.ts +8 -8
  81. package/src/steam/steamcmd.test.ts +17 -17
  82. package/src/steam/steamcmd.ts +4 -4
  83. package/src/steam/steamcmdNarrator.test.ts +4 -4
  84. package/src/steam/workshop.test.ts +5 -5
  85. package/src/utils/changedSettingKeys.test.ts +5 -5
  86. package/src/utils/describeExecFailure.test.ts +4 -4
  87. package/src/utils/describeExecFailure.ts +1 -1
  88. package/src/utils/sameSettingValue.test.ts +7 -7
  89. package/src/utils/token.test.ts +7 -7
  90. package/src/wine/protonCommand.test.ts +5 -5
  91. package/src/wine/wineCommand.test.ts +6 -6
  92. package/src/wine/winePrefix.test.ts +6 -6
  93. package/src/wire/activity.test.ts +8 -8
  94. package/src/wire/panel.test.ts +28 -28
@@ -1,4 +1,4 @@
1
- import { describe, expect, test } from "bun:test";
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
- test("reads a json object", () => {
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
- test("returns null for anything that is not a json object", () => {
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
- test("returns null when the stamp file is absent", async () => {
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
- test("reads the stamp the writer left behind", async () => {
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
- test("writes pretty json ending in a newline", async () => {
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
- test("honours a custom stamp path", async () => {
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
- test("returns null when the read fails after the file was seen", async () => {
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
- test("returns null when the stamp file is corrupt", async () => {
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
+ });
@@ -1,6 +1,7 @@
1
1
  export * from "../utils";
2
2
  export * from "./assets";
3
3
  export * from "./category";
4
+ export * from "./extension";
4
5
  export * from "./guide";
5
6
  export * from "./image";
6
7
  export * from "./jsonSchema";