# Description of Changes When I added Prettier formatting in #6052, my aim was to use just the default settings in Prettier. Turns out, Prettier looks _really hard_ for any config files if it's not explicitly given one, which means that if a developer has some sort of Prettier config file lying around on their system, Prettier might find it and use it. Also, Prettier changes its defaults based on stuff in `.editorconfig` without any good way of disabling that behaviour explicitly in its config file. To solve both of these issues, I've introduced a `.prettierrc` file which sets Prettier's defaults explicitly, and then reformatted all our code _again_ in Prettier's actual default settings. This should achieve the aim of #6052 and remove the possibility for it breaking on different dev computers.
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { createClient } from "@supabase/supabase-js";
|
|
import { STIRLING_SAAS_URL, SUPABASE_KEY } from "@app/constants/connection";
|
|
|
|
/**
|
|
* Supabase client for desktop application
|
|
* Used to call Supabase edge functions for billing and other SaaS features
|
|
*
|
|
* Note: Desktop uses authService for authentication (JWT stored in Tauri secure store),
|
|
* but this client is needed for calling Supabase edge functions like get-usage-billing
|
|
*/
|
|
|
|
if (!STIRLING_SAAS_URL) {
|
|
console.warn(
|
|
"[Desktop Supabase] VITE_SAAS_SERVER_URL not configured - SaaS features will not work",
|
|
);
|
|
}
|
|
|
|
if (!SUPABASE_KEY) {
|
|
console.warn(
|
|
"[Desktop Supabase] VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY not configured - SaaS features will not work",
|
|
);
|
|
}
|
|
|
|
export const supabase = createClient(
|
|
STIRLING_SAAS_URL || "",
|
|
SUPABASE_KEY || "",
|
|
{
|
|
auth: {
|
|
persistSession: false, // Desktop manages auth via authService + Tauri secure store
|
|
autoRefreshToken: false, // Desktop manually refreshes tokens via authService
|
|
detectSessionInUrl: false, // Desktop uses deep links, not URL hash fragments
|
|
},
|
|
},
|
|
);
|