Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { WebRTCChunkSource } from "@suaveplan/drive-webrtc/chunk-source/chunk-source";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/chunk-source/chunk-source bundle size", () => {
it("does not reach into signalling or low-level WebRTC", {
timeout: 5000,
}, () => {
const src = WebRTCChunkSource.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/SignalingClient/);
});
});

View File

@@ -0,0 +1,13 @@
import { WebRTCClient } from "@suaveplan/drive-webrtc/client/webrtc-client";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/client/webrtc-client bundle size", () => {
it("does not drag in signalling or discovery code", {
timeout: 5000,
}, () => {
const src = WebRTCClient.toString();
expect(src).not.toMatch(/SignalingClient/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
expect(src).not.toMatch(/WebSocket/);
});
});

View File

@@ -0,0 +1,13 @@
import { DataChannelManager } from "@suaveplan/drive-webrtc/data-channel/data-channel-manager";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/data-channel/data-channel-manager bundle size", () => {
it("does not pull signalling or discovery code", {
timeout: 5000,
}, () => {
const src = DataChannelManager.toString();
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/SignalingClient/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
});
});

View File

@@ -0,0 +1,14 @@
import { ChunkIntegrityManager } from "@suaveplan/drive-webrtc/integrity/chunk-integrity";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/integrity/chunk-integrity bundle size", () => {
it("does not reach into signalling or peer code", {
timeout: 5000,
}, () => {
const src = ChunkIntegrityManager.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/SignalingClient/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
});
});

View File

@@ -0,0 +1,14 @@
import { LRUCache } from "@suaveplan/drive-webrtc/lru-cache/lru-cache";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/lru-cache bundle size", () => {
it("does not reach into WebRTC / WebSocket primitives", {
timeout: 5000,
}, () => {
const src = LRUCache.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
expect(src).not.toMatch(/SignalingClient/);
});
});

View File

@@ -0,0 +1,13 @@
import { PeerManager } from "@suaveplan/drive-webrtc/peer-manager/peer-manager";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/peer-manager/peer-manager bundle size", () => {
it("does not reach into low-level WebRTC primitives", {
timeout: 5000,
}, () => {
const src = PeerManager.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
});
});

View File

@@ -0,0 +1,13 @@
import { WebRTCDrivePlugin } from "@suaveplan/drive-webrtc/plugin/webrtc-plugin";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/plugin/webrtc-plugin bundle size", () => {
it("loads the orchestrator class", { timeout: 5000 }, () => {
const src = WebRTCDrivePlugin.toString();
// Orchestrator is allowed to reference both signalling and
// WebRTC primitives because it wires them. Verify it does not
// pull in unrelated rate-limiter or LRU internals.
expect(src).not.toMatch(/RateLimiter/);
expect(src).not.toMatch(/class LRUCache/);
});
});

View File

@@ -0,0 +1,15 @@
import { RateLimiter } from "@suaveplan/drive-webrtc/rate-limiter/rate-limiter";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/rate-limiter/rate-limiter bundle size", () => {
it("is a leaf module — pulls no other subsystem", {
timeout: 5000,
}, () => {
const src = RateLimiter.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
expect(src).not.toMatch(/SignalingClient/);
expect(src).not.toMatch(/PeerManager/);
});
});

View File

@@ -0,0 +1,24 @@
import {
generateSecurePeerId,
generateSecureRequestId,
validatePeerSecurity,
validateSignalingUrl,
} from "@suaveplan/drive-webrtc/security/security-validator";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/security/security-validator bundle size", () => {
it("is a leaf module — pulls no other subsystem", {
timeout: 5000,
}, () => {
const combined =
generateSecurePeerId.toString() +
generateSecureRequestId.toString() +
validatePeerSecurity.toString() +
validateSignalingUrl.toString();
expect(combined).not.toMatch(/RTCPeerConnection/);
expect(combined).not.toMatch(/WebSocket/);
expect(combined).not.toMatch(/SignalingClient/);
expect(combined).not.toMatch(/PeerManager/);
expect(combined).not.toMatch(/ChunkDiscoveryManager/);
});
});

View File

@@ -0,0 +1,13 @@
import { SignalingClient } from "@suaveplan/drive-webrtc/signaling/signaling-client";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/signaling/signaling-client bundle size", () => {
it("does not pull RTCPeerConnection or discovery code", {
timeout: 5000,
}, () => {
const src = SignalingClient.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
expect(src).not.toMatch(/DataChannelManager/);
});
});

View File

@@ -0,0 +1,22 @@
import {
SubChunkReassembler,
sendSubChunks,
splitIntoSubChunks,
} from "@suaveplan/drive-webrtc/sub-chunk/sub-chunk-splitter";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("@suaveplan/drive-webrtc/sub-chunk/sub-chunk-splitter bundle size", () => {
it("does not drag in higher-level subsystems", {
timeout: 5000,
}, () => {
const src =
SubChunkReassembler.toString() +
splitIntoSubChunks.toString() +
sendSubChunks.toString();
expect(src).not.toMatch(/RTCPeerConnection/);
expect(src).not.toMatch(/WebSocket/);
expect(src).not.toMatch(/SignalingClient/);
expect(src).not.toMatch(/ChunkDiscoveryManager/);
expect(src).not.toMatch(/PeerManager/);
});
});