Next.js 16, React 19.2, Identities page, Invitations identities step, PNPM Catalogs (#381)

* Upgraded to Next.js 16
* Refactored code to comply with React 19.2 ESLint rules
* Refactored some useEffect usages with the new useEffectEvent
* Added Identities page and added second step to set up an identity after accepting an invitation
* Updated all dependencies
* Introduced PNPM catalogs for some frequently updated dependencies
* Bugs fixing and improvements
This commit is contained in:
Giancarlo Buomprisco
2025-10-22 11:47:47 +09:00
committed by GitHub
parent ea0c1dde80
commit 2c0d0bf7a1
98 changed files with 4812 additions and 4394 deletions

View File

@@ -2,3 +2,7 @@ database.types.ts
playwright-report playwright-report
*.hbs *.hbs
*.md *.md
dist
build
.next
next-env.d.ts

View File

@@ -19,10 +19,9 @@ class ConnectivityService {
}; };
} }
const anonKey = await getVariable( const anonKey =
'NEXT_PUBLIC_SUPABASE_ANON_KEY', (await getVariable('NEXT_PUBLIC_SUPABASE_ANON_KEY', this.mode)) ||
this.mode, (await getVariable('NEXT_PUBLIC_SUPABASE_PUBLIC_KEY', this.mode));
);
if (!anonKey) { if (!anonKey) {
return { return {
@@ -71,10 +70,9 @@ class ConnectivityService {
const endpoint = `${url}/rest/v1/accounts`; const endpoint = `${url}/rest/v1/accounts`;
const apikey = await getVariable( const apikey =
'NEXT_PUBLIC_SUPABASE_ANON_KEY', (await getVariable('NEXT_PUBLIC_SUPABASE_ANON_KEY', this.mode)) ||
this.mode, (await getVariable('NEXT_PUBLIC_SUPABASE_PUBLIC_KEY', this.mode));
);
if (!apikey) { if (!apikey) {
return { return {
@@ -83,7 +81,9 @@ class ConnectivityService {
}; };
} }
const adminKey = await getVariable('SUPABASE_SERVICE_ROLE_KEY', this.mode); const adminKey =
(await getVariable('SUPABASE_SERVICE_ROLE_KEY', this.mode)) ||
(await getVariable('SUPABASE_SECRET_KEY', this.mode));
if (!adminKey) { if (!adminKey) {
return { return {

View File

@@ -13,7 +13,12 @@ export type Translations = {
export async function loadTranslations() { export async function loadTranslations() {
const localesPath = join(process.cwd(), '../web/public/locales'); const localesPath = join(process.cwd(), '../web/public/locales');
const locales = readdirSync(localesPath); const localesDirents = readdirSync(localesPath, { withFileTypes: true });
const locales = localesDirents
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
const translations: Translations = {}; const translations: Translations = {};
for (const locale of locales) { for (const locale of locales) {

View File

@@ -3,9 +3,7 @@ import type { NextConfig } from 'next';
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
reactStrictMode: true, reactStrictMode: true,
transpilePackages: ['@kit/ui', '@kit/shared'], transpilePackages: ['@kit/ui', '@kit/shared'],
experimental: {
reactCompiler: true, reactCompiler: true,
},
devIndicators: { devIndicators: {
position: 'bottom-right', position: 'bottom-right',
}, },

View File

@@ -4,20 +4,20 @@
"private": true, "private": true,
"scripts": { "scripts": {
"clean": "git clean -xdf .next .turbo node_modules", "clean": "git clean -xdf .next .turbo node_modules",
"dev": "next dev --turbo --port=3010 | pino-pretty -c", "dev": "next dev --port=3010 | pino-pretty -c",
"format": "prettier --check --write \"**/*.{js,cjs,mjs,ts,tsx,md,json}\"" "format": "prettier --check --write \"**/*.{ts,tsx}\" --ignore-path=\"../../.prettierignore\""
}, },
"dependencies": { "dependencies": {
"@ai-sdk/openai": "^2.0.42", "@ai-sdk/openai": "^2.0.53",
"@faker-js/faker": "^10.0.0", "@faker-js/faker": "^10.1.0",
"@hookform/resolvers": "^5.2.2", "@hookform/resolvers": "^5.2.2",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"ai": "5.0.59", "ai": "5.0.76",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"nodemailer": "^7.0.6", "nodemailer": "^7.0.9",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"rxjs": "^7.8.2" "rxjs": "^7.8.2"
}, },
"devDependencies": { "devDependencies": {
@@ -29,16 +29,16 @@
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@tailwindcss/postcss": "^4.1.14", "@tailwindcss/postcss": "^4.1.15",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"@types/nodemailer": "7.0.2", "@types/nodemailer": "7.0.2",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"babel-plugin-react-compiler": "19.1.0-rc.3", "babel-plugin-react-compiler": "1.0.0",
"pino-pretty": "13.0.0", "pino-pretty": "13.1.2",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"recharts": "2.15.3", "recharts": "2.15.3",
"tailwindcss": "4.1.14", "tailwindcss": "4.1.15",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"zod": "^3.25.74" "zod": "^3.25.74"

View File

@@ -11,9 +11,9 @@
}, },
"author": "Makerkit", "author": "Makerkit",
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.55.1", "@playwright/test": "^1.56.1",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"dotenv": "17.2.3", "dotenv": "17.2.3",
"node-html-parser": "^7.0.1", "node-html-parser": "^7.0.1",
"totp-generator": "^2.0.0" "totp-generator": "^2.0.0"

View File

@@ -103,9 +103,6 @@ test.describe('Admin', () => {
), ),
]); ]);
// TODO: remove when https://github.com/makerkit/next-supabase-saas-kit-turbo/issues/356 is solved
await page.reload();
await expect(page.getByText('Banned').first()).toBeVisible(); await expect(page.getByText('Banned').first()).toBeVisible();
await page.context().clearCookies(); await page.context().clearCookies();
@@ -154,9 +151,6 @@ test.describe('Admin', () => {
await page.waitForTimeout(250); await page.waitForTimeout(250);
// TODO: remove when https://github.com/makerkit/next-supabase-saas-kit-turbo/issues/356 is solved
await page.reload();
// Verify ban badge is removed // Verify ban badge is removed
await expect(page.getByText('Banned')).not.toBeVisible(); await expect(page.getByText('Banned')).not.toBeVisible();

View File

@@ -29,22 +29,15 @@ test.describe('Password Reset Flow', () => {
subject: 'Reset your password', subject: 'Reset your password',
}); });
await page.waitForURL('/update-password'); await page.waitForURL(new RegExp('/update-password?.*'));
await auth.updatePassword(newPassword); await auth.updatePassword(newPassword);
await page
.locator('a', {
hasText: 'Back to Home Page',
})
.click();
await page.waitForURL('/home'); await page.waitForURL('/home');
}).toPass(); }).toPass();
await page.context().clearCookies(); await page.context().clearCookies();
await page.reload();
await page.waitForURL('/');
await page.goto('/auth/sign-in'); await page.goto('/auth/sign-in');
await auth.loginAsUser({ await auth.loginAsUser({

View File

@@ -115,19 +115,37 @@ export class InvitationsPageObject {
async acceptInvitation() { async acceptInvitation() {
console.log('Accepting invitation...'); console.log('Accepting invitation...');
await Promise.all([ const click = this.page
this.page
.locator('[data-test="join-team-form"] button[type="submit"]') .locator('[data-test="join-team-form"] button[type="submit"]')
.click(), .click();
this.page.waitForResponse((response) => {
const response = this.page.waitForResponse((response) => {
return ( return (
response.url().includes('/join') && response.url().includes('/join') &&
response.request().method() === 'POST' response.request().method() === 'POST'
); );
}), });
]);
console.log('Invitation accepted'); await Promise.all([click, response]);
// wait for animation to complete
await this.page.waitForTimeout(500);
// skip authentication setup
const skipIdentitiesButton = this.page.locator(
'[data-test="skip-identities-button"]',
);
if (
await skipIdentitiesButton.isVisible({
timeout: 1000,
})
) {
await skipIdentitiesButton.click();
}
// wait for redirect to account home
await this.page.waitForURL(new RegExp('/home/[a-z0-9-]+'));
} }
private getInviteForm() { private getInviteForm() {

View File

@@ -21,10 +21,12 @@ const ModeToggle = dynamic(
{ ssr: false }, { ssr: false },
); );
const MobileModeToggle = dynamic(() => const MobileModeToggle = dynamic(
() =>
import('@kit/ui/mobile-mode-toggle').then((mod) => ({ import('@kit/ui/mobile-mode-toggle').then((mod) => ({
default: mod.MobileModeToggle, default: mod.MobileModeToggle,
})), })),
{ ssr: false },
); );
const paths = { const paths = {

View File

@@ -29,27 +29,60 @@ function Node({
const url = `${prefix}/${node.slug}`; const url = `${prefix}/${node.slug}`;
const label = node.label ? node.label : node.title; const label = node.label ? node.label : node.title;
const Container = (props: React.PropsWithChildren) => { return (
<NodeContainer node={node} prefix={prefix}>
<NodeTrigger node={node} label={label} url={url} />
<NodeContentContainer node={node}>
<Tree pages={node.children ?? []} level={level + 1} prefix={prefix} />
</NodeContentContainer>
</NodeContainer>
);
}
function NodeContentContainer({
node,
children,
}: {
node: Cms.ContentItem;
children: React.ReactNode;
}) {
if (node.collapsible) {
return <CollapsibleContent>{children}</CollapsibleContent>;
}
return children;
}
function NodeContainer({
node,
prefix,
children,
}: {
node: Cms.ContentItem;
prefix: string;
children: React.ReactNode;
}) {
if (node.collapsible) { if (node.collapsible) {
return ( return (
<DocsNavigationCollapsible node={node} prefix={prefix}> <DocsNavigationCollapsible node={node} prefix={prefix}>
{props.children} {children}
</DocsNavigationCollapsible> </DocsNavigationCollapsible>
); );
} }
return props.children; return children;
};
const ContentContainer = (props: React.PropsWithChildren) => {
if (node.collapsible) {
return <CollapsibleContent>{props.children}</CollapsibleContent>;
} }
return props.children; function NodeTrigger({
}; node,
label,
const Trigger = () => { url,
}: {
node: Cms.ContentItem;
label: string;
url: string;
}) {
if (node.collapsible) { if (node.collapsible) {
return ( return (
<CollapsibleTrigger asChild> <CollapsibleTrigger asChild>
@@ -64,17 +97,6 @@ function Node({
} }
return <DocsNavLink label={label} url={url} />; return <DocsNavLink label={label} url={url} />;
};
return (
<Container>
<Trigger />
<ContentContainer>
<Tree pages={node.children ?? []} level={level + 1} prefix={prefix} />
</ContentContainer>
</Container>
);
} }
function Tree({ function Tree({

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useEffectEvent, useMemo, useState } from 'react';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
@@ -21,27 +21,26 @@ export function FloatingDocumentationNavigation(
const [isVisible, setIsVisible] = useState(false); const [isVisible, setIsVisible] = useState(false);
const enableScrolling = (element: HTMLElement) => const enableScrolling = useEffectEvent(
(element.style.overflowY = ''); () => body && (body.style.overflowY = ''),
);
const disableScrolling = (element: HTMLElement) => const disableScrolling = useEffectEvent(
(element.style.overflowY = 'hidden'); () => body && (body.style.overflowY = 'hidden'),
);
// enable/disable body scrolling when the docs are toggled // enable/disable body scrolling when the docs are toggled
useEffect(() => { useEffect(() => {
if (!body) {
return;
}
if (isVisible) { if (isVisible) {
disableScrolling(body); disableScrolling();
} else { } else {
enableScrolling(body); enableScrolling();
} }
}, [isVisible, body]); }, [isVisible]);
// hide docs when navigating to another page // hide docs when navigating to another page
useEffect(() => { useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
setIsVisible(false); setIsVisible(false);
}, [activePath]); }, [activePath]);

View File

@@ -12,7 +12,6 @@ import { withI18n } from '~/lib/i18n/with-i18n';
interface SignInPageProps { interface SignInPageProps {
searchParams: Promise<{ searchParams: Promise<{
invite_token?: string;
next?: string; next?: string;
}>; }>;
} }

View File

@@ -26,14 +26,14 @@ const GlobalErrorPage = ({
<html lang="en"> <html lang="en">
<body> <body>
<RootProviders> <RootProviders>
<GlobalErrorPageContent reset={reset} /> <GlobalErrorContent reset={reset} />
</RootProviders> </RootProviders>
</body> </body>
</html> </html>
); );
}; };
function GlobalErrorPageContent({ reset }: { reset: () => void }) { function GlobalErrorContent({ reset }: { reset: () => void }) {
const user = useUser(); const user = useUser();
return ( return (

View File

@@ -19,10 +19,10 @@ const features = {
const providers = authConfig.providers.oAuth; const providers = authConfig.providers.oAuth;
const callbackPath = pathsConfig.auth.callback; const callbackPath = pathsConfig.auth.callback;
const accountHomePath = pathsConfig.app.accountHome; const accountSettingsPath = pathsConfig.app.accountSettings;
const paths = { const paths = {
callback: callbackPath + `?next=${accountHomePath}`, callback: callbackPath + `?next=${accountSettingsPath}`,
}; };
export const generateMetadata = async () => { export const generateMetadata = async () => {

View File

@@ -64,7 +64,6 @@ export function TeamAccountNavigationMenu(props: {
<div> <div>
<ProfileAccountDropdownContainer <ProfileAccountDropdownContainer
user={user} user={user}
account={account}
showProfileName={false} showProfileName={false}
/> />
</div> </div>

View File

@@ -61,30 +61,7 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
const canManageBilling = const canManageBilling =
workspace.account.permissions.includes('billing.manage'); workspace.account.permissions.includes('billing.manage');
const Checkout = () => { const shouldShowBillingPortal = canManageBilling && customerId;
if (!canManageBilling) {
return <CannotManageBillingAlert />;
}
return (
<TeamAccountCheckoutForm customerId={customerId} accountId={accountId} />
);
};
const BillingPortal = () => {
if (!canManageBilling || !customerId) {
return null;
}
return (
<form action={createBillingPortalSession}>
<input type="hidden" name={'accountId'} value={accountId} />
<input type="hidden" name={'slug'} value={account} />
<BillingPortalCard />
</form>
);
};
return ( return (
<> <>
@@ -97,7 +74,15 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
<PageBody> <PageBody>
<div className={cn(`flex max-w-2xl flex-col space-y-4`)}> <div className={cn(`flex max-w-2xl flex-col space-y-4`)}>
<If condition={!hasBillingData}> <If condition={!hasBillingData}>
<Checkout /> <If
condition={canManageBilling}
fallback={<CannotManageBillingAlert />}
>
<TeamAccountCheckoutForm
customerId={customerId}
accountId={accountId}
/>
</If>
</If> </If>
<If condition={subscription}> <If condition={subscription}>
@@ -124,7 +109,9 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
}} }}
</If> </If>
<BillingPortal /> {shouldShowBillingPortal ? (
<BillingPortalForm accountId={accountId} account={account} />
) : null}
</div> </div>
</PageBody> </PageBody>
</> </>
@@ -148,3 +135,20 @@ function CannotManageBillingAlert() {
</Alert> </Alert>
); );
} }
function BillingPortalForm({
accountId,
account,
}: {
accountId: string;
account: string;
}) {
return (
<form action={createBillingPortalSession}>
<input type="hidden" name={'accountId'} value={accountId} />
<input type="hidden" name={'slug'} value={account} />
<BillingPortalCard />
</form>
);
}

View File

@@ -0,0 +1,152 @@
import { Metadata } from 'next';
import Link from 'next/link';
import { redirect } from 'next/navigation';
import type { Provider } from '@supabase/supabase-js';
import { LinkAccountsList } from '@kit/accounts/personal-account-settings';
import { AuthLayoutShell } from '@kit/auth/shared';
import { requireUser } from '@kit/supabase/require-user';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { Button } from '@kit/ui/button';
import { Heading } from '@kit/ui/heading';
import { Trans } from '@kit/ui/trans';
import { AppLogo } from '~/components/app-logo';
import authConfig from '~/config/auth.config';
import pathsConfig from '~/config/paths.config';
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
export const meta = async (): Promise<Metadata> => {
const i18n = await createI18nServerInstance();
return {
title: i18n.t('auth:setupAccount'),
};
};
type IdentitiesPageProps = {
searchParams: Promise<{ next?: string }>;
};
/**
* @name IdentitiesPage
* @description Displays linked accounts and available authentication methods.
*/
async function IdentitiesPage(props: IdentitiesPageProps) {
const {
nextPath,
showPasswordOption,
showEmailOption,
oAuthProviders,
enableIdentityLinking,
} = await fetchData(props);
return (
<AuthLayoutShell
Logo={AppLogo}
contentClassName="max-w-md overflow-y-hidden"
>
<div
className={
'flex max-h-[70vh] w-full flex-col items-center space-y-6 overflow-y-auto'
}
>
<div className={'flex flex-col items-center gap-1'}>
<Heading level={4} className="text-center">
<Trans i18nKey={'auth:linkAccountToSignIn'} />
</Heading>
<Heading
level={6}
className={'text-muted-foreground text-center text-sm'}
>
<Trans i18nKey={'auth:linkAccountToSignInDescription'} />
</Heading>
</div>
<IdentitiesStep
nextPath={nextPath}
showPasswordOption={showPasswordOption}
showEmailOption={showEmailOption}
oAuthProviders={oAuthProviders}
enableIdentityLinking={enableIdentityLinking}
/>
</div>
</AuthLayoutShell>
);
}
export default withI18n(IdentitiesPage);
/**
* @name IdentitiesStep
* @description Displays linked accounts and available authentication methods.
* LinkAccountsList component handles all authentication options including OAuth and Email/Password.
*/
function IdentitiesStep(props: {
nextPath: string;
showPasswordOption: boolean;
showEmailOption: boolean;
enableIdentityLinking: boolean;
oAuthProviders: Provider[];
}) {
return (
<div
className={
'animate-in fade-in slide-in-from-bottom-4 mx-auto flex w-full max-w-md flex-col space-y-4 duration-500'
}
data-test="join-step-two"
>
<LinkAccountsList
providers={props.oAuthProviders}
showPasswordOption={props.showPasswordOption}
showEmailOption={props.showEmailOption}
redirectTo={props.nextPath}
enabled={props.enableIdentityLinking}
/>
<Button asChild data-test="skip-identities-button">
<Link href={props.nextPath}>
<Trans i18nKey={'common:continueKey'} />
</Link>
</Button>
</div>
);
}
async function fetchData(props: IdentitiesPageProps) {
const searchParams = await props.searchParams;
const client = getSupabaseServerClient();
const auth = await requireUser(client);
// If not authenticated, redirect to sign in
if (!auth.data) {
throw redirect(pathsConfig.auth.signIn);
}
// Get the next path from URL params (where to redirect after setup)
const nextPath = searchParams.next || pathsConfig.app.home;
// Available auth methods to add
const showPasswordOption = authConfig.providers.password;
// Show email option if password, magic link, or OTP is enabled
const showEmailOption =
authConfig.providers.password ||
authConfig.providers.magicLink ||
authConfig.providers.otp;
const oAuthProviders = authConfig.providers.oAuth;
const enableIdentityLinking = authConfig.enableIdentityLinking;
return {
nextPath,
showPasswordOption,
showEmailOption,
oAuthProviders,
enableIdentityLinking,
};
}

View File

@@ -14,6 +14,7 @@ import { Heading } from '@kit/ui/heading';
import { Trans } from '@kit/ui/trans'; import { Trans } from '@kit/ui/trans';
import { AppLogo } from '~/components/app-logo'; import { AppLogo } from '~/components/app-logo';
import authConfig from '~/config/auth.config';
import pathsConfig from '~/config/paths.config'; import pathsConfig from '~/config/paths.config';
import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n'; import { withI18n } from '~/lib/i18n/with-i18n';
@@ -21,6 +22,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
interface JoinTeamAccountPageProps { interface JoinTeamAccountPageProps {
searchParams: Promise<{ searchParams: Promise<{
invite_token?: string; invite_token?: string;
type?: 'invite' | 'magic-link';
email?: string; email?: string;
}>; }>;
} }
@@ -127,6 +129,26 @@ async function JoinTeamAccountPage(props: JoinTeamAccountPageProps) {
invitation.account.slug, invitation.account.slug,
); );
// Determine if we should show the account setup step (Step 2)
// Decision logic:
// 1. Only show for new accounts (linkType === 'invite')
// 2. Only if we have auth options available (password OR OAuth)
// 3. Users can always skip and set up auth later in account settings
const linkType = searchParams.type;
const supportsPasswordSignUp = authConfig.providers.password;
const supportsOAuthProviders = authConfig.providers.oAuth.length > 0;
const isNewAccount = linkType === 'invite';
const shouldSetupAccount =
isNewAccount && (supportsPasswordSignUp || supportsOAuthProviders);
// Determine redirect destination after joining:
// - If shouldSetupAccount: redirect to /identities with next param (Step 2)
// - Otherwise: redirect directly to team home (skip Step 2)
const nextPath = shouldSetupAccount
? `/identities?next=${encodeURIComponent(accountHome)}`
: accountHome;
const email = auth.data.email ?? ''; const email = auth.data.email ?? '';
return ( return (
@@ -137,7 +159,7 @@ async function JoinTeamAccountPage(props: JoinTeamAccountPageProps) {
invitation={invitation} invitation={invitation}
paths={{ paths={{
signOutNext, signOutNext,
accountHome, nextPath,
}} }}
/> />
</AuthLayoutShell> </AuthLayoutShell>

View File

@@ -5,7 +5,7 @@ import { Toaster } from '@kit/ui/sonner';
import { RootProviders } from '~/components/root-providers'; import { RootProviders } from '~/components/root-providers';
import { getFontsClassName } from '~/lib/fonts'; import { getFontsClassName } from '~/lib/fonts';
import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { generateRootMetadata } from '~/lib/root-metdata'; import { generateRootMetadata } from '~/lib/root-metadata';
import { getRootTheme } from '~/lib/root-theme'; import { getRootTheme } from '~/lib/root-theme';
import '../styles/globals.css'; import '../styles/globals.css';

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useCallback, useEffect } from 'react'; import { useCallback, useEffect, useEffectEvent } from 'react';
import { usePathname, useSearchParams } from 'next/navigation'; import { usePathname, useSearchParams } from 'next/navigation';
@@ -28,19 +28,38 @@ function useAnalyticsMapping<T extends ConsumerProvidedEventTypes>(
) { ) {
const appEvents = useAppEvents<T>(); const appEvents = useAppEvents<T>();
const subscribeToAppEvent = useEffectEvent(
(
eventType: AppEventType<T>,
handler: (event: AppEvent<T, AppEventType<T>>) => unknown,
) => {
appEvents.on(eventType, handler);
},
);
const unsubscribeFromAppEvent = useEffectEvent(
(
eventType: AppEventType<T>,
handler: (event: AppEvent<T, AppEventType<T>>) => unknown,
) => {
appEvents.off(eventType, handler);
},
);
useEffect(() => { useEffect(() => {
const subscriptions = Object.entries(mapping).map( const subscriptions = Object.entries(mapping).map(
([eventType, handler]) => { ([eventType, handler]) => {
appEvents.on(eventType as AppEventType<T>, handler); subscribeToAppEvent(eventType as AppEventType<T>, handler);
return () => appEvents.off(eventType as AppEventType<T>, handler); return () =>
unsubscribeFromAppEvent(eventType as AppEventType<T>, handler);
}, },
); );
return () => { return () => {
subscriptions.forEach((unsubscribe) => unsubscribe()); subscriptions.forEach((unsubscribe) => unsubscribe());
}; };
}, [appEvents, mapping]); }, [mapping]);
} }
/** /**
@@ -96,9 +115,14 @@ function useReportPageView(reportAnalyticsFn: (url: string) => unknown) {
const pathname = usePathname(); const pathname = usePathname();
const searchParams = useSearchParams(); const searchParams = useSearchParams();
useEffect(() => { const callAnalyticsOnPathChange = useEffectEvent(() => {
const url = [pathname, searchParams.toString()].filter(Boolean).join('?'); const url = [pathname, searchParams.toString()].filter(Boolean).join('?');
reportAnalyticsFn(url); return reportAnalyticsFn(url);
}, [pathname, reportAnalyticsFn, searchParams]); });
useEffect(() => {
callAnalyticsOnPathChange();
// call whenever the pathname changes
}, [pathname]);
} }

View File

@@ -8,8 +8,6 @@ import { useMonitoring } from '@kit/monitoring/hooks';
import { useAppEvents } from '@kit/shared/events'; import { useAppEvents } from '@kit/shared/events';
import { useAuthChangeListener } from '@kit/supabase/hooks/use-auth-change-listener'; import { useAuthChangeListener } from '@kit/supabase/hooks/use-auth-change-listener';
import pathsConfig from '~/config/paths.config';
export function AuthProvider(props: React.PropsWithChildren) { export function AuthProvider(props: React.PropsWithChildren) {
const dispatchEvent = useDispatchAppEventFromAuthEvent(); const dispatchEvent = useDispatchAppEventFromAuthEvent();
@@ -23,7 +21,6 @@ export function AuthProvider(props: React.PropsWithChildren) {
); );
useAuthChangeListener({ useAuthChangeListener({
appHomePath: pathsConfig.app.home,
onEvent, onEvent,
}); });

View File

@@ -28,9 +28,7 @@ const config = {
reactStrictMode: true, reactStrictMode: true,
/** Enables hot reloading for local packages without a build step */ /** Enables hot reloading for local packages without a build step */
transpilePackages: INTERNAL_PACKAGES, transpilePackages: INTERNAL_PACKAGES,
images: { images: getImagesConfig(),
remotePatterns: getRemotePatterns(),
},
logging: { logging: {
fetches: { fetches: {
fullUrl: true, fullUrl: true,
@@ -52,10 +50,10 @@ const config = {
: { : {
position: 'bottom-right', position: 'bottom-right',
}, },
reactCompiler: ENABLE_REACT_COMPILER,
experimental: { experimental: {
mdxRs: true, mdxRs: true,
reactCompiler: ENABLE_REACT_COMPILER, turbopackFileSystemCacheForDev: true,
clientSegmentCache: true,
optimizePackageImports: [ optimizePackageImports: [
'recharts', 'recharts',
'lucide-react', 'lucide-react',
@@ -72,7 +70,6 @@ const config = {
}, },
}, },
/** We already do linting and typechecking as separate tasks in CI */ /** We already do linting and typechecking as separate tasks in CI */
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true }, typescript: { ignoreBuildErrors: true },
}; };
@@ -80,8 +77,8 @@ export default withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true', enabled: process.env.ANALYZE === 'true',
})(config); })(config);
function getRemotePatterns() { /** @returns {import('next').NextConfig['images']} */
/** @type {import('next').NextConfig['remotePatterns']} */ function getImagesConfig() {
const remotePatterns = []; const remotePatterns = [];
if (SUPABASE_URL) { if (SUPABASE_URL) {
@@ -93,9 +90,14 @@ function getRemotePatterns() {
}); });
} }
return IS_PRODUCTION if (IS_PRODUCTION) {
? remotePatterns return {
: [ remotePatterns,
};
}
remotePatterns.push(
...[
{ {
protocol: 'http', protocol: 'http',
hostname: '127.0.0.1', hostname: '127.0.0.1',
@@ -104,7 +106,12 @@ function getRemotePatterns() {
protocol: 'http', protocol: 'http',
hostname: 'localhost', hostname: 'localhost',
}, },
]; ],
);
return {
remotePatterns,
};
} }
async function getRedirects() { async function getRedirects() {

View File

@@ -7,12 +7,12 @@
"scripts": { "scripts": {
"analyze": "ANALYZE=true pnpm run build", "analyze": "ANALYZE=true pnpm run build",
"build": "next build", "build": "next build",
"build:test": "NODE_ENV=test next build --turbopack", "build:test": "NODE_ENV=test next build",
"clean": "git clean -xdf .next .turbo node_modules", "clean": "git clean -xdf .next .turbo node_modules",
"dev": "next dev --turbo | pino-pretty -c", "dev": "next dev | pino-pretty -c",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
"format": "prettier --check \"**/*.{js,cjs,mjs,ts,tsx,md,json}\"", "format": "prettier --check \"**/*.{ts,tsx}\" --ignore-path=\"../../.prettierignore\"",
"start": "next start", "start": "next start",
"start:test": "NODE_ENV=test next start", "start:test": "NODE_ENV=test next start",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
@@ -54,20 +54,20 @@
"@makerkit/data-loader-supabase-core": "^0.0.10", "@makerkit/data-loader-supabase-core": "^0.0.10",
"@makerkit/data-loader-supabase-nextjs": "^1.2.5", "@makerkit/data-loader-supabase-nextjs": "^1.2.5",
"@marsidev/react-turnstile": "^1.3.1", "@marsidev/react-turnstile": "^1.3.1",
"@nosecone/next": "1.0.0-beta.12", "@nosecone/next": "1.0.0-beta.13",
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"next-sitemap": "^4.2.3", "next-sitemap": "^4.2.3",
"next-themes": "0.4.6", "next-themes": "0.4.6",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"recharts": "2.15.3", "recharts": "2.15.3",
"tailwind-merge": "^3.3.1", "tailwind-merge": "^3.3.1",
"zod": "^3.25.74" "zod": "^3.25.74"
@@ -76,17 +76,17 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@next/bundle-analyzer": "15.5.5", "@next/bundle-analyzer": "16.0.0",
"@tailwindcss/postcss": "^4.1.14", "@tailwindcss/postcss": "^4.1.15",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"babel-plugin-react-compiler": "19.1.0-rc.3", "babel-plugin-react-compiler": "1.0.0",
"cssnano": "^7.1.1", "cssnano": "^7.1.1",
"pino-pretty": "13.0.0", "pino-pretty": "13.1.2",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"supabase": "2.48.3", "supabase": "2.53.6",
"tailwindcss": "4.1.14", "tailwindcss": "4.1.15",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.9.3" "typescript": "^5.9.3"
}, },

View File

@@ -23,7 +23,7 @@ const getUser = (request: NextRequest, response: NextResponse) => {
return supabase.auth.getClaims(); return supabase.auth.getClaims();
}; };
export async function middleware(request: NextRequest) { export async function proxy(request: NextRequest) {
const secureHeaders = await createResponseWithSecureHeaders(); const secureHeaders = await createResponseWithSecureHeaders();
const response = NextResponse.next(secureHeaders); const response = NextResponse.next(secureHeaders);
@@ -164,9 +164,7 @@ function getPatterns() {
pattern: new URLPattern({ pathname: '/home/*?' }), pattern: new URLPattern({ pathname: '/home/*?' }),
handler: async (req: NextRequest, res: NextResponse) => { handler: async (req: NextRequest, res: NextResponse) => {
const { data } = await getUser(req, res); const { data } = await getUser(req, res);
const { origin, pathname: next } = req.nextUrl;
const origin = req.nextUrl.origin;
const next = req.nextUrl.pathname;
// If user is not logged in, redirect to sign in page. // If user is not logged in, redirect to sign in page.
if (!data?.claims) { if (!data?.claims) {

View File

@@ -126,15 +126,24 @@
"accountLinked": "Account linked", "accountLinked": "Account linked",
"unlinkAccount": "Unlink Account", "unlinkAccount": "Unlink Account",
"failedToLinkAccount": "Failed to link account", "failedToLinkAccount": "Failed to link account",
"availableAccounts": "Available Accounts", "availableMethods": "Available Methods",
"availableAccountsDescription": "Connect other authentication providers to your account", "availableMethodsDescription": "Connect your account to one or more of the following methods to sign in",
"alreadyLinkedAccountsDescription": "You have already linked these accounts", "linkedMethods": "Sign-in methods linked to your account",
"alreadyLinkedMethodsDescription": "You have already linked these accounts",
"confirmUnlinkAccount": "You are unlinking this provider.", "confirmUnlinkAccount": "You are unlinking this provider.",
"unlinkAccountConfirmation": "Are you sure you want to unlink this provider from your account? This action cannot be undone.", "unlinkAccountConfirmation": "Are you sure you want to unlink this provider from your account? This action cannot be undone.",
"unlinkingAccount": "Unlinking account...", "unlinkingAccount": "Unlinking account...",
"accountUnlinked": "Account successfully unlinked", "accountUnlinked": "Account successfully unlinked",
"linkEmailPassword": "Email & Password", "linkEmailPassword": "Email & Password",
"linkEmailPasswordDescription": "Add an email and password to your account for additional sign-in options", "linkEmailPasswordDescription": "Add password authentication to your account",
"noAccountsAvailable": "No additional accounts available to link", "noAccountsAvailable": "No other method is available at this time",
"linkAccountDescription": "Link account to sign in with {{provider}}" "linkAccountDescription": "Link account to sign in with {{provider}}",
"updatePasswordDescription": "Add password authentication to your account",
"setEmailAddress": "Set Email Address",
"setEmailDescription": "Add an email address to your account",
"setEmailSuccess": "Email set successfully",
"setEmailSuccessMessage": "We sent you an email to confirm your email address. Please check your inbox and click on the link to confirm your email address.",
"setEmailLoading": "Setting your email...",
"setEmailError": "Email not set. Please try again",
"emailNotChanged": "Your email address has not changed"
} }

View File

@@ -78,6 +78,8 @@
"methodOauthWithProvider": "<provider>{{provider}}</provider>", "methodOauthWithProvider": "<provider>{{provider}}</provider>",
"methodDefault": "another method", "methodDefault": "another method",
"existingAccountHint": "You previously signed in with <method>{{method}}</method>. <signInLink>Already have an account?</signInLink>", "existingAccountHint": "You previously signed in with <method>{{method}}</method>. <signInLink>Already have an account?</signInLink>",
"linkAccountToSignIn": "Link account to sign in",
"linkAccountToSignInDescription": "Add one or more sign-in methods to your account",
"errors": { "errors": {
"Invalid login credentials": "The credentials entered are invalid", "Invalid login credentials": "The credentials entered are invalid",
"User already registered": "This credential is already in use. Please try with another one.", "User already registered": "This credential is already in use. Please try with another one.",

View File

@@ -41,8 +41,9 @@
"contactUs": "Contact Us", "contactUs": "Contact Us",
"loading": "Loading. Please wait...", "loading": "Loading. Please wait...",
"yourAccounts": "Your Accounts", "yourAccounts": "Your Accounts",
"continue": "Continue", "continueKey": "Continue",
"skip": "Skip", "skip": "Skip",
"info": "Info",
"signedInAs": "Signed in as", "signedInAs": "Signed in as",
"pageOfPages": "Page {{page}} of {{total}}", "pageOfPages": "Page {{page}} of {{total}}",
"showingRecordCount": "Showing {{pageSize}} of {{totalCount}} rows", "showingRecordCount": "Showing {{pageSize}} of {{totalCount}} rows",

View File

@@ -151,8 +151,8 @@
"renewInvitationErrorDescription": "We encountered an error renewing the invitation. Please try again.", "renewInvitationErrorDescription": "We encountered an error renewing the invitation. Please try again.",
"signInWithDifferentAccount": "Sign in with a different account", "signInWithDifferentAccount": "Sign in with a different account",
"signInWithDifferentAccountDescription": "If you wish to accept the invitation with a different account, please sign out and back in with the account you wish to use.", "signInWithDifferentAccountDescription": "If you wish to accept the invitation with a different account, please sign out and back in with the account you wish to use.",
"acceptInvitationHeading": "Accept Invitation to join {{accountName}}", "acceptInvitationHeading": "Join {{accountName}}",
"acceptInvitationDescription": "You have been invited to join the team {{accountName}}. If you wish to accept the invitation, please click the button below.", "acceptInvitationDescription": "Click the button below to accept the invitation to join {{accountName}}",
"continueAs": "Continue as {{email}}", "continueAs": "Continue as {{email}}",
"joinTeamAccount": "Join Team", "joinTeamAccount": "Join Team",
"joiningTeam": "Joining team...", "joiningTeam": "Joining team...",

View File

@@ -1,6 +1,6 @@
{ {
"name": "next-supabase-saas-kit-turbo", "name": "next-supabase-saas-kit-turbo",
"version": "2.18.3", "version": "2.19.0",
"private": true, "private": true,
"sideEffects": false, "sideEffects": false,
"engines": { "engines": {
@@ -37,7 +37,7 @@
"env:validate": "turbo gen validate-env" "env:validate": "turbo gen validate-env"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"packageManager": "pnpm@10.17.1", "packageManager": "pnpm@10.19.0",
"devDependencies": { "devDependencies": {
"@manypkg/cli": "^0.25.1", "@manypkg/cli": "^0.25.1",
"@turbo/gen": "^2.5.8", "@turbo/gen": "^2.5.8",

View File

@@ -17,7 +17,7 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/node": "^24.6.2" "@types/node": "catalog:"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -26,14 +26,14 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@types/react": "19.1.16", "@types/react": "catalog:",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -1,11 +1,27 @@
import { Suspense, forwardRef, lazy, memo, useMemo } from 'react'; import { Suspense, lazy } from 'react';
import { Enums } from '@kit/supabase/database'; import { Enums } from '@kit/supabase/database';
import { LoadingOverlay } from '@kit/ui/loading-overlay'; import { LoadingOverlay } from '@kit/ui/loading-overlay';
type BillingProvider = Enums<'billing_provider'>; type BillingProvider = Enums<'billing_provider'>;
const Fallback = <LoadingOverlay fullPage={false} />; // Create lazy components at module level (not during render)
const StripeCheckoutLazy = lazy(async () => {
const { StripeCheckout } = await import('@kit/stripe/components');
return { default: StripeCheckout };
});
const LemonSqueezyCheckoutLazy = lazy(async () => {
const { LemonSqueezyEmbeddedCheckout } = await import(
'@kit/lemon-squeezy/components'
);
return { default: LemonSqueezyEmbeddedCheckout };
});
type CheckoutProps = {
onClose: (() => unknown) | undefined;
checkoutToken: string;
};
export function EmbeddedCheckout( export function EmbeddedCheckout(
props: React.PropsWithChildren<{ props: React.PropsWithChildren<{
@@ -14,100 +30,54 @@ export function EmbeddedCheckout(
onClose?: () => void; onClose?: () => void;
}>, }>,
) { ) {
const CheckoutComponent = useMemo(
() => loadCheckoutComponent(props.provider),
[props.provider],
);
return ( return (
<> <>
<CheckoutComponent <Suspense fallback={<LoadingOverlay fullPage={false} />}>
<CheckoutSelector
provider={props.provider}
onClose={props.onClose} onClose={props.onClose}
checkoutToken={props.checkoutToken} checkoutToken={props.checkoutToken}
/> />
</Suspense>
<BlurryBackdrop /> <BlurryBackdrop />
</> </>
); );
} }
function loadCheckoutComponent(provider: BillingProvider) { function CheckoutSelector(
switch (provider) { props: CheckoutProps & { provider: BillingProvider },
case 'stripe': {
return buildLazyComponent(() => {
return import('@kit/stripe/components').then(({ StripeCheckout }) => {
return {
default: StripeCheckout,
};
});
});
}
case 'lemon-squeezy': {
return buildLazyComponent(() => {
return import('@kit/lemon-squeezy/components').then(
({ LemonSqueezyEmbeddedCheckout }) => {
return {
default: LemonSqueezyEmbeddedCheckout,
};
},
);
});
}
case 'paddle': {
throw new Error('Paddle is not yet supported');
}
default:
throw new Error(`Unsupported provider: ${provider as string}`);
}
}
function buildLazyComponent<
Component extends React.ComponentType<{
onClose: (() => unknown) | undefined;
checkoutToken: string;
}>,
>(
load: () => Promise<{
default: Component;
}>,
fallback = Fallback,
) { ) {
let LoadedComponent: ReturnType<typeof lazy<Component>> | null = null; switch (props.provider) {
case 'stripe':
const LazyComponent = forwardRef<
React.ElementRef<'div'>,
{
onClose: (() => unknown) | undefined;
checkoutToken: string;
}
>(function LazyDynamicComponent(props, ref) {
if (!LoadedComponent) {
LoadedComponent = lazy(load);
}
return ( return (
<Suspense fallback={fallback}> <StripeCheckoutLazy
{/* @ts-expect-error: weird TS */}
<LoadedComponent
onClose={props.onClose} onClose={props.onClose}
checkoutToken={props.checkoutToken} checkoutToken={props.checkoutToken}
ref={ref}
/> />
</Suspense>
); );
});
return memo(LazyComponent); case 'lemon-squeezy':
return (
<LemonSqueezyCheckoutLazy
onClose={props.onClose}
checkoutToken={props.checkoutToken}
/>
);
case 'paddle':
throw new Error('Paddle is not yet supported');
default:
throw new Error(`Unsupported provider: ${props.provider as string}`);
}
} }
function BlurryBackdrop() { function BlurryBackdrop() {
return ( return (
<div <div
className={ className={
'bg-background/30 fixed left-0 top-0 w-full backdrop-blur-sm' + 'bg-background/30 fixed top-0 left-0 w-full backdrop-blur-sm' +
' !m-0 h-full' ' !m-0 h-full'
} }
/> />

View File

@@ -316,7 +316,7 @@ export function PlanPicker(
<div <div
className={ className={
'flex flex-col gap-y-3 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0 lg:text-right' 'flex flex-col gap-y-3 lg:flex-row lg:items-center lg:space-y-0 lg:space-x-4 lg:text-right'
} }
> >
<div> <div>
@@ -415,6 +415,7 @@ function PlanDetails({
const isRecurring = selectedPlan.paymentType === 'recurring'; const isRecurring = selectedPlan.paymentType === 'recurring';
// trick to force animation on re-render // trick to force animation on re-render
// eslint-disable-next-line react-hooks/purity
const key = Math.random(); const key = Math.random();
return ( return (

View File

@@ -422,7 +422,7 @@ function PlanIntervalSwitcher(
const selected = plan === props.interval; const selected = plan === props.interval;
const className = cn( const className = cn(
'animate-in fade-in !outline-hidden rounded-full transition-all focus:!ring-0', 'animate-in fade-in rounded-full !outline-hidden transition-all focus:!ring-0',
{ {
'border-r-transparent': index === 0, 'border-r-transparent': index === 0,
['hover:text-primary text-muted-foreground']: !selected, ['hover:text-primary text-muted-foreground']: !selected,

View File

@@ -24,9 +24,9 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@types/react": "19.1.16", "@types/react": "catalog:",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -56,8 +56,6 @@ export class LemonSqueezyBillingStrategyService
const { data: response, error } = await createLemonSqueezyCheckout(params); const { data: response, error } = await createLemonSqueezyCheckout(params);
if (error ?? !response?.data.id) { if (error ?? !response?.data.id) {
console.log(error);
logger.error( logger.error(
{ {
...ctx, ...ctx,

View File

@@ -15,9 +15,9 @@
"./components": "./src/components/index.ts" "./components": "./src/components/index.ts"
}, },
"dependencies": { "dependencies": {
"@stripe/react-stripe-js": "^5.0.0", "@stripe/react-stripe-js": "^5.2.0",
"@stripe/stripe-js": "^8.0.0", "@stripe/stripe-js": "^8.1.0",
"stripe": "^19.0.0" "stripe": "^19.1.0"
}, },
"devDependencies": { "devDependencies": {
"@kit/billing": "workspace:*", "@kit/billing": "workspace:*",
@@ -27,10 +27,10 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@types/react": "19.1.16", "@types/react": "catalog:",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -20,7 +20,7 @@
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/wordpress": "workspace:*", "@kit/wordpress": "workspace:*",
"@types/node": "^24.6.2" "@types/node": "catalog:"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -26,9 +26,9 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"@types/react": "19.1.16", "@types/react": "catalog:",
"react": "19.1.1", "react": "19.2.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -20,8 +20,8 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"@types/react": "19.1.16", "@types/react": "catalog:",
"wp-types": "^4.68.1" "wp-types": "^4.68.1"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -21,7 +21,7 @@
"@kit/stripe": "workspace:*", "@kit/stripe": "workspace:*",
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -13,7 +13,7 @@
".": "./src/index.ts" ".": "./src/index.ts"
}, },
"dependencies": { "dependencies": {
"@react-email/components": "0.5.5" "@react-email/components": "0.5.7"
}, },
"devDependencies": { "devDependencies": {
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",

View File

@@ -103,7 +103,7 @@ export async function renderInviteEmail(props: Props) {
</Section> </Section>
)} )}
<Section className="mb-[32px] mt-[32px] text-center"> <Section className="mt-[32px] mb-[32px] text-center">
<CtaButton href={props.link}>{joinTeam}</CtaButton> <CtaButton href={props.link}>{joinTeam}</CtaButton>
</Section> </Section>

View File

@@ -69,9 +69,9 @@ export async function renderOtpEmail(props: Props) {
<Text className="text-[16px] text-[#242424]">{otpText}</Text> <Text className="text-[16px] text-[#242424]">{otpText}</Text>
<Section className="mb-[16px] mt-[16px] text-center"> <Section className="mt-[16px] mb-[16px] text-center">
<Button className={'w-full rounded bg-neutral-950 text-center'}> <Button className={'w-full rounded bg-neutral-950 text-center'}>
<Text className="text-[16px] font-medium font-semibold leading-[16px] text-white"> <Text className="text-[16px] leading-[16px] font-medium font-semibold text-white">
{props.otp} {props.otp}
</Text> </Text>
</Button> </Button>

View File

@@ -34,17 +34,17 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"next-themes": "0.4.6", "next-themes": "0.4.6",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",

View File

@@ -68,27 +68,9 @@ export function AccountSelector({
return selectedAccount ?? PERSONAL_ACCOUNT_SLUG; return selectedAccount ?? PERSONAL_ACCOUNT_SLUG;
}, [selectedAccount]); }, [selectedAccount]);
const Icon = (props: { item: string }) => {
return (
<CheckCircle
className={cn(
'ml-auto h-4 w-4',
value === props.item ? 'opacity-100' : 'opacity-0',
)}
/>
);
};
const selected = accounts.find((account) => account.value === value); const selected = accounts.find((account) => account.value === value);
const pictureUrl = personalData.data?.picture_url; const pictureUrl = personalData.data?.picture_url;
const PersonalAccountAvatar = () =>
pictureUrl ? (
<UserAvatar pictureUrl={pictureUrl} />
) : (
<PersonIcon className="h-5 w-5" />
);
return ( return (
<> <>
<Popover open={open} onOpenChange={setOpen}> <Popover open={open} onOpenChange={setOpen}>
@@ -117,7 +99,7 @@ export function AccountSelector({
'gap-x-2': !collapsed, 'gap-x-2': !collapsed,
})} })}
> >
<PersonalAccountAvatar /> <PersonalAccountAvatar pictureUrl={pictureUrl} />
<span <span
className={cn('truncate', { className={cn('truncate', {
@@ -136,7 +118,7 @@ export function AccountSelector({
'gap-x-2': !collapsed, 'gap-x-2': !collapsed,
})} })}
> >
<Avatar className={'rounded-xs h-6 w-6'}> <Avatar className={'h-6 w-6 rounded-xs'}>
<AvatarImage src={account.image ?? undefined} /> <AvatarImage src={account.image ?? undefined} />
<AvatarFallback <AvatarFallback
@@ -176,6 +158,7 @@ export function AccountSelector({
<CommandList> <CommandList>
<CommandGroup> <CommandGroup>
<CommandItem <CommandItem
className="shadow-none"
onSelect={() => onAccountChange(undefined)} onSelect={() => onAccountChange(undefined)}
value={PERSONAL_ACCOUNT_SLUG} value={PERSONAL_ACCOUNT_SLUG}
> >
@@ -185,7 +168,7 @@ export function AccountSelector({
<Trans i18nKey={'teams:personalAccount'} /> <Trans i18nKey={'teams:personalAccount'} />
</span> </span>
<Icon item={PERSONAL_ACCOUNT_SLUG} /> <Icon selected={value === PERSONAL_ACCOUNT_SLUG} />
</CommandItem> </CommandItem>
</CommandGroup> </CommandGroup>
@@ -206,7 +189,7 @@ export function AccountSelector({
data-name={account.label} data-name={account.label}
data-slug={account.value} data-slug={account.value}
className={cn( className={cn(
'group my-1 flex justify-between transition-colors', 'group my-1 flex justify-between shadow-none transition-colors',
{ {
['bg-muted']: value === account.value, ['bg-muted']: value === account.value,
}, },
@@ -222,7 +205,7 @@ export function AccountSelector({
}} }}
> >
<div className={'flex items-center'}> <div className={'flex items-center'}>
<Avatar className={'rounded-xs mr-2 h-6 w-6'}> <Avatar className={'mr-2 h-6 w-6 rounded-xs'}>
<AvatarImage src={account.image ?? undefined} /> <AvatarImage src={account.image ?? undefined} />
<AvatarFallback <AvatarFallback
@@ -241,7 +224,7 @@ export function AccountSelector({
</span> </span>
</div> </div>
<Icon item={account.value ?? ''} /> <Icon selected={(account.value ?? '') === value} />
</CommandItem> </CommandItem>
))} ))}
</CommandGroup> </CommandGroup>
@@ -286,8 +269,24 @@ export function AccountSelector({
function UserAvatar(props: { pictureUrl?: string }) { function UserAvatar(props: { pictureUrl?: string }) {
return ( return (
<Avatar className={'rounded-xs h-6 w-6'}> <Avatar className={'h-6 w-6 rounded-xs'}>
<AvatarImage src={props.pictureUrl} /> <AvatarImage src={props.pictureUrl} />
</Avatar> </Avatar>
); );
} }
function Icon({ selected }: { selected: boolean }) {
return (
<CheckCircle
className={cn('ml-auto h-4 w-4', selected ? 'opacity-100' : 'opacity-0')}
/>
);
}
function PersonalAccountAvatar({ pictureUrl }: { pictureUrl?: string | null }) {
return pictureUrl ? (
<UserAvatar pictureUrl={pictureUrl} />
) : (
<PersonIcon className="h-5 w-5" />
);
}

View File

@@ -156,7 +156,6 @@ export function PersonalAccountSettingsContainer(
</CardContent> </CardContent>
</Card> </Card>
<If condition={props.features.enableAccountLinking}>
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle> <CardTitle>
@@ -169,10 +168,14 @@ export function PersonalAccountSettingsContainer(
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<LinkAccountsList providers={props.providers} /> <LinkAccountsList
providers={props.providers}
enabled={props.features.enableAccountLinking}
showEmailOption
showPasswordOption
/>
</CardContent> </CardContent>
</Card> </Card>
</If>
<If condition={props.features.enableAccountDeletion}> <If condition={props.features.enableAccountDeletion}>
<Card className={'border-destructive'}> <Card className={'border-destructive'}>

View File

@@ -27,26 +27,46 @@ import { Trans } from '@kit/ui/trans';
import { UpdateEmailSchema } from '../../../schema/update-email.schema'; import { UpdateEmailSchema } from '../../../schema/update-email.schema';
function createEmailResolver(currentEmail: string, errorMessage: string) { function createEmailResolver(
currentEmail: string | null,
emailsNotMatchingMessage: string,
emailNotChangedMessage: string,
) {
const schema = UpdateEmailSchema.withTranslation(emailsNotMatchingMessage);
// If there's a current email, ensure the new email is different
if (currentEmail) {
return zodResolver( return zodResolver(
UpdateEmailSchema.withTranslation(errorMessage).refine((schema) => { schema.refine(
return schema.email !== currentEmail; (data) => {
}), return data.email !== currentEmail;
},
{
path: ['email'],
message: emailNotChangedMessage,
},
),
); );
} }
// If no current email, just validate the schema
return zodResolver(schema);
}
export function UpdateEmailForm({ export function UpdateEmailForm({
email, email,
callbackPath, callbackPath,
onSuccess,
}: { }: {
email: string; email?: string | null;
callbackPath: string; callbackPath: string;
onSuccess?: () => void;
}) { }) {
const { t } = useTranslation('account'); const { t } = useTranslation('account');
const updateUserMutation = useUpdateUser(); const updateUserMutation = useUpdateUser();
const isSettingEmail = !email;
const updateEmail = ({ email }: { email: string }) => { const updateEmail = ({ email }: { email: string }) => {
// then, we update the user's email address
const promise = async () => { const promise = async () => {
const redirectTo = new URL( const redirectTo = new URL(
callbackPath, callbackPath,
@@ -54,17 +74,25 @@ export function UpdateEmailForm({
).toString(); ).toString();
await updateUserMutation.mutateAsync({ email, redirectTo }); await updateUserMutation.mutateAsync({ email, redirectTo });
if (onSuccess) {
onSuccess();
}
}; };
toast.promise(promise, { toast.promise(promise, {
success: t(`updateEmailSuccess`), success: t(isSettingEmail ? 'setEmailSuccess' : 'updateEmailSuccess'),
loading: t(`updateEmailLoading`), loading: t(isSettingEmail ? 'setEmailLoading' : 'updateEmailLoading'),
error: t(`updateEmailError`), error: t(isSettingEmail ? 'setEmailError' : 'updateEmailError'),
}); });
}; };
const form = useForm({ const form = useForm({
resolver: createEmailResolver(email, t('emailNotMatching')), resolver: createEmailResolver(
email ?? null,
t('emailNotMatching'),
t('emailNotChanged'),
),
defaultValues: { defaultValues: {
email: '', email: '',
repeatEmail: '', repeatEmail: '',
@@ -83,11 +111,23 @@ export function UpdateEmailForm({
<CheckIcon className={'h-4'} /> <CheckIcon className={'h-4'} />
<AlertTitle> <AlertTitle>
<Trans i18nKey={'account:updateEmailSuccess'} /> <Trans
i18nKey={
isSettingEmail
? 'account:setEmailSuccess'
: 'account:updateEmailSuccess'
}
/>
</AlertTitle> </AlertTitle>
<AlertDescription> <AlertDescription>
<Trans i18nKey={'account:updateEmailSuccessMessage'} /> <Trans
i18nKey={
isSettingEmail
? 'account:setEmailSuccessMessage'
: 'account:updateEmailSuccessMessage'
}
/>
</AlertDescription> </AlertDescription>
</Alert> </Alert>
</If> </If>
@@ -107,7 +147,11 @@ export function UpdateEmailForm({
data-test={'account-email-form-email-input'} data-test={'account-email-form-email-input'}
required required
type={'email'} type={'email'}
placeholder={t('account:newEmail')} placeholder={t(
isSettingEmail
? 'account:emailAddress'
: 'account:newEmail',
)}
{...field} {...field}
/> />
</InputGroup> </InputGroup>
@@ -147,7 +191,13 @@ export function UpdateEmailForm({
<div> <div>
<Button disabled={updateUserMutation.isPending}> <Button disabled={updateUserMutation.isPending}>
<Trans i18nKey={'account:updateEmailSubmitLabel'} /> <Trans
i18nKey={
isSettingEmail
? 'account:setEmailAddress'
: 'account:updateEmailSubmitLabel'
}
/>
</Button> </Button>
</div> </div>
</div> </div>

View File

@@ -1,11 +1,14 @@
'use client'; 'use client';
import { Suspense, useState } from 'react';
import { usePathname } from 'next/navigation';
import type { Provider, UserIdentity } from '@supabase/supabase-js'; import type { Provider, UserIdentity } from '@supabase/supabase-js';
import { CheckCircle } from 'lucide-react';
import { useLinkIdentityWithProvider } from '@kit/supabase/hooks/use-link-identity-with-provider'; import { useLinkIdentityWithProvider } from '@kit/supabase/hooks/use-link-identity-with-provider';
import { useUnlinkUserIdentity } from '@kit/supabase/hooks/use-unlink-user-identity'; import { useUnlinkUserIdentity } from '@kit/supabase/hooks/use-unlink-user-identity';
import { useUser } from '@kit/supabase/hooks/use-user';
import { useUserIdentities } from '@kit/supabase/hooks/use-user-identities'; import { useUserIdentities } from '@kit/supabase/hooks/use-user-identities';
import { import {
AlertDialog, AlertDialog,
@@ -19,6 +22,14 @@ import {
AlertDialogTrigger, AlertDialogTrigger,
} from '@kit/ui/alert-dialog'; } from '@kit/ui/alert-dialog';
import { Button } from '@kit/ui/button'; import { Button } from '@kit/ui/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@kit/ui/dialog';
import { If } from '@kit/ui/if'; import { If } from '@kit/ui/if';
import { import {
Item, Item,
@@ -35,9 +46,21 @@ import { toast } from '@kit/ui/sonner';
import { Spinner } from '@kit/ui/spinner'; import { Spinner } from '@kit/ui/spinner';
import { Trans } from '@kit/ui/trans'; import { Trans } from '@kit/ui/trans';
export function LinkAccountsList(props: { providers: Provider[] }) { import { UpdateEmailForm } from '../email/update-email-form';
import { UpdatePasswordForm } from '../password/update-password-form';
interface LinkAccountsListProps {
providers: Provider[];
showPasswordOption?: boolean;
showEmailOption?: boolean;
enabled?: boolean;
redirectTo?: string;
}
export function LinkAccountsList(props: LinkAccountsListProps) {
const unlinkMutation = useUnlinkUserIdentity(); const unlinkMutation = useUnlinkUserIdentity();
const linkMutation = useLinkIdentityWithProvider(); const linkMutation = useLinkIdentityWithProvider();
const pathname = usePathname();
const { const {
identities, identities,
@@ -46,14 +69,40 @@ export function LinkAccountsList(props: { providers: Provider[] }) {
isLoading: isLoadingIdentities, isLoading: isLoadingIdentities,
} = useUserIdentities(); } = useUserIdentities();
// Only show providers from the allowed list that aren't already connected // Get user email from email identity
const availableProviders = props.providers.filter( const emailIdentity = identities.find(
(provider) => !isProviderConnected(provider), (identity) => identity.provider === 'email',
);
const userEmail = (emailIdentity?.identity_data?.email as string) || '';
// If enabled, display available providers
const availableProviders = props.enabled
? props.providers.filter((provider) => !isProviderConnected(provider))
: [];
const user = useUser();
const amr = user.data ? user.data.amr : [];
const isConnectedWithPassword = amr.some(
(item: { method: string }) => item.method === 'password',
); );
// Show all connected identities, even if their provider isn't in the allowed providers list // Show all connected identities, even if their provider isn't in the allowed providers list
const connectedIdentities = identities; const connectedIdentities = identities;
const canLinkEmailAccount = !emailIdentity && props.showEmailOption;
const canLinkPassword =
emailIdentity && props.showPasswordOption && !isConnectedWithPassword;
const shouldDisplayAvailableAccountsSection =
canLinkEmailAccount || canLinkPassword || availableProviders.length;
/**
* @name handleUnlinkAccount
* @param identity
*/
const handleUnlinkAccount = (identity: UserIdentity) => { const handleUnlinkAccount = (identity: UserIdentity) => {
const promise = unlinkMutation.mutateAsync(identity); const promise = unlinkMutation.mutateAsync(identity);
@@ -64,6 +113,10 @@ export function LinkAccountsList(props: { providers: Provider[] }) {
}); });
}; };
/**
* @name handleLinkAccount
* @param provider
*/
const handleLinkAccount = (provider: Provider) => { const handleLinkAccount = (provider: Provider) => {
const promise = linkMutation.mutateAsync(provider); const promise = linkMutation.mutateAsync(provider);
@@ -83,33 +136,32 @@ export function LinkAccountsList(props: { providers: Provider[] }) {
} }
return ( return (
<div className="space-y-6"> <div className="space-y-4">
{/* Linked Accounts Section */}
<If condition={connectedIdentities.length > 0}> <If condition={connectedIdentities.length > 0}>
<div className="space-y-3"> <div className="space-y-2.5">
<div> <div>
<h3 className="text-foreground text-sm font-medium"> <h3 className="text-foreground text-sm font-medium">
<Trans i18nKey={'account:linkedAccounts'} /> <Trans i18nKey={'account:linkedMethods'} />
</h3> </h3>
<p className="text-muted-foreground text-xs"> <p className="text-muted-foreground text-xs">
<Trans i18nKey={'account:alreadyLinkedAccountsDescription'} /> <Trans i18nKey={'account:alreadyLinkedMethodsDescription'} />
</p> </p>
</div> </div>
<div className="flex flex-col space-y-2"> <div className="flex flex-col space-y-2">
{connectedIdentities.map((identity) => ( {connectedIdentities.map((identity) => (
<Item key={identity.id} variant="outline"> <Item key={identity.id} variant="muted">
<ItemMedia> <ItemMedia>
<div className="text-muted-foreground flex h-5 w-5 items-center justify-center">
<OauthProviderLogoImage providerId={identity.provider} /> <OauthProviderLogoImage providerId={identity.provider} />
</div>
</ItemMedia> </ItemMedia>
<ItemContent> <ItemContent>
<ItemHeader className="flex items-center gap-3"> <ItemHeader>
<div className="flex flex-col"> <div className="flex flex-col">
<ItemTitle className="flex items-center gap-x-2 text-sm font-medium capitalize"> <ItemTitle className="text-sm font-medium capitalize">
<CheckCircle className="h-3 w-3 text-green-500" />
<span>{identity.provider}</span> <span>{identity.provider}</span>
</ItemTitle> </ItemTitle>
@@ -174,22 +226,35 @@ export function LinkAccountsList(props: { providers: Provider[] }) {
</div> </div>
</If> </If>
{/* Available Accounts Section */} <If
<If condition={availableProviders.length > 0}> condition={shouldDisplayAvailableAccountsSection}
fallback={<NoAccountsAvailable />}
>
<Separator /> <Separator />
<div className="space-y-3"> <div className="space-y-2.5">
<div> <div>
<h3 className="text-foreground text-sm font-medium"> <h3 className="text-foreground text-sm font-medium">
<Trans i18nKey={'account:availableAccounts'} /> <Trans i18nKey={'account:availableMethods'} />
</h3> </h3>
<p className="text-muted-foreground text-xs"> <p className="text-muted-foreground text-xs">
<Trans i18nKey={'account:availableAccountsDescription'} /> <Trans i18nKey={'account:availableMethodsDescription'} />
</p> </p>
</div> </div>
<div className="flex flex-col space-y-2"> <div className="flex flex-col space-y-2">
<If condition={canLinkEmailAccount}>
<UpdateEmailDialog redirectTo={pathname} />
</If>
<If condition={canLinkPassword}>
<UpdatePasswordDialog
userEmail={userEmail}
redirectTo={props.redirectTo || '/home'}
/>
</If>
{availableProviders.map((provider) => ( {availableProviders.map((provider) => (
<Item <Item
key={provider} key={provider}
@@ -217,16 +282,134 @@ export function LinkAccountsList(props: { providers: Provider[] }) {
</div> </div>
</div> </div>
</If> </If>
<If
condition={
connectedIdentities.length === 0 && availableProviders.length === 0
}
>
<div className="text-muted-foreground py-8 text-center">
<Trans i18nKey={'account:noAccountsAvailable'} />
</div>
</If>
</div> </div>
); );
} }
function NoAccountsAvailable() {
return (
<div>
<span className="text-muted-foreground text-xs">
<Trans i18nKey={'account:noAccountsAvailable'} />
</span>
</div>
);
}
function UpdateEmailDialog(props: { redirectTo: string }) {
const [open, setOpen] = useState(false);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Item variant="outline" role="button" className="hover:bg-muted/50">
<ItemMedia>
<div className="text-muted-foreground flex h-5 w-5 items-center justify-center">
<OauthProviderLogoImage providerId={'email'} />
</div>
</ItemMedia>
<ItemContent>
<ItemHeader>
<div className="flex flex-col">
<ItemTitle className="text-sm font-medium">
<Trans i18nKey={'account:setEmailAddress'} />
</ItemTitle>
<ItemDescription>
<Trans i18nKey={'account:setEmailDescription'} />
</ItemDescription>
</div>
</ItemHeader>
</ItemContent>
</Item>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>
<Trans i18nKey={'account:setEmailAddress'} />
</DialogTitle>
<DialogDescription>
<Trans i18nKey={'account:setEmailDescription'} />
</DialogDescription>
</DialogHeader>
<Suspense
fallback={
<div className="flex items-center justify-center">
<Spinner />
</div>
}
>
<UpdateEmailForm
callbackPath={props.redirectTo}
onSuccess={() => {
setOpen(false);
}}
/>
</Suspense>
</DialogContent>
</Dialog>
);
}
function UpdatePasswordDialog(props: {
redirectTo: string;
userEmail: string;
}) {
const [open, setOpen] = useState(false);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Item variant="outline" role="button" className="hover:bg-muted/50">
<ItemMedia>
<div className="text-muted-foreground flex h-5 w-5 items-center justify-center">
<OauthProviderLogoImage providerId={'password'} />
</div>
</ItemMedia>
<ItemContent>
<ItemHeader>
<div className="flex flex-col">
<ItemTitle className="text-sm font-medium">
<Trans i18nKey={'account:linkEmailPassword'} />
</ItemTitle>
<ItemDescription>
<Trans i18nKey={'account:updatePasswordDescription'} />
</ItemDescription>
</div>
</ItemHeader>
</ItemContent>
</Item>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>
<Trans i18nKey={'account:linkEmailPassword'} />
</DialogTitle>
</DialogHeader>
<Suspense
fallback={
<div className="flex items-center justify-center">
<Spinner />
</div>
}
>
<UpdatePasswordForm
callbackPath={props.redirectTo}
email={props.userEmail}
onSuccess={() => {
setOpen(false);
}}
/>
</Suspense>
</DialogContent>
</Dialog>
);
}

View File

@@ -2,9 +2,11 @@
import { useState } from 'react'; import { useState } from 'react';
import type { PostgrestError } from '@supabase/supabase-js';
import { zodResolver } from '@hookform/resolvers/zod'; import { zodResolver } from '@hookform/resolvers/zod';
import { ExclamationTriangleIcon } from '@radix-ui/react-icons'; import { ExclamationTriangleIcon } from '@radix-ui/react-icons';
import { Check, Lock } from 'lucide-react'; import { Check, Lock, XIcon } from 'lucide-react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -33,9 +35,11 @@ import { PasswordUpdateSchema } from '../../../schema/update-password.schema';
export const UpdatePasswordForm = ({ export const UpdatePasswordForm = ({
email, email,
callbackPath, callbackPath,
onSuccess,
}: { }: {
email: string; email: string;
callbackPath: string; callbackPath: string;
onSuccess?: () => void;
}) => { }) => {
const { t } = useTranslation('account'); const { t } = useTranslation('account');
const updateUserMutation = useUpdateUser(); const updateUserMutation = useUpdateUser();
@@ -46,6 +50,7 @@ export const UpdatePasswordForm = ({
const promise = updateUserMutation const promise = updateUserMutation
.mutateAsync({ password, redirectTo }) .mutateAsync({ password, redirectTo })
.then(onSuccess)
.catch((error) => { .catch((error) => {
if ( if (
typeof error === 'string' && typeof error === 'string' &&
@@ -57,11 +62,13 @@ export const UpdatePasswordForm = ({
} }
}); });
toast.promise(() => promise, { toast
.promise(() => promise, {
success: t(`updatePasswordSuccess`), success: t(`updatePasswordSuccess`),
error: t(`updatePasswordError`), error: t(`updatePasswordError`),
loading: t(`updatePasswordLoading`), loading: t(`updatePasswordLoading`),
}); })
.unwrap();
}; };
const updatePasswordCallback = async ({ const updatePasswordCallback = async ({
@@ -99,6 +106,10 @@ export const UpdatePasswordForm = ({
<SuccessAlert /> <SuccessAlert />
</If> </If>
<If condition={updateUserMutation.error}>
{(error) => <ErrorAlert error={error as PostgrestError} />}
</If>
<If condition={needsReauthentication}> <If condition={needsReauthentication}>
<NeedsReauthenticationAlert /> <NeedsReauthenticationAlert />
</If> </If>
@@ -177,6 +188,27 @@ export const UpdatePasswordForm = ({
); );
}; };
function ErrorAlert({ error }: { error: { code: string } }) {
const { t } = useTranslation();
return (
<Alert variant={'destructive'}>
<XIcon className={'h-4'} />
<AlertTitle>
<Trans i18nKey={'account:updatePasswordError'} />
</AlertTitle>
<AlertDescription>
<Trans
i18nKey={`auth:errors.${error.code}`}
defaults={t('auth:resetPasswordError')}
/>
</AlertDescription>
</Alert>
);
}
function SuccessAlert() { function SuccessAlert() {
return ( return (
<Alert variant={'success'}> <Alert variant={'success'}>

View File

@@ -20,15 +20,15 @@
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@makerkit/data-loader-supabase-core": "^0.0.10", "@makerkit/data-loader-supabase-core": "^0.0.10",
"@makerkit/data-loader-supabase-nextjs": "^1.2.5", "@makerkit/data-loader-supabase-nextjs": "^1.2.5",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@types/react": "19.1.16", "@types/react": "catalog:",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"exports": { "exports": {

View File

@@ -6,7 +6,7 @@ import { usePathname, useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod'; import { zodResolver } from '@hookform/resolvers/zod';
import { ColumnDef } from '@tanstack/react-table'; import { ColumnDef } from '@tanstack/react-table';
import { EllipsisVertical } from 'lucide-react'; import { EllipsisVertical } from 'lucide-react';
import { useForm } from 'react-hook-form'; import { useForm, useWatch } from 'react-hook-form';
import { z } from 'zod'; import { z } from 'zod';
import { Tables } from '@kit/supabase/database'; import { Tables } from '@kit/supabase/database';
@@ -103,6 +103,8 @@ function AccountsTableFilters(props: {
router.push(url); router.push(url);
}; };
const type = useWatch({ control: form.control, name: 'type' });
return ( return (
<Form {...form}> <Form {...form}>
<form <form
@@ -110,7 +112,7 @@ function AccountsTableFilters(props: {
onSubmit={form.handleSubmit((data) => onSubmit(data))} onSubmit={form.handleSubmit((data) => onSubmit(data))}
> >
<Select <Select
value={form.watch('type')} value={type}
onValueChange={(value) => { onValueChange={(value) => {
form.setValue( form.setValue(
'type', 'type',

View File

@@ -143,7 +143,7 @@ export function AdminCreateUserDialog(props: React.PropsWithChildren) {
<FormField <FormField
name={'emailConfirm'} name={'emailConfirm'}
render={({ field }) => ( render={({ field }) => (
<FormItem className="flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4"> <FormItem className="flex flex-row items-start space-y-0 space-x-3 rounded-md border p-4">
<FormControl> <FormControl>
<Checkbox <Checkbox
checked={field.value} checked={field.value}

View File

@@ -29,13 +29,13 @@
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@marsidev/react-turnstile": "^1.3.1", "@marsidev/react-turnstile": "^1.3.1",
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@types/react": "19.1.16", "@types/react": "catalog:",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },

View File

@@ -1,21 +1,29 @@
import { cn } from '@kit/ui/utils';
export function AuthLayoutShell({ export function AuthLayoutShell({
children, children,
className,
Logo, Logo,
contentClassName,
}: React.PropsWithChildren<{ }: React.PropsWithChildren<{
Logo?: React.ComponentType; Logo?: React.ComponentType;
className?: string;
contentClassName?: string;
}>) { }>) {
return ( return (
<div <div
className={ className={cn(
'flex h-screen flex-col items-center justify-center' + 'bg-background lg:bg-muted/30 animate-in fade-in slide-in-from-top-16 zoom-in-95 flex h-screen flex-col items-center justify-center gap-y-10 duration-1000 lg:gap-y-8',
' bg-background lg:bg-muted/30 gap-y-10 lg:gap-y-8' + className,
' animate-in fade-in slide-in-from-top-16 zoom-in-95 duration-1000' )}
}
> >
{Logo ? <Logo /> : null} {Logo ? <Logo /> : null}
<div <div
className={`bg-background flex w-full max-w-[23rem] flex-col gap-y-6 rounded-lg px-6 md:w-8/12 md:px-8 md:py-6 lg:w-5/12 lg:px-8 xl:w-4/12 xl:py-8`} className={cn(
'bg-background flex w-full max-w-[23rem] flex-col gap-y-6 rounded-lg px-6 md:w-8/12 md:px-8 md:py-6 lg:w-5/12 lg:px-8 xl:w-4/12 xl:py-8',
contentClassName,
)}
> >
{children} {children}
</div> </div>

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useEffect } from 'react'; import { useEffect, useEffectEvent } from 'react';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
@@ -227,12 +227,16 @@ function FactorsListContainer({
const isSuccess = factors && !isLoading && !error; const isSuccess = factors && !isLoading && !error;
const signOutFn = useEffectEvent(() => {
void signOut.mutateAsync();
});
useEffect(() => { useEffect(() => {
// If there is an error, sign out // If there is an error, sign out
if (error) { if (error) {
void signOut.mutateAsync(); void signOutFn();
} }
}, [error, signOut]); }, [error]);
useEffect(() => { useEffect(() => {
// If there is only one factor, select it automatically // If there is only one factor, select it automatically

View File

@@ -1,12 +1,12 @@
'use client'; 'use client';
import Link from 'next/link'; import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod'; import { zodResolver } from '@hookform/resolvers/zod';
import { CheckIcon, ExclamationTriangleIcon } from '@radix-ui/react-icons'; import { ExclamationTriangleIcon } from '@radix-ui/react-icons';
import { ArrowRightIcon } from 'lucide-react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { toast } from 'sonner';
import type { z } from 'zod'; import type { z } from 'zod';
import { useUpdateUser } from '@kit/supabase/hooks/use-update-user-mutation'; import { useUpdateUser } from '@kit/supabase/hooks/use-update-user-mutation';
@@ -26,8 +26,13 @@ import { Trans } from '@kit/ui/trans';
import { PasswordResetSchema } from '../schemas/password-reset.schema'; import { PasswordResetSchema } from '../schemas/password-reset.schema';
export function UpdatePasswordForm(params: { redirectTo: string }) { export function UpdatePasswordForm(params: {
redirectTo: string;
heading?: React.ReactNode;
}) {
const updateUser = useUpdateUser(); const updateUser = useUpdateUser();
const router = useRouter();
const { t } = useTranslation();
const form = useForm<z.infer<typeof PasswordResetSchema>>({ const form = useForm<z.infer<typeof PasswordResetSchema>>({
resolver: zodResolver(PasswordResetSchema), resolver: zodResolver(PasswordResetSchema),
@@ -43,26 +48,28 @@ export function UpdatePasswordForm(params: { redirectTo: string }) {
return <ErrorState error={error} onRetry={() => updateUser.reset()} />; return <ErrorState error={error} onRetry={() => updateUser.reset()} />;
} }
if (updateUser.data && !updateUser.isPending) {
return <SuccessState redirectTo={params.redirectTo} />;
}
return ( return (
<div className={'flex w-full flex-col space-y-6'}> <div className={'flex w-full flex-col space-y-6'}>
<div className={'flex justify-center'}> <div className={'flex justify-center'}>
<Heading level={5} className={'tracking-tight'}> {params.heading && (
<Trans i18nKey={'auth:passwordResetLabel'} /> <Heading className={'text-center'} level={4}>
{params.heading}
</Heading> </Heading>
)}
</div> </div>
<Form {...form}> <Form {...form}>
<form <form
className={'flex w-full flex-1 flex-col'} className={'flex w-full flex-1 flex-col'}
onSubmit={form.handleSubmit(({ password }) => { onSubmit={form.handleSubmit(async ({ password }) => {
return updateUser.mutateAsync({ await updateUser.mutateAsync({
password, password,
redirectTo: params.redirectTo, redirectTo: params.redirectTo,
}); });
router.replace(params.redirectTo);
toast.success(t('account:updatePasswordSuccessMessage'));
})} })}
> >
<div className={'flex-col space-y-4'}> <div className={'flex-col space-y-4'}>
@@ -75,7 +82,12 @@ export function UpdatePasswordForm(params: { redirectTo: string }) {
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Input required type="password" {...field} /> <Input
required
type="password"
autoComplete={'new-password'}
{...field}
/>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
@@ -114,34 +126,6 @@ export function UpdatePasswordForm(params: { redirectTo: string }) {
); );
} }
function SuccessState(props: { redirectTo: string }) {
return (
<div className={'flex flex-col space-y-4'}>
<Alert variant={'success'}>
<CheckIcon className={'s-6'} />
<AlertTitle>
<Trans i18nKey={'account:updatePasswordSuccess'} />
</AlertTitle>
<AlertDescription>
<Trans i18nKey={'account:updatePasswordSuccessMessage'} />
</AlertDescription>
</Alert>
<Link href={props.redirectTo}>
<Button variant={'outline'} className={'w-full'}>
<span>
<Trans i18nKey={'common:backToHomePage'} />
</span>
<ArrowRightIcon className={'ml-2 h-4'} />
</Button>
</Link>
</div>
);
}
function ErrorState(props: { function ErrorState(props: {
onRetry: () => void; onRetry: () => void;
error: { error: {

View File

@@ -19,13 +19,13 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@types/react": "19.1.16", "@types/react": "catalog:",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-i18next": "^16.0.0" "react-i18next": "^16.1.4"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"typesVersions": { "typesVersions": {
@@ -34,5 +34,8 @@
"src/*" "src/*"
] ]
} }
},
"dependencies": {
"@types/node": "catalog:"
} }
} }

View File

@@ -116,7 +116,7 @@ export function NotificationsPopover(params: {
<span <span
className={cn( className={cn(
`fade-in animate-in zoom-in absolute right-1 top-1 mt-0 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-red-500 text-[0.65rem] text-white`, `fade-in animate-in zoom-in absolute top-1 right-1 mt-0 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-red-500 text-[0.65rem] text-white`,
{ {
hidden: !notifications.length, hidden: !notifications.length,
}, },
@@ -176,7 +176,7 @@ export function NotificationsPopover(params: {
<div <div
key={notification.id.toString()} key={notification.id.toString()}
className={cn( className={cn(
'min-h-18 flex flex-col items-start justify-center gap-y-1 px-3 py-2', 'flex min-h-18 flex-col items-start justify-center gap-y-1 px-3 py-2',
)} )}
onClick={() => { onClick={() => {
if (params.onClick) { if (params.onClick) {

View File

@@ -36,19 +36,19 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",

View File

@@ -25,7 +25,7 @@ export function AcceptInvitationContainer(props: {
paths: { paths: {
signOutNext: string; signOutNext: string;
accountHome: string; nextPath: string;
}; };
}) { }) {
return ( return (
@@ -71,7 +71,7 @@ export function AcceptInvitationContainer(props: {
<input <input
type={'hidden'} type={'hidden'}
name={'nextPath'} name={'nextPath'}
value={props.paths.accountHome} value={props.paths.nextPath}
/> />
<InvitationSubmitButton <InvitationSubmitButton

View File

@@ -25,7 +25,6 @@ export const TeamNameSchema = z
.max(50) .max(50)
.refine( .refine(
(name) => { (name) => {
console.log(name);
return !SPECIAL_CHARACTERS_REGEX.test(name); return !SPECIAL_CHARACTERS_REGEX.test(name);
}, },
{ {

View File

@@ -20,14 +20,14 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"next": "15.5.5", "next": "16.0.0",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-i18next": "^16.0.0" "react-i18next": "^16.1.4"
}, },
"dependencies": { "dependencies": {
"i18next": "25.5.3", "i18next": "25.6.0",
"i18next-browser-languagedetector": "8.2.0", "i18next-browser-languagedetector": "8.2.0",
"i18next-resources-to-backend": "^1.2.1" "i18next-resources-to-backend": "^1.2.1"
}, },

View File

@@ -20,7 +20,7 @@
"@kit/resend": "workspace:*", "@kit/resend": "workspace:*",
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -13,7 +13,7 @@
".": "./src/index.ts" ".": "./src/index.ts"
}, },
"dependencies": { "dependencies": {
"nodemailer": "^7.0.6" "nodemailer": "^7.0.9"
}, },
"devDependencies": { "devDependencies": {
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",

View File

@@ -17,7 +17,7 @@
"@kit/mailers-shared": "workspace:*", "@kit/mailers-shared": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -24,8 +24,8 @@
"devDependencies": { "devDependencies": {
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@modelcontextprotocol/sdk": "1.18.2", "@modelcontextprotocol/sdk": "1.20.1",
"@types/node": "^24.6.2", "@types/node": "catalog:",
"postgres": "3.4.7", "postgres": "3.4.7",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },

View File

@@ -1,8 +1,7 @@
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { exec } from 'node:child_process'; import { execSync } from 'node:child_process';
import { readFile, readdir } from 'node:fs/promises'; import { readFile, readdir } from 'node:fs/promises';
import { join } from 'node:path'; import { join } from 'node:path';
import { promisify } from 'node:util';
import { z } from 'zod'; import { z } from 'zod';
export class MigrationsTool { export class MigrationsTool {
@@ -20,11 +19,11 @@ export class MigrationsTool {
} }
static CreateMigration(name: string) { static CreateMigration(name: string) {
return promisify(exec)(`pnpm --filter web supabase migrations new ${name}`); return execSync(`pnpm --filter web supabase migrations new ${name}`);
} }
static Diff() { static Diff() {
return promisify(exec)(`supabase db diff`); return execSync(`pnpm --filter web supabase db diff`);
} }
} }
@@ -40,13 +39,14 @@ function createDiffMigrationTool(server: McpServer) {
'diff_migrations', 'diff_migrations',
'Compare differences between the declarative schemas and the applied migrations in Supabase', 'Compare differences between the declarative schemas and the applied migrations in Supabase',
async () => { async () => {
const { stdout } = await MigrationsTool.Diff(); const result = MigrationsTool.Diff();
const text = result.toString('utf8');
return { return {
content: [ content: [
{ {
type: 'text', type: 'text',
text: stdout, text,
}, },
], ],
}; };
@@ -64,13 +64,14 @@ function createCreateMigrationTool(server: McpServer) {
}), }),
}, },
async ({ state }) => { async ({ state }) => {
const { stdout } = await MigrationsTool.CreateMigration(state.name); const result = MigrationsTool.CreateMigration(state.name);
const text = result.toString('utf8');
return { return {
content: [ content: [
{ {
type: 'text', type: 'text',
text: stdout, text,
}, },
], ],
}; };

View File

@@ -23,8 +23,8 @@
"@kit/sentry": "workspace:*", "@kit/sentry": "workspace:*",
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.1.16", "@types/react": "catalog:",
"react": "19.1.1", "react": "19.2.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -17,8 +17,8 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.1.16", "@types/react": "catalog:",
"react": "19.1.1" "react": "19.2.0"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -16,16 +16,15 @@
"./config/server": "./src/sentry.client.server.ts" "./config/server": "./src/sentry.client.server.ts"
}, },
"dependencies": { "dependencies": {
"@sentry/nextjs": "^10.17.0", "@sentry/nextjs": "^10.21.0"
"import-in-the-middle": "1.14.4"
}, },
"devDependencies": { "devDependencies": {
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/monitoring-core": "workspace:*", "@kit/monitoring-core": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.1.16", "@types/react": "catalog:",
"react": "19.1.1" "react": "19.2.0"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -20,8 +20,8 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"next": "15.5.5", "next": "16.0.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -25,12 +25,12 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"react": "19.1.1", "react": "19.2.0",
"react-dom": "19.1.1", "react-dom": "19.2.0",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -20,10 +20,10 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.1.16" "@types/react": "catalog:"
}, },
"dependencies": { "dependencies": {
"pino": "^9.12.0" "pino": "^10.1.0"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -26,11 +26,12 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/ssr": "^0.7.0", "@supabase/ssr": "^0.7.0",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@types/react": "19.1.16", "@types/node": "catalog:",
"next": "15.5.5", "@types/react": "catalog:",
"react": "19.1.1", "next": "16.0.0",
"react": "19.2.0",
"zod": "^3.25.74" "zod": "^3.25.74"
}, },
"typesVersions": { "typesVersions": {

View File

@@ -73,7 +73,6 @@ class AuthCallbackService {
// remove the query params from the url // remove the query params from the url
searchParams.delete('token_hash'); searchParams.delete('token_hash');
searchParams.delete('type');
searchParams.delete('next'); searchParams.delete('next');
// if we have a next path, we redirect to that path // if we have a next path, we redirect to that path

View File

@@ -1,8 +1,6 @@
'use client'; 'use client';
import { useEffect } from 'react'; import { useEffect, useEffectEvent } from 'react';
import { usePathname } from 'next/navigation';
import type { AuthChangeEvent, Session } from '@supabase/supabase-js'; import type { AuthChangeEvent, Session } from '@supabase/supabase-js';
@@ -12,7 +10,13 @@ import { useSupabase } from './use-supabase';
* @name PRIVATE_PATH_PREFIXES * @name PRIVATE_PATH_PREFIXES
* @description A list of private path prefixes * @description A list of private path prefixes
*/ */
const PRIVATE_PATH_PREFIXES = ['/home', '/admin', '/join', '/update-password']; const PRIVATE_PATH_PREFIXES = [
'/home',
'/admin',
'/join',
'/identities',
'/update-password',
];
/** /**
* @name AUTH_PATHS * @name AUTH_PATHS
@@ -28,19 +32,23 @@ const AUTH_PATHS = ['/auth'];
*/ */
export function useAuthChangeListener({ export function useAuthChangeListener({
privatePathPrefixes = PRIVATE_PATH_PREFIXES, privatePathPrefixes = PRIVATE_PATH_PREFIXES,
appHomePath,
onEvent, onEvent,
}: { }: {
appHomePath: string;
privatePathPrefixes?: string[]; privatePathPrefixes?: string[];
onEvent?: (event: AuthChangeEvent, user: Session | null) => void; onEvent?: (event: AuthChangeEvent, user: Session | null) => void;
}) { }) {
const client = useSupabase(); const client = useSupabase();
const pathName = usePathname();
useEffect(() => { const setupAuthListener = useEffectEvent(() => {
// don't run on the server
if (typeof window === 'undefined') {
return;
}
// keep this running for the whole session unless the component was unmounted // keep this running for the whole session unless the component was unmounted
const listener = client.auth.onAuthStateChange((event, user) => { return client.auth.onAuthStateChange((event, user) => {
const pathName = window.location.pathname;
if (onEvent) { if (onEvent) {
onEvent(event, user); onEvent(event, user);
} }
@@ -68,10 +76,16 @@ export function useAuthChangeListener({
window.location.reload(); window.location.reload();
} }
}); });
});
useEffect(() => {
const listener = setupAuthListener();
// destroy listener on un-mounts // destroy listener on un-mounts
return () => listener.data.subscription.unsubscribe(); return () => {
}, [client.auth, pathName, appHomePath, privatePathPrefixes, onEvent]); listener?.data.subscription.unsubscribe();
};
}, []);
} }
/** /**

View File

@@ -1,4 +1,4 @@
import type { SupabaseClient } from '@supabase/supabase-js'; import type { AMREntry, SupabaseClient } from '@supabase/supabase-js';
import { checkRequiresMultiFactorAuthentication } from './check-requires-mfa'; import { checkRequiresMultiFactorAuthentication } from './check-requires-mfa';
import { JWTUserData } from './types'; import { JWTUserData } from './types';
@@ -24,6 +24,7 @@ type UserClaims = {
aal: `aal1` | `aal2`; aal: `aal1` | `aal2`;
session_id: string; session_id: string;
is_anonymous: boolean; is_anonymous: boolean;
amr: AMREntry[];
}; };
/** /**
@@ -97,6 +98,7 @@ export async function requireUser(
app_metadata: user.app_metadata, app_metadata: user.app_metadata,
user_metadata: user.user_metadata, user_metadata: user.user_metadata,
id: user.sub, id: user.sub,
amr: user.amr,
}, },
}; };
} }

View File

@@ -1,3 +1,5 @@
import type { AMREntry } from '@supabase/supabase-js';
/** /**
* @name JWTUserData * @name JWTUserData
* @description The user data mapped from the JWT claims. * @description The user data mapped from the JWT claims.
@@ -10,4 +12,5 @@ export type JWTUserData = {
app_metadata: Record<string, unknown>; app_metadata: Record<string, unknown>;
user_metadata: Record<string, unknown>; user_metadata: Record<string, unknown>;
id: string; id: string;
amr: AMREntry[];
}; };

View File

@@ -14,7 +14,7 @@
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cmdk": "1.1.1", "cmdk": "1.1.1",
"input-otp": "1.4.2", "input-otp": "1.4.2",
"lucide-react": "^0.544.0", "lucide-react": "^0.546.0",
"radix-ui": "1.4.3", "radix-ui": "1.4.3",
"react-dropzone": "^14.3.8", "react-dropzone": "^14.3.8",
"react-top-loading-bar": "3.0.2", "react-top-loading-bar": "3.0.2",
@@ -25,22 +25,22 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "2.58.0", "@supabase/supabase-js": "2.76.1",
"@tanstack/react-query": "5.90.2", "@tanstack/react-query": "5.90.5",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@types/react": "19.1.16", "@types/react": "catalog:",
"@types/react-dom": "19.1.9", "@types/react-dom": "19.2.2",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"eslint": "^9.35.0", "eslint": "^9.38.0",
"next": "15.5.5", "next": "16.0.0",
"next-themes": "0.4.6", "next-themes": "0.4.6",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"react-day-picker": "^9.11.0", "react-day-picker": "^9.11.1",
"react-hook-form": "^7.63.0", "react-hook-form": "^7.65.0",
"react-i18next": "^16.0.0", "react-i18next": "^16.1.4",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwindcss": "4.1.14", "tailwindcss": "4.1.15",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"zod": "^3.25.74" "zod": "^3.25.74"

View File

@@ -196,19 +196,23 @@ export const useSupabaseUpload = (options: UseSupabaseUploadOptions) => {
setLoading(false); setLoading(false);
}, [ }, [
files,
path,
bucketName, bucketName,
errors,
successes,
onUploadSuccess,
client,
cacheControl, cacheControl,
client.storage,
errors,
files,
onUploadSuccess,
setLoading,
setErrors,
setSuccesses,
path,
successes,
upsert, upsert,
]); ]);
useEffect(() => { useEffect(() => {
if (files.length === 0) { if (files.length === 0) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setErrors([]); setErrors([]);
} }

View File

@@ -109,30 +109,19 @@ export const ImageUploadInput: React.FC<Props> =
[forwardedRef], [forwardedRef],
); );
useEffect(() => { if (image !== state.image) {
setState((state) => ({ ...state, image })); setState((state) => ({ ...state, image }));
}, [image]); }
useEffect(() => { useEffect(() => {
if (!image) { if (!image) {
// eslint-disable-next-line react-hooks/set-state-in-effect
onRemove(); onRemove();
} }
}, [image, onRemove]); }, [image, onRemove]);
const Input = () => (
<input
{...props}
className={cn('hidden', props.className)}
ref={setRef}
type={'file'}
onInput={onInputChange}
accept="image/*"
aria-labelledby={'image-upload-input'}
/>
);
if (!visible) { if (!visible) {
return <Input />; return <Input {...props} onInput={onInputChange} ref={setRef} />;
} }
return ( return (
@@ -140,7 +129,7 @@ export const ImageUploadInput: React.FC<Props> =
id={'image-upload-input'} id={'image-upload-input'}
className={`border-input bg-background ring-primary ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring relative flex h-10 w-full cursor-pointer rounded-md border border-dashed px-3 py-2 text-sm ring-offset-2 outline-hidden transition-all file:border-0 file:bg-transparent file:text-sm file:font-medium focus:ring-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50`} className={`border-input bg-background ring-primary ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring relative flex h-10 w-full cursor-pointer rounded-md border border-dashed px-3 py-2 text-sm ring-offset-2 outline-hidden transition-all file:border-0 file:bg-transparent file:text-sm file:font-medium focus:ring-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50`}
> >
<Input /> <Input ref={setRef} onInput={onInputChange} />
<div className={'flex items-center space-x-4'}> <div className={'flex items-center space-x-4'}>
<div className={'flex'}> <div className={'flex'}>
@@ -198,3 +187,19 @@ export const ImageUploadInput: React.FC<Props> =
</label> </label>
); );
}; };
function Input(
props: React.InputHTMLAttributes<unknown> & {
ref: (input: HTMLInputElement) => void;
},
) {
return (
<input
{...props}
className={cn('hidden', props.className)}
type={'file'}
accept="image/*"
aria-labelledby={'image-upload-input'}
/>
);
}

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useState } from 'react';
import { Image as ImageIcon } from 'lucide-react'; import { Image as ImageIcon } from 'lucide-react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
@@ -44,7 +44,13 @@ export function ImageUploader(
[props], [props],
); );
const Input = () => ( if (props.value !== image) {
setImage(props.value);
}
if (!image) {
return (
<FallbackImage descriptionSection={props.children}>
<ImageUploadInput <ImageUploadInput
{...control} {...control}
accept={'image/*'} accept={'image/*'}
@@ -53,16 +59,6 @@ export function ImageUploader(
multiple={false} multiple={false}
onValueChange={onValueChange} onValueChange={onValueChange}
/> />
);
useEffect(() => {
setImage(props.value);
}, [props.value]);
if (!image) {
return (
<FallbackImage descriptionSection={props.children}>
<Input />
</FallbackImage> </FallbackImage>
); );
} }
@@ -84,7 +80,14 @@ export function ImageUploader(
alt={''} alt={''}
/> />
<Input /> <ImageUploadInput
{...control}
accept={'image/*'}
className={'absolute h-full w-full'}
visible={false}
multiple={false}
onValueChange={onValueChange}
/>
</label> </label>
<div> <div>

View File

@@ -386,6 +386,7 @@ function AnimatedStep({
useEffect(() => { useEffect(() => {
if (isActive) { if (isActive) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setShouldRender(true); setShouldRender(true);
} else { } else {
const timer = setTimeout(() => setShouldRender(false), 300); const timer = setTimeout(() => setShouldRender(false), 300);

View File

@@ -1,6 +1,6 @@
import Image from 'next/image'; import Image from 'next/image';
import { AtSign, Phone } from 'lucide-react'; import { AtSign, Mail, Phone } from 'lucide-react';
const DEFAULT_IMAGE_SIZE = 18; const DEFAULT_IMAGE_SIZE = 18;
@@ -33,7 +33,8 @@ export function OauthProviderLogoImage({
function getOAuthProviderLogos(): Record<string, string | React.ReactNode> { function getOAuthProviderLogos(): Record<string, string | React.ReactNode> {
return { return {
email: <AtSign className={'size-[16px]'} />, password: <AtSign className={'s-[18px]'} />,
email: <Mail className={'s-[18px]'} />,
phone: <Phone className={'size-[16px]'} />, phone: <Phone className={'size-[16px]'} />,
google: '/images/oauth/google.webp', google: '/images/oauth/google.webp',
facebook: '/images/oauth/facebook.webp', facebook: '/images/oauth/facebook.webp',

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useContext, useId, useRef, useState } from 'react'; import { useContext, useId, useState } from 'react';
import Link from 'next/link'; import Link from 'next/link';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
@@ -43,23 +43,20 @@ export function Sidebar(props: {
}) => React.ReactNode); }) => React.ReactNode);
}) { }) {
const [collapsed, setCollapsed] = useState(props.collapsed ?? false); const [collapsed, setCollapsed] = useState(props.collapsed ?? false);
const isExpandedRef = useRef<boolean>(false); const [isExpanded, setIsExpanded] = useState(false);
const expandOnHover = const expandOnHover =
props.expandOnHover ?? props.expandOnHover ??
process.env.NEXT_PUBLIC_EXPAND_SIDEBAR_ON_HOVER === 'true'; process.env.NEXT_PUBLIC_EXPAND_SIDEBAR_ON_HOVER === 'true';
const sidebarSizeClassName = getSidebarSizeClassName( const sidebarSizeClassName = getSidebarSizeClassName(collapsed, isExpanded);
collapsed,
isExpandedRef.current,
);
const className = getClassNameBuilder( const className = getClassNameBuilder(
cn(props.className ?? '', sidebarSizeClassName, {}), cn(props.className ?? '', sidebarSizeClassName, {}),
)(); )();
const containerClassName = cn(sidebarSizeClassName, 'bg-inherit', { const containerClassName = cn(sidebarSizeClassName, 'bg-inherit', {
'max-w-[4rem]': expandOnHover && isExpandedRef.current, 'max-w-[4rem]': expandOnHover && isExpanded,
}); });
const ctx = { collapsed, setCollapsed }; const ctx = { collapsed, setCollapsed };
@@ -68,7 +65,7 @@ export function Sidebar(props: {
props.collapsed && expandOnHover props.collapsed && expandOnHover
? () => { ? () => {
setCollapsed(false); setCollapsed(false);
isExpandedRef.current = true; setIsExpanded(true);
} }
: undefined; : undefined;
@@ -77,11 +74,11 @@ export function Sidebar(props: {
? () => { ? () => {
if (!isRadixPopupOpen()) { if (!isRadixPopupOpen()) {
setCollapsed(true); setCollapsed(true);
isExpandedRef.current = false; setIsExpanded(false);
} else { } else {
onRadixPopupClose(() => { onRadixPopupClose(() => {
setCollapsed(true); setCollapsed(true);
isExpandedRef.current = false; setIsExpanded(false);
}); });
} }
} }
@@ -124,33 +121,21 @@ export function SidebarContent({
return <div className={className}>{children}</div>; return <div className={className}>{children}</div>;
} }
export function SidebarGroup({ function SidebarGroupWrapper({
id,
sidebarCollapsed,
collapsible,
isGroupCollapsed,
setIsGroupCollapsed,
label, label,
collapsed = false, }: {
collapsible = true, id: string;
children, sidebarCollapsed: boolean;
}: React.PropsWithChildren<{ collapsible: boolean;
label: string | React.ReactNode; isGroupCollapsed: boolean;
collapsible?: boolean; setIsGroupCollapsed: (isGroupCollapsed: boolean) => void;
collapsed?: boolean; label: React.ReactNode;
}>) { }) {
const { collapsed: sidebarCollapsed } = useContext(SidebarContext);
const [isGroupCollapsed, setIsGroupCollapsed] = useState(collapsed);
const id = useId();
const Title = (props: React.PropsWithChildren) => {
if (sidebarCollapsed) {
return null;
}
return (
<span className={'text-muted-foreground text-xs font-semibold uppercase'}>
{props.children}
</span>
);
};
const Wrapper = () => {
const className = cn( const className = cn(
'px-container group flex items-center justify-between space-x-2.5', 'px-container group flex items-center justify-between space-x-2.5',
{ {
@@ -166,7 +151,11 @@ export function SidebarGroup({
onClick={() => setIsGroupCollapsed(!isGroupCollapsed)} onClick={() => setIsGroupCollapsed(!isGroupCollapsed)}
className={className} className={className}
> >
<Title>{label}</Title> <span
className={'text-muted-foreground text-xs font-semibold uppercase'}
>
{label}
</span>
<If condition={collapsible}> <If condition={collapsible}>
<ChevronDown <ChevronDown
@@ -179,12 +168,32 @@ export function SidebarGroup({
); );
} }
if (sidebarCollapsed) {
return null;
}
return ( return (
<div className={className}> <div className={className}>
<Title>{label}</Title> <span className={'text-muted-foreground text-xs font-semibold uppercase'}>
{label}
</span>
</div> </div>
); );
}; }
export function SidebarGroup({
label,
collapsed = false,
collapsible = true,
children,
}: React.PropsWithChildren<{
label: string | React.ReactNode;
collapsible?: boolean;
collapsed?: boolean;
}>) {
const { collapsed: sidebarCollapsed } = useContext(SidebarContext);
const [isGroupCollapsed, setIsGroupCollapsed] = useState(collapsed);
const id = useId();
return ( return (
<div <div
@@ -192,7 +201,14 @@ export function SidebarGroup({
'gap-y-2 py-1': !collapsed, 'gap-y-2 py-1': !collapsed,
})} })}
> >
<Wrapper /> <SidebarGroupWrapper
id={id}
sidebarCollapsed={sidebarCollapsed}
collapsible={collapsible}
isGroupCollapsed={isGroupCollapsed}
setIsGroupCollapsed={setIsGroupCollapsed}
label={label}
/>
<If condition={collapsible ? !isGroupCollapsed : true}> <If condition={collapsible ? !isGroupCollapsed : true}>
<div id={id} className={'flex flex-col space-y-1.5'}> <div id={id} className={'flex flex-col space-y-1.5'}>

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { Fragment, useCallback } from 'react'; import { Fragment } from 'react';
import { cva } from 'class-variance-authority'; import { cva } from 'class-variance-authority';
@@ -12,25 +12,18 @@ type Variant = 'numbers' | 'default' | 'dots';
const classNameBuilder = getClassNameBuilder(); const classNameBuilder = getClassNameBuilder();
/** function Steps({
* Renders a stepper component with multiple steps. steps,
* currentStep,
* @param {Object} props - The props object containing the following properties: variant,
* - steps {string[]} - An array of strings representing the step labels. }: {
* - currentStep {number} - The index of the currently active step.
* - variant {string} (optional) - The variant of the stepper component (default: 'default').
**/
export function Stepper(props: {
steps: string[]; steps: string[];
currentStep: number; currentStep: number;
variant?: Variant; variant?: Variant;
}) { }) {
const variant = props.variant ?? 'default'; return steps.map((labelOrKey, index) => {
const selected = currentStep === index;
const Steps = useCallback(() => { const complete = currentStep > index;
return props.steps.map((labelOrKey, index) => {
const selected = props.currentStep === index;
const complete = props.currentStep > index;
const className = classNameBuilder({ const className = classNameBuilder({
selected, selected,
@@ -65,7 +58,22 @@ export function Stepper(props: {
</Fragment> </Fragment>
); );
}); });
}, [props.steps, props.currentStep, variant]); }
/**
* Renders a stepper component with multiple steps.
*
* @param {Object} props - The props object containing the following properties:
* - steps {string[]} - An array of strings representing the step labels.
* - currentStep {number} - The index of the currently active step.
* - variant {string} (optional) - The variant of the stepper component (default: 'default').
**/
export function Stepper(props: {
steps: string[];
currentStep: number;
variant?: Variant;
}) {
const variant = props.variant ?? 'default';
// If there are no steps, don't render anything. // If there are no steps, don't render anything.
if (props.steps.length < 2) { if (props.steps.length < 2) {
@@ -75,12 +83,16 @@ export function Stepper(props: {
const containerClassName = cn('w-full', { const containerClassName = cn('w-full', {
['flex justify-between']: variant === 'numbers', ['flex justify-between']: variant === 'numbers',
['flex space-x-0.5']: variant === 'default', ['flex space-x-0.5']: variant === 'default',
['flex gap-x-4 self-center']: variant === 'dots', ['flex space-x-2.5 self-center']: variant === 'dots',
}); });
return ( return (
<div className={containerClassName}> <div className={containerClassName}>
<Steps /> <Steps
steps={props.steps}
currentStep={props.currentStep}
variant={variant}
/>
</div> </div>
); );
} }

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { useEffect, useState } from 'react'; import { useState } from 'react';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { RocketIcon } from 'lucide-react'; import { RocketIcon } from 'lucide-react';
@@ -38,12 +38,10 @@ export function VersionUpdater(props: { intervalTimeInSecond?: number }) {
const [dismissed, setDismissed] = useState(false); const [dismissed, setDismissed] = useState(false);
const [showDialog, setShowDialog] = useState<boolean>(false); const [showDialog, setShowDialog] = useState<boolean>(false);
useEffect(() => {
setShowDialog(data?.didChange ?? false);
}, [data?.didChange]);
if (!data?.didChange || dismissed) { if (!data?.didChange || dismissed) {
return null; return null;
} else {
setShowDialog(data?.didChange ?? false);
} }
return ( return (

View File

@@ -677,6 +677,7 @@ const SidebarMenuSkeleton: React.FC<
> = ({ className, showIcon = false, ...props }) => { > = ({ className, showIcon = false, ...props }) => {
// Random width between 50 to 90%. // Random width between 50 to 90%.
const width = React.useMemo(() => { const width = React.useMemo(() => {
// eslint-disable-next-line react-hooks/purity
return `${Math.floor(Math.random() * 40) + 50}%`; return `${Math.floor(Math.random() * 40) + 50}%`;
}, []); }, []);

7141
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,10 @@ packages:
- packages/** - packages/**
- tooling/* - tooling/*
catalog:
'@types/node': 24.9.1
'@types/react': 19.2.2
onlyBuiltDependencies: onlyBuiltDependencies:
- '@tailwindcss/oxide' - '@tailwindcss/oxide'
- '@sentry/cli' - '@sentry/cli'

View File

@@ -1,17 +1,21 @@
import { defineConfig } from '@eslint/config-helpers';
import eslint from '@eslint/js'; import eslint from '@eslint/js';
import turboConfig from 'eslint-config-turbo/flat'; import turbo from 'eslint-config-turbo';
import tsEsLint from 'typescript-eslint'; import tsEsLint from 'typescript-eslint';
import nextConfig from './nextjs.js'; import nextConfig from './nextjs.js';
export default tsEsLint.config( export default defineConfig(
eslint.configs.recommended, eslint.configs.recommended,
tsEsLint.configs.recommended,
nextConfig, nextConfig,
turboConfig,
{ {
plugins: {
turbo,
},
settings: { settings: {
react: { react: {
version: '19.0', version: '19.2',
}, },
}, },
languageOptions: { languageOptions: {

View File

@@ -13,16 +13,16 @@
"format": "prettier --check \"**/*.{js,json}\"" "format": "prettier --check \"**/*.{js,json}\""
}, },
"dependencies": { "dependencies": {
"@next/eslint-plugin-next": "15.5.5", "@next/eslint-plugin-next": "16.0.0-beta.0",
"@types/eslint": "9.6.1", "@types/eslint": "9.6.1",
"eslint-config-next": "15.5.5", "eslint-config-next": "16.0.0-beta.0",
"eslint-config-turbo": "^2.5.8", "eslint-config-turbo": "^2.5.8",
"typescript-eslint": "8.45.0" "typescript-eslint": "8.46.2"
}, },
"devDependencies": { "devDependencies": {
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"eslint": "^9.35.0", "eslint": "^9.38.0",
"typescript": "^5.9.3" "typescript": "^5.9.3"
}, },
"prettier": "@kit/prettier-config" "prettier": "@kit/prettier-config"

View File

@@ -11,7 +11,7 @@
"dependencies": { "dependencies": {
"@trivago/prettier-plugin-sort-imports": "5.2.2", "@trivago/prettier-plugin-sort-imports": "5.2.2",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14" "prettier-plugin-tailwindcss": "^0.7.1"
}, },
"devDependencies": { "devDependencies": {
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",

View File

@@ -190,13 +190,13 @@ export function createEnvironmentVariablesGenerator(
}, },
{ {
type: 'input', type: 'input',
name: 'values.NEXT_PUBLIC_SUPABASE_ANON_KEY', name: 'values.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY',
message: `What is the Supabase anon key?\nFor more info: ${getUrlToDocs('NEXT_PUBLIC_SUPABASE_ANON_KEY')}\n`, message: `What is the Supabase public key?\nFor more info: ${getUrlToDocs('NEXT_PUBLIC_SUPABASE_PUBLIC_KEY')}\n`,
}, },
{ {
type: 'input', type: 'input',
name: 'values.SUPABASE_SERVICE_ROLE_KEY', name: 'values.SUPABASE_SECRET_KEY',
message: `What is the Supabase Service Role Key?\nFor more info: ${getUrlToDocs('SUPABASE_SERVICE_ROLE_KEY')}\n`, message: `What is the Supabase secret key?\nFor more info: ${getUrlToDocs('SUPABASE_SECRET_KEY')}\n`,
}, },
{ {
type: 'list', type: 'list',