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:
@@ -1,4 +1,4 @@
|
||||
// Encrypted attachment upload / download.
|
||||
// Encrypted attachment upload / download.
|
||||
//
|
||||
// Per-message symmetric key + nonce encrypts the raw blob (XSalsa20-Poly1305
|
||||
// via secretbox). The encrypted blob is uploaded to Supabase Storage under
|
||||
@@ -6,8 +6,8 @@
|
||||
// travel inside the per-device message envelope as JSON, so the server never
|
||||
// sees the decryption material.
|
||||
|
||||
import { fromBase64, getCryptoBackend, toBase64 } from '../crypto/index.js';
|
||||
import type { AppSupabaseClient } from '../supabase/client.js';
|
||||
import { fromBase64, getCryptoBackend, toBase64 } from '../crypto/index';
|
||||
import type { AppSupabaseClient } from '../supabase/client';
|
||||
|
||||
export const ATTACHMENT_BUCKET = 'chat-attachments';
|
||||
export const MAX_ATTACHMENT_BYTES = 10 * 1024 * 1024; // 10 MB
|
||||
@@ -22,7 +22,7 @@ export interface AttachmentHandle {
|
||||
sizeBytes: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
// base64-encoded — only readable via per-device envelope decrypt.
|
||||
// base64-encoded — only readable via per-device envelope decrypt.
|
||||
keyB64: string;
|
||||
nonceB64: string;
|
||||
}
|
||||
@@ -166,11 +166,11 @@ function ensureUuid(): string {
|
||||
|
||||
export interface EncryptedAttachmentResult {
|
||||
handle: AttachmentHandle;
|
||||
key: Uint8Array; // raw bytes — caller is responsible for wiping
|
||||
key: Uint8Array; // raw bytes — caller is responsible for wiping
|
||||
nonce: Uint8Array;
|
||||
}
|
||||
|
||||
// Encrypt + upload a blob. Does NOT insert the message_attachments row —
|
||||
// Encrypt + upload a blob. Does NOT insert the message_attachments row —
|
||||
// the caller combines this with a message insert so everything commits
|
||||
// atomically at the application layer.
|
||||
export async function encryptAndUploadAttachment(params: {
|
||||
|
||||
Reference in New Issue
Block a user