From 439de6a2643f75e12852638fd305db941bfe4893 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 26 Apr 2026 18:19:01 +0100 Subject: [PATCH] Remove clutter --- frontend/deterministic-tests/src/managed-websocket.ts | 2 +- frontend/deterministic-tests/src/utils/find-free-port.ts | 2 +- frontend/history-ui/src/lib/stores.svelte.ts | 2 +- frontend/local-client-cli/src/args.ts | 4 ++-- frontend/sync-client/src/persistence/database.ts | 2 -- .../src/services/types/UpdateDocumentVersion.ts | 7 ------- frontend/sync-client/src/sync-operations/types.ts | 2 +- frontend/sync-client/src/tracing/sync-history.ts | 2 +- scripts/update-api-types.sh | 5 +++++ 9 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 frontend/sync-client/src/persistence/database.ts delete mode 100644 frontend/sync-client/src/services/types/UpdateDocumentVersion.ts diff --git a/frontend/deterministic-tests/src/managed-websocket.ts b/frontend/deterministic-tests/src/managed-websocket.ts index c97a43a0..d8801d1b 100644 --- a/frontend/deterministic-tests/src/managed-websocket.ts +++ b/frontend/deterministic-tests/src/managed-websocket.ts @@ -8,7 +8,7 @@ * constructor using Object.defineProperty so we don't need conflicting * get/set accessor pairs. */ -export class ManagedWebSocket implements WebSocket { +class ManagedWebSocket implements WebSocket { public static readonly CONNECTING = WebSocket.CONNECTING; public static readonly OPEN = WebSocket.OPEN; public static readonly CLOSING = WebSocket.CLOSING; diff --git a/frontend/deterministic-tests/src/utils/find-free-port.ts b/frontend/deterministic-tests/src/utils/find-free-port.ts index 3c965049..0734c1a9 100644 --- a/frontend/deterministic-tests/src/utils/find-free-port.ts +++ b/frontend/deterministic-tests/src/utils/find-free-port.ts @@ -1,6 +1,6 @@ import * as net from "node:net"; -export interface PortReservation { +interface PortReservation { port: number; release: () => void; } diff --git a/frontend/history-ui/src/lib/stores.svelte.ts b/frontend/history-ui/src/lib/stores.svelte.ts index 458ec5e7..8b268eb6 100644 --- a/frontend/history-ui/src/lib/stores.svelte.ts +++ b/frontend/history-ui/src/lib/stores.svelte.ts @@ -79,7 +79,7 @@ class NavStore { export const nav = new NavStore(); // Toasts -export interface Toast { +interface Toast { id: number; message: string; type: "success" | "error" | "info"; diff --git a/frontend/local-client-cli/src/args.ts b/frontend/local-client-cli/src/args.ts index 3652a4c7..442c4817 100644 --- a/frontend/local-client-cli/src/args.ts +++ b/frontend/local-client-cli/src/args.ts @@ -2,9 +2,9 @@ import { Command, Option } from "commander"; import packageJson from "../package.json"; import { LogLevel } from "sync-client"; -export type LineEndingMode = "auto" | "lf" | "crlf"; +type LineEndingMode = "auto" | "lf" | "crlf"; -export interface CliArgs { +interface CliArgs { remoteUri: string; token: string; vaultName: string; diff --git a/frontend/sync-client/src/persistence/database.ts b/frontend/sync-client/src/persistence/database.ts deleted file mode 100644 index 72f15fbd..00000000 --- a/frontend/sync-client/src/persistence/database.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is intentionally empty -// All document tracking has been moved to sync-event-queue.ts diff --git a/frontend/sync-client/src/services/types/UpdateDocumentVersion.ts b/frontend/sync-client/src/services/types/UpdateDocumentVersion.ts deleted file mode 100644 index 4e57a297..00000000 --- a/frontend/sync-client/src/services/types/UpdateDocumentVersion.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export interface UpdateDocumentVersion { - parent_version_id: bigint; - relative_path: string; - content: number[]; -} diff --git a/frontend/sync-client/src/sync-operations/types.ts b/frontend/sync-client/src/sync-operations/types.ts index 4cdac588..7a15aedd 100644 --- a/frontend/sync-client/src/sync-operations/types.ts +++ b/frontend/sync-client/src/sync-operations/types.ts @@ -16,7 +16,7 @@ export interface DocumentWithPath { record: DocumentRecord; } -export interface StoredDocument extends DocumentRecord { +interface StoredDocument extends DocumentRecord { relativePath: RelativePath; } diff --git a/frontend/sync-client/src/tracing/sync-history.ts b/frontend/sync-client/src/tracing/sync-history.ts index 88b699fe..362d98e9 100644 --- a/frontend/sync-client/src/tracing/sync-history.ts +++ b/frontend/sync-client/src/tracing/sync-history.ts @@ -28,7 +28,7 @@ export interface SyncDeleteDetails { relativePath: RelativePath; } -export interface SyncSkippedDetails { +interface SyncSkippedDetails { type: SyncType.SKIPPED; relativePath: RelativePath; } diff --git a/scripts/update-api-types.sh b/scripts/update-api-types.sh index 1f10944c..e460214b 100755 --- a/scripts/update-api-types.sh +++ b/scripts/update-api-types.sh @@ -8,7 +8,12 @@ cd sync-server cargo test export_bindings cd - +# sync-client/src/services/types contains only generated bindings — wipe and copy +rm -f frontend/sync-client/src/services/types/*.ts cp -r sync-server/bindings/* frontend/sync-client/src/services/types/ + +# history-ui/src/lib/types contains generated bindings plus a hand-written index.ts +find frontend/history-ui/src/lib/types -maxdepth 1 -name "*.ts" ! -name "index.ts" -delete cp -r sync-server/bindings/* frontend/history-ui/src/lib/types/ cd frontend