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,5 +1,5 @@
|
||||
import type { AppSupabaseClient } from '../supabase/client.js';
|
||||
import type { MemberRole } from '../supabase/types.js';
|
||||
import type { AppSupabaseClient } from '../supabase/client';
|
||||
import type { MemberRole } from '../supabase/types';
|
||||
|
||||
async function currentUserId(client: AppSupabaseClient): Promise<string> {
|
||||
const { data, error } = await client.auth.getUser();
|
||||
@@ -14,7 +14,7 @@ export interface CreateGroupParams {
|
||||
memberUserIds: string[];
|
||||
}
|
||||
|
||||
// Client-side 3-step create: conversation → self as admin → peers as members.
|
||||
// Client-side 3-step create: conversation → self as admin → peers as members.
|
||||
// On any peer-insert failure the conversation still survives (partial group is
|
||||
// still usable, admin can retry). On self-insert failure we delete the empty
|
||||
// conversation to avoid orphans.
|
||||
@@ -24,7 +24,7 @@ export async function createGroup(params: CreateGroupParams): Promise<string> {
|
||||
if (trimmed.length === 0) throw new Error('group name required');
|
||||
|
||||
// Generate the uuid client-side so we don't need a post-insert SELECT on
|
||||
// conversations — the SELECT policy requires membership, which only exists
|
||||
// conversations — the SELECT policy requires membership, which only exists
|
||||
// AFTER we insert the creator's member row in step 2.
|
||||
const conversationId = crypto.randomUUID();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user