@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
package/src/wire/panel.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect,
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
2
|
import { GuideOpenTab } from "@serverkgg/bridge/guides";
|
|
3
3
|
import {
|
|
4
4
|
BridgeAccess,
|
|
@@ -205,14 +205,14 @@ const tabsOf = (count: number) => {
|
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
describe("the panel mirror", () => {
|
|
208
|
-
|
|
208
|
+
it("carries an actions section and its fields through unchanged", () => {
|
|
209
209
|
const source = manifest();
|
|
210
210
|
const parsed = bridgeManifestSchema.parse(source);
|
|
211
211
|
|
|
212
212
|
expect(parsed).toEqual(source);
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
it("refuses an action carrying more fields than a prompt fits", () => {
|
|
216
216
|
const source = manifest();
|
|
217
217
|
const [tab] = source.panel?.tabs ?? [];
|
|
218
218
|
const [section] = tab?.sections ?? [];
|
|
@@ -238,7 +238,7 @@ describe("the panel mirror", () => {
|
|
|
238
238
|
expect(bridgeManifestSchema.safeParse(source).success).toBe(false);
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
it("keeps a variables form's preview ref instead of stripping it", () => {
|
|
242
242
|
const source = previewManifest();
|
|
243
243
|
const parsed = bridgeManifestSchema.parse(source);
|
|
244
244
|
const [section] = parsed.panel?.tabs[0]?.sections ?? [];
|
|
@@ -253,7 +253,7 @@ describe("the panel mirror", () => {
|
|
|
253
253
|
expect(parsed).toEqual(source);
|
|
254
254
|
});
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
it("takes a preview module and the preview action it answers", () => {
|
|
257
257
|
const parsed = bridgeManifestSchema.parse(previewManifest());
|
|
258
258
|
|
|
259
259
|
expect(parsed.modules[0]).toEqual({
|
|
@@ -269,7 +269,7 @@ describe("the panel mirror", () => {
|
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
it("takes eight tabs and refuses nine", () => {
|
|
273
273
|
const source = manifest();
|
|
274
274
|
|
|
275
275
|
expect(
|
|
@@ -363,13 +363,13 @@ const detailManifest = (): BridgeManifest => ({
|
|
|
363
363
|
});
|
|
364
364
|
|
|
365
365
|
describe("detail sections", () => {
|
|
366
|
-
|
|
366
|
+
it("round-trips a detail section and a clearing form", () => {
|
|
367
367
|
const source = detailManifest();
|
|
368
368
|
|
|
369
369
|
expect(bridgeManifestSchema.parse(source)).toEqual(source);
|
|
370
370
|
});
|
|
371
371
|
|
|
372
|
-
|
|
372
|
+
it("refuses a clear whose variable is not an env key", () => {
|
|
373
373
|
const source = detailManifest();
|
|
374
374
|
const [form] = source.panel?.tabs[0]?.sections ?? [];
|
|
375
375
|
|
|
@@ -436,7 +436,7 @@ const uploadManifest = (mode?: BridgeUploadMode): BridgeManifest => ({
|
|
|
436
436
|
});
|
|
437
437
|
|
|
438
438
|
describe("the upload mirror", () => {
|
|
439
|
-
|
|
439
|
+
it("carries the file upload mode through unchanged", () => {
|
|
440
440
|
const source = uploadManifest(BridgeUploadMode.File);
|
|
441
441
|
const parsed = bridgeManifestSchema.parse(source);
|
|
442
442
|
const [section] = parsed.panel?.tabs[0]?.sections ?? [];
|
|
@@ -448,11 +448,11 @@ describe("the upload mirror", () => {
|
|
|
448
448
|
expect(section.upload?.mode).toBe(BridgeUploadMode.File);
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
-
|
|
451
|
+
it("takes an upload that declares no mode", () => {
|
|
452
452
|
expect(bridgeManifestSchema.safeParse(uploadManifest()).success).toBe(true);
|
|
453
453
|
});
|
|
454
454
|
|
|
455
|
-
|
|
455
|
+
it("refuses an upload mode the platform does not know", () => {
|
|
456
456
|
const source = uploadManifest("stream" as BridgeUploadMode);
|
|
457
457
|
|
|
458
458
|
expect(bridgeManifestSchema.safeParse(source).success).toBe(false);
|
|
@@ -486,19 +486,19 @@ const fieldManifest = (field: BridgeField): BridgeManifest => ({
|
|
|
486
486
|
});
|
|
487
487
|
|
|
488
488
|
describe("secret fields", () => {
|
|
489
|
-
|
|
489
|
+
it("carries a secret control with its pattern and hint through unchanged", () => {
|
|
490
490
|
const source = fieldManifest({
|
|
491
491
|
key: "LICENSE_KEY",
|
|
492
492
|
control: BridgeControl.Secret,
|
|
493
493
|
label: text("Licence key"),
|
|
494
|
-
pattern: "^
|
|
495
|
-
patternHint: text("A licence key starts with
|
|
494
|
+
pattern: "^key_\\w{1,60}_\\w{1,20}$",
|
|
495
|
+
patternHint: text("A licence key starts with key_"),
|
|
496
496
|
});
|
|
497
497
|
|
|
498
498
|
expect(bridgeManifestSchema.parse(source)).toEqual(source);
|
|
499
499
|
});
|
|
500
500
|
|
|
501
|
-
|
|
501
|
+
it("refuses a control the platform does not know", () => {
|
|
502
502
|
const source = fieldManifest({
|
|
503
503
|
key: "LICENSE_KEY",
|
|
504
504
|
control: "password" as BridgeControl,
|
|
@@ -508,7 +508,7 @@ describe("secret fields", () => {
|
|
|
508
508
|
expect(bridgeManifestSchema.safeParse(source).success).toBe(false);
|
|
509
509
|
});
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
it("refuses a pattern longer than the platform takes", () => {
|
|
512
512
|
const source = fieldManifest({
|
|
513
513
|
key: "LICENSE_KEY",
|
|
514
514
|
control: BridgeControl.Secret,
|
|
@@ -530,7 +530,7 @@ const setupManifest = (setup: BridgeSetupManifest | null): BridgeManifest => ({
|
|
|
530
530
|
});
|
|
531
531
|
|
|
532
532
|
describe("the setup mirror", () => {
|
|
533
|
-
|
|
533
|
+
it("carries every step kind through unchanged", () => {
|
|
534
534
|
const source = setupManifest({
|
|
535
535
|
steps: [
|
|
536
536
|
{
|
|
@@ -565,11 +565,11 @@ describe("the setup mirror", () => {
|
|
|
565
565
|
expect(bridgeManifestSchema.parse(source).setup).toEqual(source.setup);
|
|
566
566
|
});
|
|
567
567
|
|
|
568
|
-
|
|
568
|
+
it("takes a manifest that declares no setup", () => {
|
|
569
569
|
expect(bridgeManifestSchema.parse(setupManifest(null)).setup).toBeNull();
|
|
570
570
|
});
|
|
571
571
|
|
|
572
|
-
|
|
572
|
+
it("defaults a manifest from an older bridge that carries no setup block to null", () => {
|
|
573
573
|
const older = setupManifest(null);
|
|
574
574
|
|
|
575
575
|
delete (older as Partial<BridgeManifest>).setup;
|
|
@@ -577,7 +577,7 @@ describe("the setup mirror", () => {
|
|
|
577
577
|
expect(bridgeManifestSchema.parse(older).setup).toBeNull();
|
|
578
578
|
});
|
|
579
579
|
|
|
580
|
-
|
|
580
|
+
it("refuses a step kind the platform does not know", () => {
|
|
581
581
|
const source = setupManifest({
|
|
582
582
|
steps: [
|
|
583
583
|
{
|
|
@@ -591,7 +591,7 @@ describe("the setup mirror", () => {
|
|
|
591
591
|
expect(bridgeManifestSchema.safeParse(source).success).toBe(false);
|
|
592
592
|
});
|
|
593
593
|
|
|
594
|
-
|
|
594
|
+
it("refuses more steps than the platform takes", () => {
|
|
595
595
|
const source = setupManifest({
|
|
596
596
|
steps: Array.from({
|
|
597
597
|
length: 9,
|
|
@@ -677,7 +677,7 @@ const placedManifest = (): BridgeManifest => ({
|
|
|
677
677
|
});
|
|
678
678
|
|
|
679
679
|
describe("the placement mirror", () => {
|
|
680
|
-
|
|
680
|
+
it("carries place, an offline row action and a form help through unchanged", () => {
|
|
681
681
|
const source = placedManifest();
|
|
682
682
|
|
|
683
683
|
expect(bridgeManifestSchema.parse(source)).toEqual(source);
|
|
@@ -685,7 +685,7 @@ describe("the placement mirror", () => {
|
|
|
685
685
|
});
|
|
686
686
|
|
|
687
687
|
describe("the cell schema", () => {
|
|
688
|
-
|
|
688
|
+
it("accepts a scalar and a localized cell", () => {
|
|
689
689
|
expect(
|
|
690
690
|
bridgeCellsSchema.parse({
|
|
691
691
|
id: "u-1",
|
|
@@ -707,7 +707,7 @@ describe("the cell schema", () => {
|
|
|
707
707
|
});
|
|
708
708
|
});
|
|
709
709
|
|
|
710
|
-
|
|
710
|
+
it("rejects a cell that carries only one language", () => {
|
|
711
711
|
expect(
|
|
712
712
|
bridgeCellsSchema.safeParse({
|
|
713
713
|
status: {
|
|
@@ -719,7 +719,7 @@ describe("the cell schema", () => {
|
|
|
719
719
|
});
|
|
720
720
|
|
|
721
721
|
describe("the availability schema", () => {
|
|
722
|
-
|
|
722
|
+
it("accepts reasons for the module and per subject", () => {
|
|
723
723
|
const availability = {
|
|
724
724
|
module: {
|
|
725
725
|
wipe: text("Closed right now"),
|
|
@@ -734,7 +734,7 @@ describe("the availability schema", () => {
|
|
|
734
734
|
expect(bridgeAvailabilitySchema.parse(availability)).toEqual(availability);
|
|
735
735
|
});
|
|
736
736
|
|
|
737
|
-
|
|
737
|
+
it("accepts an answer with nothing unavailable", () => {
|
|
738
738
|
expect(
|
|
739
739
|
bridgeAvailabilitySchema.parse({
|
|
740
740
|
module: {},
|
|
@@ -746,7 +746,7 @@ describe("the availability schema", () => {
|
|
|
746
746
|
});
|
|
747
747
|
});
|
|
748
748
|
|
|
749
|
-
|
|
749
|
+
it("rejects a reason that is not localized", () => {
|
|
750
750
|
expect(
|
|
751
751
|
bridgeAvailabilitySchema.safeParse({
|
|
752
752
|
module: {
|
|
@@ -757,7 +757,7 @@ describe("the availability schema", () => {
|
|
|
757
757
|
).toBe(false);
|
|
758
758
|
});
|
|
759
759
|
|
|
760
|
-
|
|
760
|
+
it("keeps a manifest module that advertises availability among its actions", () => {
|
|
761
761
|
const parsed = bridgeManifestSchema.parse({
|
|
762
762
|
...manifest(),
|
|
763
763
|
modules: [
|