Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Automated quality checks run on every commit:

## Modern Features

- **🎨 Dark/Light Mode** — Theme switching with `next-themes` and CSS variables
- **🎨 Dark/Light Mode** — Theme switching with `better-themes` and CSS variables
- **⚡ Optimistic Updates** — Instant UI feedback with TanStack DB's mutation features
- **🏊 Connection Pooling** — Efficient PostgreSQL connection management with `postgres.js`
- **📊 Type-Safe Everything** — TanStack Query provides additional type safety on top of Drizzle
Expand Down
49 changes: 38 additions & 11 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"@tanstack/react-start": "^1.145.3",
"@tanstack/router-plugin": "^1.145.2",
"better-auth": "^1.4.10",
"better-themes": "^1.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"drizzle-orm": "^0.45.1",
"lucide-react": "^0.562.0",
"next-themes": "^0.4.6",
"nitro": "^3.0.1-alpha.1",
"pg-boss": "^12.5.4",
"postgres": "^3.4.7",
Expand All @@ -81,6 +81,7 @@
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.2",
"@vitest/coverage-v8": "^4.0.16",
"babel-plugin-react-compiler": "^1.0.0",
"concurrently": "^9.2.1",
"dotenv": "^17.2.3",
Expand Down
7 changes: 1 addition & 6 deletions src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
import type { ThemeProviderProps } from "next-themes";
import { ThemeProvider as NextThemesProvider } from "next-themes";

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
export { ThemeProvider } from "better-themes";
12 changes: 4 additions & 8 deletions src/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { useHydrated } from "@tanstack/react-router";
import { useTheme } from "better-themes";
import { Toggle } from "@/components/ui/toggle";

type ThemeToggleProps = {
absolute?: boolean;
};

export function ThemeToggle({ absolute = true }: ThemeToggleProps) {
const hydrated = useHydrated();
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);

useEffect(() => {
setMounted(true);
}, []);

if (!mounted) {
if (!hydrated) {
return (
<div className={absolute ? "absolute top-6 right-6" : ""}>
<Toggle disabled size="sm" variant="outline">
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/sonner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
OctagonXIcon,
TriangleAlertIcon,
} from "lucide-react"
import { useTheme } from "next-themes"
import { useTheme } from "better-themes"
import { Toaster as Sonner, type ToasterProps } from "sonner"

const Toaster = ({ ...props }: ToasterProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function App() {
<div className="flex flex-col items-center space-y-2 rounded-lg border p-4 text-center">
<div className="text-2xl">🌓</div>
<h3 className="font-medium">Dark/Light Mode</h3>
<p className="text-muted-foreground text-sm">Seamless theme switching with next-themes</p>
<p className="text-muted-foreground text-sm">Seamless theme switching with better-themes</p>
</div>
<div className="flex flex-col items-center space-y-2 rounded-lg border p-4 text-center">
<div className="text-2xl">⚡</div>
Expand Down
7 changes: 6 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export default defineConfig({
plugins: [tsconfigPaths()],
test: {
environment: "happy-dom",
setupFiles: ["./src/test/setup.ts"],
setupFiles: ["./tests/setup.ts"],
globals: true,
coverage: {
provider: "v8",
include: ["src/**/*.ts", "src/**/*.tsx"],
exclude: ["src/routeTree.gen.ts", "src/components/ui/**"],
},
},
});