From 306fcb242028842a6bb667b94deb954035d8c96e Mon Sep 17 00:00:00 2001 From: static Date: Mon, 12 Oct 2026 07:16:16 +0900 Subject: [PATCH] =?UTF-8?q?Svelte=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=9C=EC=99=B8=ED=95=9C=20=ED=8C=8C=EC=9D=BC,?= =?UTF-8?q?=20=ED=8F=B4=EB=8D=94=20=EB=B0=8F=20=EB=9D=BC=EC=9A=B0=ED=8C=85?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=EC=9D=98=20=EC=9D=B4=EB=A6=84=EC=9D=84=20?= =?UTF-8?q?kebab-case=EB=A1=9C=20=ED=86=B5=EC=9D=BC=ED=95=98=EA=B3=A0=20im?= =?UTF-8?q?port=20=EA=B2=BD=EB=A1=9C=EC=97=90=20=EC=8B=A4=EC=A0=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=ED=99=95=EC=9E=A5=EC=9E=90=EB=A5=BC=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- eslint.config.js | 2 +- kysely.config.ts | 2 +- src/hooks.client.ts | 8 +++--- src/hooks.server.ts | 8 +++--- .../cache/{fileCache.ts => file-cache.ts} | 6 ++--- src/lib/client/cache/index.ts | 4 +-- ...he.svelte.ts => thumbnail-cache.svelte.ts} | 4 +-- src/lib/client/crypto/hmac.ts | 4 +-- src/lib/client/keys/generation.ts | 6 ++--- src/lib/client/keys/index.ts | 10 +++---- src/lib/client/keys/keyring.svelte.ts | 4 +-- src/lib/client/keys/sync.ts | 8 +++--- .../{serviceWorker.ts => service-worker.ts} | 4 +-- .../cache-index.ts} | 0 .../{indexedDB => indexed-db}/filesystem.ts | 0 src/lib/client/storage/indexed-db/index.ts | 3 +++ .../keyStore.ts => indexed-db/key-store.ts} | 0 src/lib/client/storage/indexedDB/index.ts | 3 --- .../{chunkedUpload.ts => chunked-upload.ts} | 8 +++--- src/lib/client/transfer/download.svelte.ts | 4 +-- src/lib/client/transfer/index.ts | 4 +-- src/lib/client/transfer/upload.svelte.ts | 20 +++++++------- .../auth/components/ForceLoginModal.svelte | 2 +- src/lib/features/auth/index.ts | 2 +- src/lib/features/errors.ts | 4 +-- src/lib/features/favorites/index.ts | 6 ++--- src/lib/features/filesystem/category.ts | 14 +++++----- .../filesystem/components/Categories.svelte | 6 ++--- .../components/CategoryCreateModal.svelte | 2 +- .../components/DirectoryEntry.svelte | 2 +- .../filesystem/components/FileEntry.svelte | 8 +++--- .../components/FileThumbnailButton.svelte | 4 +-- .../components/SubCategories.svelte | 6 ++--- src/lib/features/filesystem/content.ts | 12 ++++----- src/lib/features/filesystem/directory.ts | 14 +++++----- src/lib/features/filesystem/file.ts | 16 ++++++------ src/lib/features/filesystem/index.ts | 12 ++++----- src/lib/features/filesystem/metadata.ts | 4 +-- src/lib/features/filesystem/upload.ts | 6 ++--- src/lib/features/search/index.ts | 4 +-- src/lib/server/auth.ts | 8 +++--- src/lib/server/db/error.ts | 2 +- src/lib/server/db/index.ts | 26 +++++++++---------- src/lib/server/db/kysely.ts | 8 +++--- src/lib/server/db/migrations/index.ts | 12 ++++----- src/lib/server/db/repositories/category.ts | 8 +++--- src/lib/server/db/repositories/client.ts | 6 ++--- src/lib/server/db/repositories/directory.ts | 10 +++---- .../{fileDeletion.ts => file-deletion.ts} | 2 +- src/lib/server/db/repositories/file.ts | 10 +++---- src/lib/server/db/repositories/hsk.ts | 6 ++--- src/lib/server/db/repositories/media.ts | 6 ++--- src/lib/server/db/repositories/mek.ts | 6 ++--- src/lib/server/db/repositories/session.ts | 6 ++--- src/lib/server/db/repositories/upload.ts | 14 +++++----- src/lib/server/db/repositories/user.ts | 2 +- src/lib/server/db/schema/category.ts | 2 +- src/lib/server/db/schema/directory.ts | 2 +- .../{fileDeletion.ts => file-deletion.ts} | 0 src/lib/server/db/schema/file.ts | 2 +- src/lib/server/db/schema/index.ts | 24 ++++++++--------- src/lib/server/db/schema/upload.ts | 2 +- src/lib/server/http.ts | 2 +- src/lib/server/middlewares/authenticate.ts | 2 +- src/lib/server/middlewares/index.ts | 4 +-- .../{setAgentInfo.ts => set-agent-info.ts} | 0 src/lib/server/services/auth.ts | 10 +++---- src/lib/server/services/category.ts | 8 +++--- src/lib/server/services/client.ts | 8 +++--- src/lib/server/services/common.ts | 2 +- src/lib/server/services/directory.ts | 10 +++---- .../{fileDeletion.ts => file-deletion.ts} | 4 +-- src/lib/server/services/file.ts | 12 ++++----- src/lib/server/services/index.ts | 20 +++++++------- src/lib/server/services/key.ts | 6 ++--- src/lib/server/services/search.ts | 2 +- src/lib/server/services/upload.ts | 12 ++++----- src/lib/server/services/user.ts | 4 +-- src/lib/server/storage/chunks.ts | 4 +-- src/lib/server/storage/files.ts | 2 +- src/lib/server/storage/index.ts | 6 ++--- src/lib/server/storage/streams.ts | 4 +-- src/lib/shared/crypto/aes.ts | 4 +-- src/lib/shared/crypto/index.ts | 8 +++--- src/lib/shared/crypto/rsa.ts | 2 +- src/lib/shared/format/index.ts | 4 +-- src/lib/shared/format/stream.ts | 6 ++--- .../{serviceWorker.ts => service-worker.ts} | 2 +- src/lib/ui/buttons/FloatingButton.svelte | 2 +- src/lib/ui/buttons/IconEntryButton.svelte | 2 +- src/lib/ui/index.ts | 4 +-- src/lib/ui/labels/CategoryLabel.svelte | 2 +- src/lib/ui/labels/DirectoryEntryLabel.svelte | 2 +- src/lib/ui/layout/TitledDiv.svelte | 2 +- src/lib/ui/overlays/ActionModal.svelte | 2 +- src/lib/ui/overlays/BottomSheet.svelte | 2 +- src/lib/ui/overlays/Modal.svelte | 2 +- src/lib/ui/overlays/RenameModal.svelte | 2 +- src/lib/ui/overlays/TextInputModal.svelte | 2 +- src/lib/ui/overlays/Toasts.svelte | 2 +- ...roup.svelte.ts => overlay-group.svelte.ts} | 0 .../{BoundedQueue.ts => bounded-queue.ts} | 0 src/lib/utils/concurrency/index.ts | 4 +-- .../{Scheduler.ts => scheduler.ts} | 0 .../{gotoStateful.ts => goto-stateful.ts} | 0 src/lib/utils/index.ts | 12 ++++----- .../utils/{speedMeter.ts => speed-meter.ts} | 0 src/routes/(fullscreen)/+layout.svelte | 2 +- .../+page.svelte | 6 ++--- .../(fullscreen)/auth/login/+page.svelte | 14 +++++----- .../(fullscreen)/client/pending/+page.svelte | 4 +-- .../(fullscreen)/file/[id]/+page.svelte | 14 +++++----- .../file/[id]/AddToCategoryBottomSheet.svelte | 8 +++--- .../file/[id]/DownloadStatus.svelte | 4 +-- .../(fullscreen)/file/downloads/+page.svelte | 6 ++--- .../(fullscreen)/file/downloads/File.svelte | 6 ++--- .../(fullscreen)/file/uploads/+page.svelte | 4 +-- .../(fullscreen)/file/uploads/File.svelte | 4 +-- src/routes/(fullscreen)/gallery/+page.svelte | 8 +++--- src/routes/(fullscreen)/gallery/+page.ts | 2 +- .../(fullscreen)/key/export/+page.svelte | 4 +-- src/routes/(fullscreen)/key/export/+page.ts | 2 +- .../export/BeforeContinueBottomSheet.svelte | 2 +- .../key/export/BeforeContinueModal.svelte | 2 +- .../(fullscreen)/key/generate/+page.svelte | 10 +++---- src/routes/(fullscreen)/search/+page.svelte | 12 ++++----- .../search/SelectCategoryBottomSheet.svelte | 6 ++--- .../(fullscreen)/settings/cache/+page.svelte | 10 +++---- .../(fullscreen)/settings/cache/File.svelte | 6 ++--- .../settings/thumbnail/+page.svelte | 12 ++++----- .../(fullscreen)/settings/thumbnail/+page.ts | 2 +- .../settings/thumbnail/service.ts | 6 ++--- src/routes/(main)/+layout.svelte | 2 +- src/routes/(main)/BottomBar.svelte | 2 +- .../(main)/category/[[id]]/+page.svelte | 12 ++++----- .../[[id]]/CategoryDeleteModal.svelte | 6 ++--- .../[[id]]/CategoryMenuBottomSheet.svelte | 4 +-- .../[[id]]/CategoryRenameModal.svelte | 4 +-- .../(main)/category/[[id]]/service.svelte.ts | 2 +- .../(main)/directory/[[id]]/+page.svelte | 15 +++++++---- .../[[id]]/DirectoryCreateModal.svelte | 2 +- .../[[id]]/DownloadStatusCard.svelte | 2 +- .../[[id]]/DuplicateFileModal.svelte | 4 +-- .../[[id]]/EntryCreateBottomSheet.svelte | 2 +- .../directory/[[id]]/EntryDeleteModal.svelte | 6 ++--- .../[[id]]/EntryMenuBottomSheet.svelte | 4 +-- .../directory/[[id]]/EntryRenameModal.svelte | 4 +-- .../directory/[[id]]/UploadStatusCard.svelte | 2 +- .../DirectoryEntries.svelte | 12 ++++----- .../UploadingFile.svelte | 4 +-- .../index.ts | 0 .../(main)/directory/[[id]]/service.svelte.ts | 2 +- src/routes/(main)/favorites/+page.svelte | 8 +++--- src/routes/(main)/home/+page.svelte | 8 +++--- src/routes/(main)/home/service.ts | 2 +- src/routes/(main)/menu/+page.svelte | 6 ++--- src/routes/(main)/menu/+page.ts | 2 +- src/routes/(main)/menu/MenuEntryButton.svelte | 2 +- src/routes/+layout.svelte | 4 +-- src/routes/+layout.ts | 2 +- .../download/+server.ts | 8 +++--- src/routes/api/trpc/[trpc]/+server.ts | 4 +-- .../api/upload/[id]/chunks/[index]/+server.ts | 6 ++--- .../{decryptFile.ts => decrypt-file.ts} | 14 +++++----- src/service-worker/handlers/index.ts | 2 +- src/service-worker/index.ts | 6 ++--- src/service-worker/modules/clients.ts | 2 +- src/service-worker/modules/metadata.ts | 4 +-- src/service-worker/modules/progress.ts | 4 +-- src/service-worker/stores.ts | 2 +- src/trpc/client.ts | 2 +- src/trpc/dto.ts | 6 ++--- src/trpc/init.server.ts | 4 +-- src/trpc/router.server.ts | 4 +-- src/trpc/routers/auth.ts | 8 +++--- src/trpc/routers/category.ts | 8 +++--- src/trpc/routers/client.ts | 6 ++--- src/trpc/routers/directory.ts | 8 +++--- src/trpc/routers/favorites.ts | 8 +++--- src/trpc/routers/file.ts | 8 +++--- src/trpc/routers/hsk.ts | 6 ++--- src/trpc/routers/index.ts | 22 ++++++++-------- src/trpc/routers/mek.ts | 6 ++--- src/trpc/routers/search.ts | 8 +++--- src/trpc/routers/upload.ts | 6 ++--- src/trpc/routers/user.ts | 4 +-- tests/helpers/database.ts | 2 +- tests/helpers/storage.ts | 2 +- tests/server/deletion.test.ts | 10 +++---- tests/server/download.test.ts | 2 +- tests/server/ownership.test.ts | 4 +-- tests/server/trpc.test.ts | 4 +-- tests/server/upload.test.ts | 8 +++--- tests/setup/database.ts | 2 +- tests/setup/server.ts | 2 +- tests/unit/concurrency.test.ts | 2 +- tests/unit/crypto.test.ts | 2 +- ...ream.test.ts => decryption-stream.test.ts} | 6 ++--- ...Cache.test.ts => filesystem-cache.test.ts} | 2 +- tests/unit/keyring.test.ts | 6 ++--- tests/unit/range.test.ts | 4 +-- 201 files changed, 550 insertions(+), 545 deletions(-) rename src/lib/client/cache/{fileCache.ts => file-cache.ts} (98%) rename src/lib/client/cache/{thumbnailCache.svelte.ts => thumbnail-cache.svelte.ts} (98%) rename src/lib/client/{serviceWorker.ts => service-worker.ts} (97%) rename src/lib/client/storage/{indexedDB/cacheIndex.ts => indexed-db/cache-index.ts} (100%) rename src/lib/client/storage/{indexedDB => indexed-db}/filesystem.ts (100%) create mode 100644 src/lib/client/storage/indexed-db/index.ts rename src/lib/client/storage/{indexedDB/keyStore.ts => indexed-db/key-store.ts} (100%) delete mode 100644 src/lib/client/storage/indexedDB/index.ts rename src/lib/client/transfer/{chunkedUpload.ts => chunked-upload.ts} (95%) rename src/lib/server/db/repositories/{fileDeletion.ts => file-deletion.ts} (95%) rename src/lib/server/db/schema/{fileDeletion.ts => file-deletion.ts} (100%) rename src/lib/server/middlewares/{setAgentInfo.ts => set-agent-info.ts} (100%) rename src/lib/server/services/{fileDeletion.ts => file-deletion.ts} (91%) rename src/lib/shared/{serviceWorker.ts => service-worker.ts} (93%) rename src/lib/ui/overlays/{overlayGroup.svelte.ts => overlay-group.svelte.ts} (100%) rename src/lib/utils/concurrency/{BoundedQueue.ts => bounded-queue.ts} (100%) rename src/lib/utils/concurrency/{Scheduler.ts => scheduler.ts} (100%) rename src/lib/utils/{gotoStateful.ts => goto-stateful.ts} (100%) rename src/lib/utils/{speedMeter.ts => speed-meter.ts} (100%) rename src/routes/(fullscreen)/auth/{changePassword => change-password}/+page.svelte (93%) rename src/routes/(main)/directory/[[id]]/{DirectoryEntries => directory-entries}/DirectoryEntries.svelte (92%) rename src/routes/(main)/directory/[[id]]/{DirectoryEntries => directory-entries}/UploadingFile.svelte (93%) rename src/routes/(main)/directory/[[id]]/{DirectoryEntries => directory-entries}/index.ts (100%) rename src/service-worker/handlers/{decryptFile.ts => decrypt-file.ts} (96%) rename tests/unit/{decryptionStream.test.ts => decryption-stream.test.ts} (96%) rename tests/unit/{filesystemCache.test.ts => filesystem-cache.test.ts} (99%) diff --git a/eslint.config.js b/eslint.config.js index 4974f25..567adb5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -61,7 +61,7 @@ export default defineConfig( "src/lib/ui/**": "^(#lib/(server|client|features)/|#trpc/)", "src/lib/features/**": "^#lib/server/", "src/service-worker/**": - "^(#lib/(?!shared/|client/storage/|client/cache/fileCache\\.js$)|#trpc/|#workers/)", + "^(#lib/(?!shared/|client/storage/|client/cache/file-cache\\.ts$)|#trpc/|#workers/)", }), { files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"], diff --git a/kysely.config.ts b/kysely.config.ts index 1d3b9a5..3f14855 100644 --- a/kysely.config.ts +++ b/kysely.config.ts @@ -1,5 +1,5 @@ import { defineConfig } from "kysely-ctl"; -import { createDialect } from "./src/lib/server/db/dialect"; +import { createDialect } from "./src/lib/server/db/dialect.ts"; // Empty values (e.g. `DATABASE_HOST=` in .env) are treated as unset, as in src/env.ts const optional = (name: string) => process.env[name] || undefined; diff --git a/src/hooks.client.ts b/src/hooks.client.ts index 696e3c5..17795fc 100644 --- a/src/hooks.client.ts +++ b/src/hooks.client.ts @@ -1,8 +1,8 @@ import type { ClientInit } from "@sveltejs/kit/hooks"; -import { cleanupFileCaches } from "#lib/client/cache/index.js"; -import { keyring } from "#lib/client/keys/index.js"; -import { listenForServiceWorkerMessages } from "#lib/client/serviceWorker.js"; -import { cleanupDanglingInfos } from "#lib/client/storage/indexedDB/index.js"; +import { cleanupFileCaches } from "#lib/client/cache/index.ts"; +import { keyring } from "#lib/client/keys/index.ts"; +import { listenForServiceWorkerMessages } from "#lib/client/service-worker.ts"; +import { cleanupDanglingInfos } from "#lib/client/storage/indexed-db/index.ts"; const requestPersistentStorage = async () => { const isPersistent = await navigator.storage.persist(); diff --git a/src/hooks.server.ts b/src/hooks.server.ts index b78bae2..c859d0a 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,9 +1,9 @@ import { sequence, type ServerInit } from "@sveltejs/kit/hooks"; import schedule from "node-schedule"; -import { ClientRepo, SessionRepo } from "#lib/server/db/index.js"; -import { migrateDB } from "#lib/server/db/kysely.js"; -import { authenticate, setAgentInfo } from "#lib/server/middlewares/index.js"; -import { FileDeletionService, UploadService } from "#lib/server/services/index.js"; +import { ClientRepo, SessionRepo } from "#lib/server/db/index.ts"; +import { migrateDB } from "#lib/server/db/kysely.ts"; +import { authenticate, setAgentInfo } from "#lib/server/middlewares/index.ts"; +import { FileDeletionService, UploadService } from "#lib/server/services/index.ts"; export const init: ServerInit = async () => { await migrateDB(); diff --git a/src/lib/client/cache/fileCache.ts b/src/lib/client/cache/file-cache.ts similarity index 98% rename from src/lib/client/cache/fileCache.ts rename to src/lib/client/cache/file-cache.ts index 325ebc5..d15b5dd 100644 --- a/src/lib/client/cache/fileCache.ts +++ b/src/lib/client/cache/file-cache.ts @@ -4,7 +4,7 @@ import { getFileCacheIndexOf, storeFileCacheIndex, updateFileCacheRetrievedAt, -} from "#lib/client/storage/indexedDB/cacheIndex.js"; +} from "#lib/client/storage/indexed-db/cache-index.ts"; import { createWritable, deleteDirectory, @@ -14,8 +14,8 @@ import { listDirectoryNames, listFileNames, moveFile, -} from "#lib/client/storage/opfs.js"; -import { CHUNK_SIZE, getChunkCount } from "#lib/shared/format/index.js"; +} from "#lib/client/storage/opfs.ts"; +import { CHUNK_SIZE, getChunkCount } from "#lib/shared/format/index.ts"; // Caches the plaintext of files in chunks, so that partially loaded files (e.g. videos which were // partially played) can also be cached. Chunk `i` starts at `i * CHUNK_SIZE` of the plaintext, diff --git a/src/lib/client/cache/index.ts b/src/lib/client/cache/index.ts index b55527a..29b8d6e 100644 --- a/src/lib/client/cache/index.ts +++ b/src/lib/client/cache/index.ts @@ -1,2 +1,2 @@ -export * from "./fileCache"; -export * from "./thumbnailCache.svelte"; +export * from "./file-cache.ts"; +export * from "./thumbnail-cache.svelte.ts"; diff --git a/src/lib/client/cache/thumbnailCache.svelte.ts b/src/lib/client/cache/thumbnail-cache.svelte.ts similarity index 98% rename from src/lib/client/cache/thumbnailCache.svelte.ts rename to src/lib/client/cache/thumbnail-cache.svelte.ts index cc45213..6d85b48 100644 --- a/src/lib/client/cache/thumbnailCache.svelte.ts +++ b/src/lib/client/cache/thumbnail-cache.svelte.ts @@ -1,7 +1,7 @@ /* eslint-disable svelte/prefer-svelte-reactivity -- Lookup tables of reactive entries */ import { LRUCache } from "lru-cache"; -import { deleteDirectory, deleteFile, readFile, writeFile } from "#lib/client/storage/opfs.js"; -import { decryptChunk, encodeToBase64 } from "#lib/shared/crypto/index.js"; +import { deleteDirectory, deleteFile, readFile, writeFile } from "#lib/client/storage/opfs.ts"; +import { decryptChunk, encodeToBase64 } from "#lib/shared/crypto/index.ts"; export interface Thumbnail { url?: string; diff --git a/src/lib/client/crypto/hmac.ts b/src/lib/client/crypto/hmac.ts index 6df84ef..00c93b4 100644 --- a/src/lib/client/crypto/hmac.ts +++ b/src/lib/client/crypto/hmac.ts @@ -1,5 +1,5 @@ -import type { ComputeMessage, ResultMessage } from "#workers/hmac.js"; -import HmacWorker from "#workers/hmac.js?worker"; +import type { ComputeMessage, ResultMessage } from "#workers/hmac.ts"; +import HmacWorker from "#workers/hmac.ts?worker"; // Computes HMAC of large blobs incrementally in a worker, which WebCrypto doesn't support export const signMessageHmac = async (message: Blob, hmacSecret: CryptoKey) => { diff --git a/src/lib/client/keys/generation.ts b/src/lib/client/keys/generation.ts index 30f4bf0..b4d88da 100644 --- a/src/lib/client/keys/generation.ts +++ b/src/lib/client/keys/generation.ts @@ -13,9 +13,9 @@ import { makeRSAKeyNonextractable, wrapHmacSecret, wrapMasterKey, -} from "#lib/shared/crypto/index.js"; -import { keyring } from "./keyring.svelte"; -import { deserializeClientKeys } from "./serialization"; +} from "#lib/shared/crypto/index.ts"; +import { keyring } from "./keyring.svelte.ts"; +import { deserializeClientKeys } from "./serialization.ts"; // Generates new client keys and keeps them in the keyring without persisting export const generateClientKeys = async () => { diff --git a/src/lib/client/keys/index.ts b/src/lib/client/keys/index.ts index 7440132..b43e7c2 100644 --- a/src/lib/client/keys/index.ts +++ b/src/lib/client/keys/index.ts @@ -1,5 +1,5 @@ -export * from "./generation"; -export * from "./keyring.svelte"; -export * from "./serialization"; -export * from "./sync"; -export * from "./types"; +export * from "./generation.ts"; +export * from "./keyring.svelte.ts"; +export * from "./serialization.ts"; +export * from "./sync.ts"; +export * from "./types.ts"; diff --git a/src/lib/client/keys/keyring.svelte.ts b/src/lib/client/keys/keyring.svelte.ts index 86f4792..a2e0913 100644 --- a/src/lib/client/keys/keyring.svelte.ts +++ b/src/lib/client/keys/keyring.svelte.ts @@ -5,8 +5,8 @@ import { storeClientKey, storeHmacSecrets, storeMasterKeys, -} from "#lib/client/storage/indexedDB/index.js"; -import type { ClientKeys, HmacSecret, MasterKey } from "./types"; +} from "#lib/client/storage/indexed-db/index.ts"; +import type { ClientKeys, HmacSecret, MasterKey } from "./types.ts"; const findLatestActive = ( entries: ReadonlyMap, diff --git a/src/lib/client/keys/sync.ts b/src/lib/client/keys/sync.ts index c16c14c..3bfad92 100644 --- a/src/lib/client/keys/sync.ts +++ b/src/lib/client/keys/sync.ts @@ -7,10 +7,10 @@ import { unwrapHmacSecret, unwrapMasterKey, verifyMasterKeyWrapped, -} from "#lib/shared/crypto/index.js"; -import { isTRPCClientError, trpc } from "#trpc/client.js"; -import { keyring } from "./keyring.svelte"; -import type { ClientKeys } from "./types"; +} from "#lib/shared/crypto/index.ts"; +import { isTRPCClientError, trpc } from "#trpc/client.ts"; +import { keyring } from "./keyring.svelte.ts"; +import type { ClientKeys } from "./types.ts"; // Synchronizes keys with the server diff --git a/src/lib/client/serviceWorker.ts b/src/lib/client/service-worker.ts similarity index 97% rename from src/lib/client/serviceWorker.ts rename to src/lib/client/service-worker.ts index 1343358..c3063ee 100644 --- a/src/lib/client/serviceWorker.ts +++ b/src/lib/client/service-worker.ts @@ -1,10 +1,10 @@ -import { handleDownloadProgress } from "#lib/client/transfer/download.svelte.js"; +import { handleDownloadProgress } from "#lib/client/transfer/download.svelte.ts"; import { DECRYPTED_FILE_URL_PREFIX, type FileMetadata, type ServiceWorkerMessage, type ServiceWorkerResponse, -} from "#lib/shared/serviceWorker.js"; +} from "#lib/shared/service-worker.ts"; const PREPARE_TIMEOUT_MS = 5000; diff --git a/src/lib/client/storage/indexedDB/cacheIndex.ts b/src/lib/client/storage/indexed-db/cache-index.ts similarity index 100% rename from src/lib/client/storage/indexedDB/cacheIndex.ts rename to src/lib/client/storage/indexed-db/cache-index.ts diff --git a/src/lib/client/storage/indexedDB/filesystem.ts b/src/lib/client/storage/indexed-db/filesystem.ts similarity index 100% rename from src/lib/client/storage/indexedDB/filesystem.ts rename to src/lib/client/storage/indexed-db/filesystem.ts diff --git a/src/lib/client/storage/indexed-db/index.ts b/src/lib/client/storage/indexed-db/index.ts new file mode 100644 index 0000000..90e02dc --- /dev/null +++ b/src/lib/client/storage/indexed-db/index.ts @@ -0,0 +1,3 @@ +export * from "./cache-index.ts"; +export * from "./filesystem.ts"; +export * from "./key-store.ts"; diff --git a/src/lib/client/storage/indexedDB/keyStore.ts b/src/lib/client/storage/indexed-db/key-store.ts similarity index 100% rename from src/lib/client/storage/indexedDB/keyStore.ts rename to src/lib/client/storage/indexed-db/key-store.ts diff --git a/src/lib/client/storage/indexedDB/index.ts b/src/lib/client/storage/indexedDB/index.ts deleted file mode 100644 index 4ca1202..0000000 --- a/src/lib/client/storage/indexedDB/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./cacheIndex"; -export * from "./filesystem"; -export * from "./keyStore"; diff --git a/src/lib/client/transfer/chunkedUpload.ts b/src/lib/client/transfer/chunked-upload.ts similarity index 95% rename from src/lib/client/transfer/chunkedUpload.ts rename to src/lib/client/transfer/chunked-upload.ts index a641ece..be08e46 100644 --- a/src/lib/client/transfer/chunkedUpload.ts +++ b/src/lib/client/transfer/chunked-upload.ts @@ -1,10 +1,10 @@ import { sha256 } from "@noble/hashes/sha2.js"; import axios from "axios"; import pLimit from "p-limit"; -import { encodeToBase64, encryptChunk } from "#lib/shared/crypto/index.js"; -import { CHUNK_SIZE, getChunkCount, getEncryptedSize } from "#lib/shared/format/index.js"; -import { BoundedQueue } from "#lib/utils/concurrency/index.js"; -import { createSpeedMeter } from "#lib/utils/speedMeter.js"; +import { encodeToBase64, encryptChunk } from "#lib/shared/crypto/index.ts"; +import { CHUNK_SIZE, getChunkCount, getEncryptedSize } from "#lib/shared/format/index.ts"; +import { BoundedQueue } from "#lib/utils/concurrency/index.ts"; +import { createSpeedMeter } from "#lib/utils/speed-meter.ts"; interface UploadStats { progress: number; diff --git a/src/lib/client/transfer/download.svelte.ts b/src/lib/client/transfer/download.svelte.ts index ea163ff..f8ecd27 100644 --- a/src/lib/client/transfer/download.svelte.ts +++ b/src/lib/client/transfer/download.svelte.ts @@ -1,5 +1,5 @@ -import type { DownloadProgressMessage } from "#lib/shared/serviceWorker.js"; -import { createSpeedMeter } from "#lib/utils/speedMeter.js"; +import type { DownloadProgressMessage } from "#lib/shared/service-worker.ts"; +import { createSpeedMeter } from "#lib/utils/speed-meter.ts"; // Files are downloaded and decrypted by the service worker, which reports the progress diff --git a/src/lib/client/transfer/index.ts b/src/lib/client/transfer/index.ts index a862c01..372a76e 100644 --- a/src/lib/client/transfer/index.ts +++ b/src/lib/client/transfer/index.ts @@ -1,2 +1,2 @@ -export * from "./download.svelte"; -export * from "./upload.svelte"; +export * from "./download.svelte.ts"; +export * from "./upload.svelte.ts"; diff --git a/src/lib/client/transfer/upload.svelte.ts b/src/lib/client/transfer/upload.svelte.ts index ee79101..4d51983 100644 --- a/src/lib/client/transfer/upload.svelte.ts +++ b/src/lib/client/transfer/upload.svelte.ts @@ -1,24 +1,24 @@ import { limitFunction } from "p-limit"; -import { signMessageHmac } from "#lib/client/crypto/hmac.js"; +import { createUploadFileCache } from "#lib/client/cache/index.ts"; +import { signMessageHmac } from "#lib/client/crypto/hmac.ts"; import { ensureHmacSecrets, keyring, type HmacSecret, type MasterKey, -} from "#lib/client/keys/index.js"; -import { createUploadFileCache } from "#lib/client/cache/index.js"; -import { readExifDateTime } from "#lib/client/media/exif.js"; -import { generateThumbnail } from "#lib/client/media/thumbnail.js"; -import { uploadBlob } from "#lib/client/transfer/chunkedUpload.js"; +} from "#lib/client/keys/index.ts"; +import { readExifDateTime } from "#lib/client/media/exif.ts"; +import { generateThumbnail } from "#lib/client/media/thumbnail.ts"; +import { uploadBlob } from "#lib/client/transfer/chunked-upload.ts"; import { encodeToBase64, generateDataKey, wrapDataKey, encryptString, -} from "#lib/shared/crypto/index.js"; -import { getChunkCount } from "#lib/shared/format/index.js"; -import { Scheduler } from "#lib/utils/index.js"; -import { trpc } from "#trpc/client.js"; +} from "#lib/shared/crypto/index.ts"; +import { getChunkCount } from "#lib/shared/format/index.ts"; +import { Scheduler } from "#lib/utils/index.ts"; +import { trpc } from "#trpc/client.ts"; export interface FileUploadState { id: string; diff --git a/src/lib/features/auth/components/ForceLoginModal.svelte b/src/lib/features/auth/components/ForceLoginModal.svelte index 259e9b0..91830c5 100644 --- a/src/lib/features/auth/components/ForceLoginModal.svelte +++ b/src/lib/features/auth/components/ForceLoginModal.svelte @@ -1,5 +1,5 @@
diff --git a/src/lib/ui/overlays/overlayGroup.svelte.ts b/src/lib/ui/overlays/overlay-group.svelte.ts similarity index 100% rename from src/lib/ui/overlays/overlayGroup.svelte.ts rename to src/lib/ui/overlays/overlay-group.svelte.ts diff --git a/src/lib/utils/concurrency/BoundedQueue.ts b/src/lib/utils/concurrency/bounded-queue.ts similarity index 100% rename from src/lib/utils/concurrency/BoundedQueue.ts rename to src/lib/utils/concurrency/bounded-queue.ts diff --git a/src/lib/utils/concurrency/index.ts b/src/lib/utils/concurrency/index.ts index 31b055c..916b6f9 100644 --- a/src/lib/utils/concurrency/index.ts +++ b/src/lib/utils/concurrency/index.ts @@ -1,2 +1,2 @@ -export * from "./BoundedQueue"; -export * from "./Scheduler"; +export * from "./bounded-queue.ts"; +export * from "./scheduler.ts"; diff --git a/src/lib/utils/concurrency/Scheduler.ts b/src/lib/utils/concurrency/scheduler.ts similarity index 100% rename from src/lib/utils/concurrency/Scheduler.ts rename to src/lib/utils/concurrency/scheduler.ts diff --git a/src/lib/utils/gotoStateful.ts b/src/lib/utils/goto-stateful.ts similarity index 100% rename from src/lib/utils/gotoStateful.ts rename to src/lib/utils/goto-stateful.ts diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index e830fde..fe034c2 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -1,6 +1,6 @@ -export * from "./concurrency"; -export * from "./format"; -export * from "./gotoStateful"; -export * from "./search"; -export * from "./sort"; -export * from "./speedMeter"; +export * from "./concurrency/index.ts"; +export * from "./format.ts"; +export * from "./goto-stateful.ts"; +export * from "./search.ts"; +export * from "./sort.ts"; +export * from "./speed-meter.ts"; diff --git a/src/lib/utils/speedMeter.ts b/src/lib/utils/speed-meter.ts similarity index 100% rename from src/lib/utils/speedMeter.ts rename to src/lib/utils/speed-meter.ts diff --git a/src/routes/(fullscreen)/+layout.svelte b/src/routes/(fullscreen)/+layout.svelte index 13711d7..aa85319 100644 --- a/src/routes/(fullscreen)/+layout.svelte +++ b/src/routes/(fullscreen)/+layout.svelte @@ -1,5 +1,5 @@ diff --git a/src/routes/(fullscreen)/auth/changePassword/+page.svelte b/src/routes/(fullscreen)/auth/change-password/+page.svelte similarity index 93% rename from src/routes/(fullscreen)/auth/changePassword/+page.svelte rename to src/routes/(fullscreen)/auth/change-password/+page.svelte index be11553..9f5ee29 100644 --- a/src/routes/(fullscreen)/auth/changePassword/+page.svelte +++ b/src/routes/(fullscreen)/auth/change-password/+page.svelte @@ -1,7 +1,7 @@