diff --git a/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/personal-account-billing-page.loader.ts b/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/personal-account-billing-page.loader.ts index 5604544a5..d8d7187b8 100644 --- a/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/personal-account-billing-page.loader.ts +++ b/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/personal-account-billing-page.loader.ts @@ -1,7 +1,7 @@ -import { cache } from 'react'; - import 'server-only'; +import { cache } from 'react'; + import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client'; export const loadPersonalAccountBillingPageData = cache((userId: string) => { diff --git a/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/user-billing.service.ts b/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/user-billing.service.ts index df1863870..ce5360e88 100644 --- a/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/user-billing.service.ts +++ b/apps/web/app/(dashboard)/home/(user)/billing/_lib/server/user-billing.service.ts @@ -1,6 +1,7 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { getProductPlanPair } from '@kit/billing'; diff --git a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-billing-page.loader.ts b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-billing-page.loader.ts index 850d7fe8a..98b1b9319 100644 --- a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-billing-page.loader.ts +++ b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-billing-page.loader.ts @@ -1,7 +1,7 @@ -import { cache } from 'react'; - import 'server-only'; +import { cache } from 'react'; + import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client'; export const loadTeamAccountBillingPage = cache((accountId: string) => { diff --git a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-workspace.loader.ts b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-workspace.loader.ts index 8d798a766..142b26642 100644 --- a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-workspace.loader.ts +++ b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-account-workspace.loader.ts @@ -1,9 +1,9 @@ +import 'server-only'; + import { cache } from 'react'; import { redirect } from 'next/navigation'; -import 'server-only'; - import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client'; import pathsConfig from '~/config/paths.config'; diff --git a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-billing.service.ts b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-billing.service.ts index 2f950c805..e4afa8b6c 100644 --- a/apps/web/app/(dashboard)/home/[account]/_lib/server/team-billing.service.ts +++ b/apps/web/app/(dashboard)/home/[account]/_lib/server/team-billing.service.ts @@ -1,6 +1,7 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { LineItemSchema } from '@kit/billing'; diff --git a/apps/web/app/(marketing)/docs/[...slug]/page.tsx b/apps/web/app/(marketing)/docs/[...slug]/page.tsx index 48b74bb0d..a8e038005 100644 --- a/apps/web/app/(marketing)/docs/[...slug]/page.tsx +++ b/apps/web/app/(marketing)/docs/[...slug]/page.tsx @@ -5,11 +5,11 @@ import { notFound } from 'next/navigation'; import { ContentRenderer, createCmsClient } from '@kit/cms'; import { If } from '@kit/ui/if'; -import { SitePageHeader } from '~/(marketing)/_components/site-page-header'; -import { DocsCards } from '~/(marketing)/docs/_components/docs-cards'; import { withI18n } from '~/lib/i18n/with-i18n'; +import { SitePageHeader } from '../../_components/site-page-header'; import styles from '../../blog/_components/html-renderer.module.css'; +import { DocsCards } from '../_components/docs-cards'; const getPageBySlug = cache(async (slug: string) => { const client = await createCmsClient(); @@ -48,18 +48,10 @@ async function DocumentationPage({ params }: PageParams) { const description = page?.description ?? ''; return ( -
- +
+ -
+
diff --git a/apps/web/app/admin/accounts/page.tsx b/apps/web/app/admin/accounts/page.tsx index a59403f6d..cd4fc4c72 100644 --- a/apps/web/app/admin/accounts/page.tsx +++ b/apps/web/app/admin/accounts/page.tsx @@ -57,12 +57,13 @@ function AccountsPage({ searchParams }: { searchParams: SearchParams }) { } function getFilters(params: SearchParams) { - const filters: { - [key: string]: { + const filters: Record< + string, + { eq?: boolean | string; like?: string; - }; - } = {}; + } + > = {}; if (params.account_type && params.account_type !== 'all') { filters.is_personal_account = { diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index a3fd25477..07a97b997 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -18,7 +18,7 @@ const INTERNAL_PACKAGES = [ '@kit/database-webhooks', '@kit/cms', '@kit/monitoring', - '@kit/next' + '@kit/next', ]; /** @type {import('next').NextConfig} */ diff --git a/apps/web/package.json b/apps/web/package.json index fd846d5b9..487ebcc44 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -34,8 +34,8 @@ "@kit/supabase": "workspace:^", "@kit/team-accounts": "workspace:^", "@kit/ui": "workspace:^", - "@makerkit/data-loader-supabase-core": "0.0.5", - "@makerkit/data-loader-supabase-nextjs": "^0.0.7", + "@makerkit/data-loader-supabase-core": "^0.0.7", + "@makerkit/data-loader-supabase-nextjs": "^0.0.9", "@marsidev/react-turnstile": "^0.5.4", "@radix-ui/react-icons": "^1.3.0", "@supabase/ssr": "^0.1.0", diff --git a/packages/billing/gateway/src/components/plan-picker.tsx b/packages/billing/gateway/src/components/plan-picker.tsx index 3c3c8a7f3..56875aae7 100644 --- a/packages/billing/gateway/src/components/plan-picker.tsx +++ b/packages/billing/gateway/src/components/plan-picker.tsx @@ -15,7 +15,6 @@ import { getPrimaryLineItem, getProductPlanPair, } from '@kit/billing'; -import config from '@kit/prettier-config/index.mjs'; import { formatCurrency } from '@kit/shared/utils'; import { Badge } from '@kit/ui/badge'; import { Button } from '@kit/ui/button'; diff --git a/packages/billing/gateway/src/server/services/billing-event-handler/billing-event-handler.service.ts b/packages/billing/gateway/src/server/services/billing-event-handler/billing-event-handler.service.ts index e30c07858..7919064bd 100644 --- a/packages/billing/gateway/src/server/services/billing-event-handler/billing-event-handler.service.ts +++ b/packages/billing/gateway/src/server/services/billing-event-handler/billing-event-handler.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { BillingWebhookHandlerService } from '@kit/billing'; diff --git a/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-factory.service.ts b/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-factory.service.ts index 16b919034..869ae66fd 100644 --- a/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-factory.service.ts +++ b/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-factory.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { z } from 'zod'; import { diff --git a/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-provider-factory.ts b/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-provider-factory.ts index e8244738d..193dc74f0 100644 --- a/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-provider-factory.ts +++ b/packages/billing/gateway/src/server/services/billing-event-handler/billing-gateway-provider-factory.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { BillingConfig } from '@kit/billing'; import { Database } from '@kit/supabase/database'; import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client'; diff --git a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-factory.service.ts b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-factory.service.ts index 1c4c5d2cc..84c03baba 100644 --- a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-factory.service.ts +++ b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-factory.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { z } from 'zod'; import { diff --git a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-provider-factory.ts b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-provider-factory.ts index 125697edd..ff3708132 100644 --- a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-provider-factory.ts +++ b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway-provider-factory.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client'; import { BillingGatewayService } from './billing-gateway.service'; diff --git a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway.service.ts b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway.service.ts index 2d349e9e8..84ac7e060 100644 --- a/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway.service.ts +++ b/packages/billing/gateway/src/server/services/billing-gateway/billing-gateway.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { z } from 'zod'; import { BillingProviderSchema } from '@kit/billing'; diff --git a/packages/billing/gateway/src/server/services/billing-webhooks/billing-webhooks.service.ts b/packages/billing/gateway/src/server/services/billing-webhooks/billing-webhooks.service.ts index 976ff5c92..76cadf49e 100644 --- a/packages/billing/gateway/src/server/services/billing-webhooks/billing-webhooks.service.ts +++ b/packages/billing/gateway/src/server/services/billing-webhooks/billing-webhooks.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { Database } from '@kit/supabase/database'; import { BillingGatewayService } from '../billing-gateway/billing-gateway.service'; diff --git a/packages/billing/lemon-squeezy/src/services/lemon-squeezy-billing-strategy.service.ts b/packages/billing/lemon-squeezy/src/services/lemon-squeezy-billing-strategy.service.ts index 019f840f5..224e1a731 100644 --- a/packages/billing/lemon-squeezy/src/services/lemon-squeezy-billing-strategy.service.ts +++ b/packages/billing/lemon-squeezy/src/services/lemon-squeezy-billing-strategy.service.ts @@ -1,10 +1,11 @@ +import 'server-only'; + import { cancelSubscription, createUsageRecord, getCheckout, updateSubscriptionItem, } from '@lemonsqueezy/lemonsqueezy.js'; -import 'server-only'; import { z } from 'zod'; import { BillingStrategyProviderService } from '@kit/billing'; diff --git a/packages/billing/stripe/src/services/stripe-billing-strategy.service.ts b/packages/billing/stripe/src/services/stripe-billing-strategy.service.ts index 264571706..682eb4c74 100644 --- a/packages/billing/stripe/src/services/stripe-billing-strategy.service.ts +++ b/packages/billing/stripe/src/services/stripe-billing-strategy.service.ts @@ -1,4 +1,5 @@ import 'server-only'; + import type { Stripe } from 'stripe'; import { z } from 'zod'; diff --git a/packages/features/accounts/src/server/services/delete-personal-account.service.ts b/packages/features/accounts/src/server/services/delete-personal-account.service.ts index c14fc53e5..fabb11e13 100644 --- a/packages/features/accounts/src/server/services/delete-personal-account.service.ts +++ b/packages/features/accounts/src/server/services/delete-personal-account.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { getLogger } from '@kit/shared/logger'; @@ -35,11 +37,9 @@ export class DeletePersonalAccountService { }) { const userId = params.userId; const logger = await getLogger(); + const ctx = { userId, name: this.namespace }; - logger.info( - { name: this.namespace, userId }, - 'User requested deletion. Processing...', - ); + logger.info(ctx, 'User requested deletion. Processing...'); // execute the deletion of the user try { @@ -47,8 +47,7 @@ export class DeletePersonalAccountService { } catch (error) { logger.error( { - name: this.namespace, - userId, + ...ctx, error, }, 'Error deleting user', @@ -57,6 +56,6 @@ export class DeletePersonalAccountService { throw new Error('Error deleting user'); } - logger.info({ name: this.namespace, userId }, 'User deleted successfully'); + logger.info(ctx, 'User deleted successfully'); } } diff --git a/packages/features/admin/package.json b/packages/features/admin/package.json index 57194265c..5b8b0b6be 100644 --- a/packages/features/admin/package.json +++ b/packages/features/admin/package.json @@ -14,8 +14,8 @@ "@kit/next": "workspace:*", "@kit/supabase": "workspace:*", "@kit/ui": "workspace:*", - "@makerkit/data-loader-supabase-core": "0.0.5", - "@makerkit/data-loader-supabase-nextjs": "^0.0.7", + "@makerkit/data-loader-supabase-core": "^0.0.7", + "@makerkit/data-loader-supabase-nextjs": "^0.0.9", "lucide-react": "^0.363.0", "react-hook-form": "^7.51.2", "zod": "^3.22.4" @@ -29,8 +29,8 @@ "@kit/tailwind-config": "workspace:*", "@kit/tsconfig": "workspace:*", "@kit/ui": "workspace:^", - "@makerkit/data-loader-supabase-core": "0.0.5", - "@makerkit/data-loader-supabase-nextjs": "^0.0.7", + "@makerkit/data-loader-supabase-core": "^0.0.7", + "@makerkit/data-loader-supabase-nextjs": "^0.0.9", "@supabase/supabase-js": "^2.42.0", "lucide-react": "^0.363.0", "react-hook-form": "^7.51.2", diff --git a/packages/features/admin/src/components/admin-account-page.tsx b/packages/features/admin/src/components/admin-account-page.tsx index 73faf614d..2f8ae17fc 100644 --- a/packages/features/admin/src/components/admin-account-page.tsx +++ b/packages/features/admin/src/components/admin-account-page.tsx @@ -1,4 +1,4 @@ -import { BadgeX, Ban, ShieldPlus, Trash, VenetianMask } from 'lucide-react'; +import { BadgeX, Ban, ShieldPlus, VenetianMask } from 'lucide-react'; import { Database } from '@kit/supabase/database'; import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client'; diff --git a/packages/features/admin/src/lib/server/enhance-admin-action.ts b/packages/features/admin/src/lib/server/enhance-admin-action.ts index 56c733b24..3c4b59c5f 100644 --- a/packages/features/admin/src/lib/server/enhance-admin-action.ts +++ b/packages/features/admin/src/lib/server/enhance-admin-action.ts @@ -4,6 +4,11 @@ import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-clie import { isSuperAdmin } from './is-super-admin'; +/** + * @name enhanceAdminAction + * @description Wrap a server action to ensure the user is a super admin. + * @param fn + */ export function enhanceAdminAction( fn: (params: Args) => Response, ) { diff --git a/packages/features/admin/src/lib/server/is-super-admin.ts b/packages/features/admin/src/lib/server/is-super-admin.ts index f6f610561..1b0deaec1 100644 --- a/packages/features/admin/src/lib/server/is-super-admin.ts +++ b/packages/features/admin/src/lib/server/is-super-admin.ts @@ -2,6 +2,11 @@ import { SupabaseClient } from '@supabase/supabase-js'; import { Database } from '@kit/supabase/database'; +/** + * @name isSuperAdmin + * @description Check if the current user is a super admin. + * @param client + */ export async function isSuperAdmin(client: SupabaseClient) { const { data, error } = await client.auth.getUser(); diff --git a/packages/features/admin/src/lib/server/loaders/admin-dashboard.loader.ts b/packages/features/admin/src/lib/server/loaders/admin-dashboard.loader.ts index 30634d3b7..5bb7fa277 100644 --- a/packages/features/admin/src/lib/server/loaders/admin-dashboard.loader.ts +++ b/packages/features/admin/src/lib/server/loaders/admin-dashboard.loader.ts @@ -1,5 +1,12 @@ +import 'server-only'; + import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client'; +/** + * @name loadAdminDashboard + * @description Load the admin dashboard data. + * @param params + */ export async function loadAdminDashboard(params?: { count: 'exact' | 'estimated' | 'planned'; }) { diff --git a/packages/features/admin/src/lib/server/services/admin-accounts.service.ts b/packages/features/admin/src/lib/server/services/admin-accounts.service.ts index 1746aab4d..9dc8ab6aa 100644 --- a/packages/features/admin/src/lib/server/services/admin-accounts.service.ts +++ b/packages/features/admin/src/lib/server/services/admin-accounts.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { Database } from '@kit/supabase/database'; diff --git a/packages/features/admin/src/lib/server/services/admin-auth-user.service.ts b/packages/features/admin/src/lib/server/services/admin-auth-user.service.ts index f441e07e2..b07df03bf 100644 --- a/packages/features/admin/src/lib/server/services/admin-auth-user.service.ts +++ b/packages/features/admin/src/lib/server/services/admin-auth-user.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { Database } from '@kit/supabase/database'; diff --git a/packages/features/auth/src/components/password-sign-up-container.tsx b/packages/features/auth/src/components/password-sign-up-container.tsx index c5286692f..1168ec117 100644 --- a/packages/features/auth/src/components/password-sign-up-container.tsx +++ b/packages/features/auth/src/components/password-sign-up-container.tsx @@ -50,7 +50,7 @@ export function EmailPasswordSignUpContainer({ console.error(error); } }, - [emailRedirectTo, loading, onSignUp, signUpMutation], + [captchaToken, emailRedirectTo, loading, onSignUp, signUpMutation], ); return ( diff --git a/packages/features/team-accounts/src/server/services/account-invitations.service.ts b/packages/features/team-accounts/src/server/services/account-invitations.service.ts index 618699200..62f9c6cc8 100644 --- a/packages/features/team-accounts/src/server/services/account-invitations.service.ts +++ b/packages/features/team-accounts/src/server/services/account-invitations.service.ts @@ -1,7 +1,8 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { addDays, formatISO } from 'date-fns'; -import 'server-only'; import { z } from 'zod'; import { getLogger } from '@kit/shared/logger'; diff --git a/packages/features/team-accounts/src/server/services/account-members.service.ts b/packages/features/team-accounts/src/server/services/account-members.service.ts index 5f7e895eb..a4655d998 100644 --- a/packages/features/team-accounts/src/server/services/account-members.service.ts +++ b/packages/features/team-accounts/src/server/services/account-members.service.ts @@ -1,6 +1,7 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { getLogger } from '@kit/shared/logger'; diff --git a/packages/features/team-accounts/src/server/services/account-per-seat-billing.service.ts b/packages/features/team-accounts/src/server/services/account-per-seat-billing.service.ts index d1ba73b08..46d06bacd 100644 --- a/packages/features/team-accounts/src/server/services/account-per-seat-billing.service.ts +++ b/packages/features/team-accounts/src/server/services/account-per-seat-billing.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { BillingGatewayService } from '@kit/billing-gateway'; @@ -11,12 +13,10 @@ export class AccountPerSeatBillingService { async getPerSeatSubscriptionItem(accountId: string) { const logger = await getLogger(); + const ctx = { accountId, name: this.namespace }; logger.info( - { - name: this.namespace, - accountId, - }, + ctx, `Getting per-seat subscription item for account ${accountId}...`, ); @@ -40,8 +40,7 @@ export class AccountPerSeatBillingService { if (error) { logger.error( { - name: this.namespace, - accountId, + ...ctx, error, }, `Failed to get per-seat subscription item for account ${accountId}`, @@ -52,7 +51,7 @@ export class AccountPerSeatBillingService { if (!data?.subscription_items) { logger.info( - { name: this.namespace, accountId }, + ctx, `No per-seat subscription item found for account ${accountId}. Exiting...`, ); @@ -60,10 +59,7 @@ export class AccountPerSeatBillingService { } logger.info( - { - name: this.namespace, - accountId, - }, + ctx, `Per-seat subscription item found for account ${accountId}. Will update...`, ); @@ -88,14 +84,13 @@ export class AccountPerSeatBillingService { const billingGateway = new BillingGatewayService(subscription.provider); - logger.info( - { - name: this.namespace, - accountId, - subscriptionItems, - }, - `Increasing seats for account ${accountId}...`, - ); + const ctx = { + name: this.namespace, + accountId, + subscriptionItems, + }; + + logger.info(ctx, `Increasing seats for account ${accountId}...`); const promises = subscriptionItems.map(async (item) => { try { @@ -127,8 +122,7 @@ export class AccountPerSeatBillingService { } catch (error) { logger.error( { - name: this.namespace, - accountId, + ...ctx, error, }, `Failed to increase seats for account ${accountId}`, @@ -155,14 +149,13 @@ export class AccountPerSeatBillingService { return; } - logger.info( - { - name: this.namespace, - accountId, - subscriptionItems, - }, - `Decreasing seats for account ${accountId}...`, - ); + const ctx = { + name: this.namespace, + accountId, + subscriptionItems, + }; + + logger.info(ctx, `Decreasing seats for account ${accountId}...`); const billingGateway = new BillingGatewayService(subscription.provider); @@ -196,8 +189,7 @@ export class AccountPerSeatBillingService { } catch (error) { logger.error( { - name: this.namespace, - accountId, + ...ctx, error, }, `Failed to decrease seats for account ${accountId}`, diff --git a/packages/features/team-accounts/src/server/services/create-team-account.service.ts b/packages/features/team-accounts/src/server/services/create-team-account.service.ts index 596364981..83887f360 100644 --- a/packages/features/team-accounts/src/server/services/create-team-account.service.ts +++ b/packages/features/team-accounts/src/server/services/create-team-account.service.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; import { getLogger } from '@kit/shared/logger'; @@ -10,11 +12,9 @@ export class CreateTeamAccountService { async createNewOrganizationAccount(params: { name: string; userId: string }) { const logger = await getLogger(); + const ctx = { ...params, namespace: this.namespace }; - logger.info( - { ...params, namespace: this.namespace }, - `Creating new team account...`, - ); + logger.info(ctx, `Creating new team account...`); return await this.client.rpc('create_account', { account_name: params.name, diff --git a/packages/features/team-accounts/src/server/services/delete-team-account.service.ts b/packages/features/team-accounts/src/server/services/delete-team-account.service.ts index 95bd612b8..adcdf23af 100644 --- a/packages/features/team-accounts/src/server/services/delete-team-account.service.ts +++ b/packages/features/team-accounts/src/server/services/delete-team-account.service.ts @@ -1,7 +1,7 @@ -import { SupabaseClient } from '@supabase/supabase-js'; - import 'server-only'; +import { SupabaseClient } from '@supabase/supabase-js'; + import { getLogger } from '@kit/shared/logger'; import { Database } from '@kit/supabase/database'; @@ -26,14 +26,13 @@ export class DeleteTeamAccountService { ) { const logger = await getLogger(); - logger.info( - { - name: this.namespace, - accountId: params.accountId, - userId: params.userId, - }, - `Requested team account deletion. Processing...`, - ); + const ctx = { + accountId: params.accountId, + userId: params.userId, + name: this.namespace, + }; + + logger.info(ctx, `Requested team account deletion. Processing...`); // we can use the admin client to delete the account. const { error } = await adminClient @@ -44,9 +43,7 @@ export class DeleteTeamAccountService { if (error) { logger.error( { - name: this.namespace, - accountId: params.accountId, - userId: params.userId, + ...ctx, error, }, 'Failed to delete team account', @@ -55,13 +52,6 @@ export class DeleteTeamAccountService { throw new Error('Failed to delete team account'); } - logger.info( - { - name: this.namespace, - accountId: params.accountId, - userId: params.userId, - }, - 'Successfully deleted team account', - ); + logger.info(ctx, 'Successfully deleted team account'); } } diff --git a/packages/features/team-accounts/src/server/services/leave-team-account.service.ts b/packages/features/team-accounts/src/server/services/leave-team-account.service.ts index dd7ae45af..b81983e01 100644 --- a/packages/features/team-accounts/src/server/services/leave-team-account.service.ts +++ b/packages/features/team-accounts/src/server/services/leave-team-account.service.ts @@ -1,6 +1,7 @@ +import 'server-only'; + import { SupabaseClient } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { getLogger } from '@kit/shared/logger'; diff --git a/packages/mailers/src/impl/cloudflare/index.ts b/packages/mailers/src/impl/cloudflare/index.ts index 6d4510738..dc044050b 100644 --- a/packages/mailers/src/impl/cloudflare/index.ts +++ b/packages/mailers/src/impl/cloudflare/index.ts @@ -1,4 +1,5 @@ import 'server-only'; + import { z } from 'zod'; import { Mailer } from '../../mailer'; diff --git a/packages/mailers/src/impl/nodemailer/index.ts b/packages/mailers/src/impl/nodemailer/index.ts index c3623001b..06816e601 100644 --- a/packages/mailers/src/impl/nodemailer/index.ts +++ b/packages/mailers/src/impl/nodemailer/index.ts @@ -1,4 +1,5 @@ import 'server-only'; + import { z } from 'zod'; import { Mailer } from '../../mailer'; diff --git a/packages/next/src/actions/index.ts b/packages/next/src/actions/index.ts index 7887573d4..a3cd6b5db 100644 --- a/packages/next/src/actions/index.ts +++ b/packages/next/src/actions/index.ts @@ -1,8 +1,9 @@ +import 'server-only'; + import { redirect } from 'next/navigation'; import type { User } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { verifyCaptchaToken } from '@kit/auth/captcha/server'; diff --git a/packages/next/src/routes/index.ts b/packages/next/src/routes/index.ts index eb71780b4..e4c1567e6 100644 --- a/packages/next/src/routes/index.ts +++ b/packages/next/src/routes/index.ts @@ -1,9 +1,10 @@ +import 'server-only'; + import { redirect } from 'next/navigation'; import { NextRequest, NextResponse } from 'next/server'; import { User } from '@supabase/supabase-js'; -import 'server-only'; import { z } from 'zod'; import { verifyCaptchaToken } from '@kit/auth/captcha/server'; diff --git a/packages/next/src/utils/index.ts b/packages/next/src/utils/index.ts index 35bfb0a6d..6eb64adea 100644 --- a/packages/next/src/utils/index.ts +++ b/packages/next/src/utils/index.ts @@ -4,11 +4,11 @@ export const zodParseFactory = (schema: T) => (data: unknown): z.infer => { try { - return schema.parse(data); + return schema.parse(data) as unknown; } catch (err) { console.error(err); // handle error - throw new Error(`Invalid data: ${err}`); + throw new Error(`Invalid data: ${err as string}`); } }; diff --git a/packages/supabase/src/clients/route-handler.client.ts b/packages/supabase/src/clients/route-handler.client.ts index 5d21f529b..260c8dbd3 100644 --- a/packages/supabase/src/clients/route-handler.client.ts +++ b/packages/supabase/src/clients/route-handler.client.ts @@ -1,8 +1,9 @@ +import 'server-only'; + import { cookies } from 'next/headers'; import type { CookieOptions } from '@supabase/ssr'; import { createServerClient } from '@supabase/ssr'; -import 'server-only'; import { Database } from '../database.types'; import { getSupabaseClientKeys } from '../get-supabase-client-keys'; diff --git a/packages/supabase/src/clients/server-actions.client.ts b/packages/supabase/src/clients/server-actions.client.ts index 48f223108..737a26798 100644 --- a/packages/supabase/src/clients/server-actions.client.ts +++ b/packages/supabase/src/clients/server-actions.client.ts @@ -1,7 +1,8 @@ +import 'server-only'; + import { cookies } from 'next/headers'; import { createServerClient } from '@supabase/ssr'; -import 'server-only'; import { Database } from '../database.types'; import { getSupabaseClientKeys } from '../get-supabase-client-keys'; diff --git a/packages/supabase/src/clients/server-component.client.ts b/packages/supabase/src/clients/server-component.client.ts index a3bb91c57..91278f905 100644 --- a/packages/supabase/src/clients/server-component.client.ts +++ b/packages/supabase/src/clients/server-component.client.ts @@ -1,7 +1,8 @@ +import 'server-only'; + import { cookies } from 'next/headers'; import { createServerClient } from '@supabase/ssr'; -import 'server-only'; import { Database } from '../database.types'; import { getSupabaseClientKeys } from '../get-supabase-client-keys'; diff --git a/packages/ui/package.json b/packages/ui/package.json index 5274bda5e..3cbb5b94b 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -38,7 +38,7 @@ "@tanstack/react-table": "^8.10.7", "class-variance-authority": "^0.7.0", "date-fns": "^3.2.0", - "lucide-react": "^0.364.0", + "lucide-react": "^0.366.0", "react-hook-form": "^7.51.2", "react-i18next": "^14.1.0", "sonner": "^1.4.41", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38796c605..4d156debc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,11 +87,11 @@ importers: specifier: workspace:^ version: link:../../packages/ui '@makerkit/data-loader-supabase-core': - specifier: 0.0.5 - version: 0.0.5(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) - '@makerkit/data-loader-supabase-nextjs': specifier: ^0.0.7 - version: 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.2.0-canary.62)(react@18.2.0)(swr@2.2.5) + version: 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) + '@makerkit/data-loader-supabase-nextjs': + specifier: ^0.0.9 + version: 0.0.9(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.2.0-canary.62)(react@18.2.0)(swr@2.2.5) '@marsidev/react-turnstile': specifier: ^0.5.4 version: 0.5.4(react-dom@18.2.0)(react@18.2.0) @@ -563,11 +563,11 @@ importers: specifier: workspace:^ version: link:../../ui '@makerkit/data-loader-supabase-core': - specifier: 0.0.5 - version: 0.0.5(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) - '@makerkit/data-loader-supabase-nextjs': specifier: ^0.0.7 - version: 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.1.4)(react@18.2.0)(swr@2.2.5) + version: 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) + '@makerkit/data-loader-supabase-nextjs': + specifier: ^0.0.9 + version: 0.0.9(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.1.4)(react@18.2.0)(swr@2.2.5) '@supabase/supabase-js': specifier: ^2.42.0 version: 2.42.0 @@ -967,8 +967,8 @@ importers: specifier: ^8.57.0 version: 8.57.0 lucide-react: - specifier: ^0.363.0 - version: 0.363.0(react@18.2.0) + specifier: ^0.366.0 + version: 0.366.0(react@18.2.0) prettier: specifier: ^3.2.5 version: 3.2.5 @@ -2226,8 +2226,8 @@ packages: engines: {node: '>=18'} dev: false - /@makerkit/data-loader-supabase-core@0.0.5(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0): - resolution: {integrity: sha512-J68TcXACZpbBhFPwNX4AP8O37iPHpcqpT8PLTLeMvoCpm2HI2MK+KGV5uj2zJydHKClRi44KkNa0BUHJzg9myw==} + /@makerkit/data-loader-supabase-core@0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0): + resolution: {integrity: sha512-9Zi7GmBZaedHl9x+LnasUL3ztx2oLInwI1uzdw4E830gSNQr/hx5/Sodd1A9cXECn51Ub5HWEJ8kfBZwX0qCKQ==} peerDependencies: '@supabase/postgrest-js': '>1.0.0' '@supabase/supabase-js': '>=2.0.0' @@ -2236,15 +2236,15 @@ packages: '@supabase/supabase-js': 2.42.0 ts-case-convert: 2.0.7 - /@makerkit/data-loader-supabase-nextjs@0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.1.4)(react@18.2.0)(swr@2.2.5): - resolution: {integrity: sha512-iPi4dWkZnv3awtlJaQIVLo7nca8XEjSMTE1HHZg1PtBAYRyLbq6vJYzhez0XVu/OSncw5QyhTzCzB1dxzOHxhw==} + /@makerkit/data-loader-supabase-nextjs@0.0.9(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.1.4)(react@18.2.0)(swr@2.2.5): + resolution: {integrity: sha512-FNn0Z3zlV0W6+GVoWAkokMC4Mzx29lByCGbYBi9F11VBkmxuEH8i4KbYYbImW+r8uvs6sdth+cqjx6Jo+VuTCw==} peerDependencies: '@supabase/supabase-js': '>=2.0.0' next: '>=13.4.0' react: '>=18.0.0' swr: '>=2.0.0' dependencies: - '@makerkit/data-loader-supabase-core': 0.0.5(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) + '@makerkit/data-loader-supabase-core': 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) '@supabase/supabase-js': 2.42.0 next: 14.1.4(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 @@ -2253,15 +2253,15 @@ packages: - '@supabase/postgrest-js' dev: true - /@makerkit/data-loader-supabase-nextjs@0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.2.0-canary.62)(react@18.2.0)(swr@2.2.5): - resolution: {integrity: sha512-iPi4dWkZnv3awtlJaQIVLo7nca8XEjSMTE1HHZg1PtBAYRyLbq6vJYzhez0XVu/OSncw5QyhTzCzB1dxzOHxhw==} + /@makerkit/data-loader-supabase-nextjs@0.0.9(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0)(next@14.2.0-canary.62)(react@18.2.0)(swr@2.2.5): + resolution: {integrity: sha512-FNn0Z3zlV0W6+GVoWAkokMC4Mzx29lByCGbYBi9F11VBkmxuEH8i4KbYYbImW+r8uvs6sdth+cqjx6Jo+VuTCw==} peerDependencies: '@supabase/supabase-js': '>=2.0.0' next: '>=13.4.0' react: '>=18.0.0' swr: '>=2.0.0' dependencies: - '@makerkit/data-loader-supabase-core': 0.0.5(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) + '@makerkit/data-loader-supabase-core': 0.0.7(@supabase/postgrest-js@1.15.0)(@supabase/supabase-js@2.42.0) '@supabase/supabase-js': 2.42.0 next: 14.2.0-canary.62(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 @@ -9721,6 +9721,14 @@ packages: dependencies: react: 18.2.0 + /lucide-react@0.366.0(react@18.2.0): + resolution: {integrity: sha512-iUOsp/35wOkrgEzigZlZI/OhVxQZ8CmxjebdIjfSDzNBmrNYjQfKSpeKderaEFfGt3OycF1BE+wLlaqWRuoh4w==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: true + /magic-string@0.27.0: resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} engines: {node: '>=12'} diff --git a/tooling/prettier/index.mjs b/tooling/prettier/index.mjs index 63e5b6d51..256d657e9 100644 --- a/tooling/prettier/index.mjs +++ b/tooling/prettier/index.mjs @@ -12,6 +12,7 @@ const config = { arrowParens: 'always', importOrder: [ '/^(?!.*\\.css).*/', + '^server-only$', '^react$', '^react-dom$', '^next$',