Refactor key access and role warning in Supabase clients
The update simplifies accessing environment keys and role warnings in Supabase clients by moving them to new functions 'getSupabaseClientKeys' and 'getServiceRoleKey'. The redundancy in the code is reduced promoting clearer and more maintainable code. The '@epic-web/invariant' import has been removed from files as it is no longer needed.
This commit is contained in:
@@ -18,9 +18,7 @@ interface SessionPageProps {
|
||||
|
||||
const LazyEmbeddedCheckout = dynamic(
|
||||
async () => {
|
||||
const { EmbeddedCheckout } = await import(
|
||||
'@kit/billing-gateway/components'
|
||||
);
|
||||
const { EmbeddedCheckout } = await import('@kit/billing-gateway/checkout');
|
||||
|
||||
return EmbeddedCheckout;
|
||||
},
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { invariant } from '@epic-web/invariant';
|
||||
import { getServerSideSitemap } from 'next-sitemap';
|
||||
|
||||
import { createCmsClient } from '@kit/cms';
|
||||
|
||||
import appConfig from '~/config/app.config';
|
||||
|
||||
invariant(appConfig.url, 'No NEXT_PUBLIC_SITE_URL environment variable found');
|
||||
|
||||
export async function GET() {
|
||||
const urls = getSiteUrls();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
export async function i18nResolver(language: string, namespace: string) {
|
||||
const data = await import(
|
||||
`../../public/locales/${language}/${namespace}.json`,
|
||||
);
|
||||
`../../public/locales/${language}/${namespace}.json`
|
||||
);
|
||||
|
||||
return data as Record<string, string>;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
"supabase:typegen:app": "supabase gen types typescript --local > ./lib/database.types.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@epic-web/invariant": "^1.0.0",
|
||||
"@hookform/resolvers": "^3.3.4",
|
||||
"@kit/accounts": "workspace:^",
|
||||
"@kit/admin": "workspace:^",
|
||||
|
||||
Reference in New Issue
Block a user