fix(shared): drop .js extensions from relative imports for Metro

packages/shared/src/index.ts and all sub-modules used .js extensions on
relative imports (e.g. './admin/index.js') pointing at .ts source files.
TypeScript with moduleResolution: "Bundler" doesn't need them, and
Metro's eager exporter (used for preview / production builds) reads
them literally and fails — only the dev-server Metro fell back to .ts.

Workspace typecheck remains 8/8 green; Vite and TS Bundler resolution
already accept both styles, so desktop is unaffected.
This commit is contained in:
byGalax
2026-05-15 01:52:14 +02:00
parent b0967dd2c5
commit b61f929cf7
25 changed files with 108 additions and 108 deletions
+7 -7
View File
@@ -1,14 +1,14 @@
import { bytesToUtf8, utf8ToBytes } from '../crypto/index.js';
import { bytesToPgHex, pgHexToBytes } from '../supabase/bytea.js';
import type { AppSupabaseClient } from '../supabase/client.js';
import { bytesToUtf8, utf8ToBytes } from '../crypto/index';
import { bytesToPgHex, pgHexToBytes } from '../supabase/bytea';
import type { AppSupabaseClient } from '../supabase/client';
import {
decryptWithConvKey,
encryptWithConvKey,
getOrCreateConvKey,
type OwnDeviceCtx,
tryGetConvKey,
} from './convKeys.js';
import type { ChatMessage, DecryptedMessage } from './types.js';
} from './convKeys';
import type { ChatMessage, DecryptedMessage } from './types';
const MESSAGE_COLS =
'id, conversation_id, sender_id, sender_device_id, reply_to_id, edited_at, deleted_at, created_at, ciphertext, nonce, key_version';
@@ -92,7 +92,7 @@ export interface SendMessageParams {
senderDeviceId: string;
senderPrivateKey: Uint8Array;
replyToId?: string;
// Optional encrypted attachments their handles are already materialised
// Optional encrypted attachments — their handles are already materialised
// via `encryptAndUploadAttachment`. The caller is responsible for creating
// the corresponding message_attachments rows (see insertAttachmentRow) once
// the returned message id is known.
@@ -246,7 +246,7 @@ export async function listPeerReadsForMessages(
}
// Group variant: returns reads from ALL users (other than `excludeUserId`,
// typically caller themselves) keyed by message id user id timestamp.
// typically caller themselves) keyed by message id → user id → timestamp.
// RLS already filters out users whose receipts are off.
export async function listGroupReadsForMessages(
client: AppSupabaseClient,