Unverified Commit a2162078 authored by Damien Sedgwick's avatar Damien Sedgwick Committed by GitHub

Removed duplicated cn function declaration from lib dir (#74065)

This pull request removes duplication of a utility function within the
`with-supabase` example as mentioned in the following issue #73942 - I
removed the duplicated code from the `utils` directory as when shadcn
installs a new component, that component will look for the helper
function in `lib/utils.ts` and forcing users to update every component
after installation or modify any config files for shadcn seems like a
worse DX.

- Fixes https://github.com/vercel/next.js/issues/73942

---------
Co-authored-by: 's avatarsamcx <sam@vercel.com>
parent 764f8851
...@@ -3,7 +3,7 @@ import { EnvVarWarning } from "@/components/env-var-warning"; ...@@ -3,7 +3,7 @@ import { EnvVarWarning } from "@/components/env-var-warning";
import HeaderAuth from "@/components/header-auth"; import HeaderAuth from "@/components/header-auth";
import { ThemeSwitcher } from "@/components/theme-switcher"; import { ThemeSwitcher } from "@/components/theme-switcher";
import { hasEnvVars } from "@/utils/supabase/check-env-vars"; import { hasEnvVars } from "@/utils/supabase/check-env-vars";
import { GeistSans } from "geist/font/sans"; import { Geist } from "next/font/google";
import { ThemeProvider } from "next-themes"; import { ThemeProvider } from "next-themes";
import Link from "next/link"; import Link from "next/link";
import "./globals.css"; import "./globals.css";
...@@ -18,13 +18,18 @@ export const metadata = { ...@@ -18,13 +18,18 @@ export const metadata = {
description: "The fastest way to build apps with Next.js and Supabase", description: "The fastest way to build apps with Next.js and Supabase",
}; };
const geistSans = Geist({
display: "swap",
subsets: ["latin"],
});
export default function RootLayout({ export default function RootLayout({
children, children,
}: { }: Readonly<{
children: React.ReactNode; children: React.ReactNode;
}) { }>) {
return ( return (
<html lang="en" className={GeistSans.className} suppressHydrationWarning> <html lang="en" className={geistSans.className} suppressHydrationWarning>
<body className="bg-background text-foreground"> <body className="bg-background text-foreground">
<ThemeProvider <ThemeProvider
attribute="class" attribute="class"
......
...@@ -3,7 +3,7 @@ import ConnectSupabaseSteps from "@/components/tutorial/connect-supabase-steps"; ...@@ -3,7 +3,7 @@ import ConnectSupabaseSteps from "@/components/tutorial/connect-supabase-steps";
import SignUpUserSteps from "@/components/tutorial/sign-up-user-steps"; import SignUpUserSteps from "@/components/tutorial/sign-up-user-steps";
import { hasEnvVars } from "@/utils/supabase/check-env-vars"; import { hasEnvVars } from "@/utils/supabase/check-env-vars";
export default async function Index() { export default async function Home() {
return ( return (
<> <>
<Hero /> <Hero />
......
import { type ClassValue, clsx } from "clsx"; import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
......
/** @type {import('next').NextConfig} */
const nextConfig = {};
module.exports = nextConfig;
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
};
export default nextConfig;
...@@ -15,22 +15,21 @@ ...@@ -15,22 +15,21 @@
"autoprefixer": "10.4.20", "autoprefixer": "10.4.20",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"geist": "^1.2.1", "lucide-react": "^0.468.0",
"lucide-react": "^0.456.0",
"next": "latest", "next": "latest",
"next-themes": "^0.4.3", "next-themes": "^0.4.3",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"react": "18.3.1", "react": "19.0.0",
"react-dom": "18.3.1" "react-dom": "19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "22.9.0", "@types/node": "22.10.2",
"@types/react": "^18.3.12", "@types/react": "^19.0.2",
"@types/react-dom": "18.3.1", "@types/react-dom": "19.0.2",
"postcss": "8.4.49", "postcss": "8.4.49",
"tailwind-merge": "^2.5.2", "tailwind-merge": "^2.5.2",
"tailwindcss": "3.4.14", "tailwindcss": "3.4.17",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "5.6.3" "typescript": "5.7.2"
} }
} }
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment