upgrade to biome v2

This commit is contained in:
Aman Varshney
2025-06-18 16:50:04 +05:30
parent 0e70ea5774
commit 7013426017
43 changed files with 198 additions and 154 deletions

View File

@@ -1,11 +1,11 @@
"use client";
import { motion } from "motion/react";
import Image from "next/image";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { ScrollArea } from "@/components/ui/scroll-area";
import { cn } from "@/lib/utils";
import { motion } from "motion/react";
import { useTheme } from "next-themes";
import Image from "next/image";
import { useEffect, useState } from "react";
type TechOption = {
id: string;

View File

@@ -1,8 +1,8 @@
"use client";
import { cn } from "@/lib/utils";
import { Check, ClipboardCopy } from "lucide-react";
import { AnimatePresence, motion } from "motion/react";
import { useState } from "react";
import { cn } from "@/lib/utils";
import PackageIcon from "./icons";
const CodeContainer = () => {

View File

@@ -1,11 +1,11 @@
"use client";
import { ThemeToggle } from "@/components/theme-toggle";
import { cn } from "@/lib/utils";
import { Github, Maximize2, Menu, X } from "lucide-react";
import { AnimatePresence, motion } from "motion/react";
import Image from "next/image";
import Link from "next/link";
import { useEffect, useState } from "react";
import { ThemeToggle } from "@/components/theme-toggle";
import { cn } from "@/lib/utils";
import PackageIcon from "./icons";
export default function Navbar() {

View File

@@ -1,7 +1,7 @@
"use client";
import { cn } from "@/lib/utils";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
const NpmPackage = () => {
const [version, setVersion] = useState("");

View File

@@ -1,7 +1,7 @@
import type { Sponsor } from "@/lib/types";
import { Github, Globe, Heart, Terminal } from "lucide-react";
import Image from "next/image";
import { useEffect, useState } from "react";
import type { Sponsor } from "@/lib/types";
export default function SponsorsSection() {
const [sponsors, setSponsors] = useState<Sponsor[]>([]);

View File

@@ -1,23 +1,5 @@
"use client";
import { ThemeToggle } from "@/components/theme-toggle";
import { ScrollArea } from "@/components/ui/scroll-area";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import {
DEFAULT_STACK,
PRESET_TEMPLATES,
type StackState,
TECH_OPTIONS,
isStackDefault,
} from "@/lib/constant";
import { stackParsers, stackQueryStatesOptions } from "@/lib/stack-url-state";
import { cn } from "@/lib/utils";
import discordLogo from "@/public/icon/discord.svg";
import {
Check,
ClipboardCopy,
@@ -31,13 +13,31 @@ import {
Terminal,
} from "lucide-react";
import { motion } from "motion/react";
import { useTheme } from "next-themes";
import Image from "next/image";
import Link from "next/link";
import { useTheme } from "next-themes";
import { useQueryStates } from "nuqs";
import type React from "react";
import { useEffect, useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { ThemeToggle } from "@/components/theme-toggle";
import { ScrollArea } from "@/components/ui/scroll-area";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import {
DEFAULT_STACK,
isStackDefault,
PRESET_TEMPLATES,
type StackState,
TECH_OPTIONS,
} from "@/lib/constant";
import { stackParsers, stackQueryStatesOptions } from "@/lib/stack-url-state";
import { cn } from "@/lib/utils";
import discordLogo from "@/public/icon/discord.svg";
const validateProjectName = (name: string): string | undefined => {
const INVALID_CHARS = ["<", ">", ":", '"', "|", "?", "*"];

View File

@@ -1,13 +1,4 @@
"use client";
import {
type ChartConfig,
ChartContainer,
ChartLegend,
ChartLegendContent,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import discordLogo from "@/public/icon/discord.svg";
import { format, parseISO } from "date-fns";
import { Cpu, Download, Terminal, TrendingUp, Users } from "lucide-react";
import Image from "next/image";
@@ -25,6 +16,15 @@ import {
XAxis,
YAxis,
} from "recharts";
import {
type ChartConfig,
ChartContainer,
ChartLegend,
ChartLegendContent,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import discordLogo from "@/public/icon/discord.svg";
import Navbar from "../_components/navbar";
interface AnalyticsData {

View File

@@ -1,7 +1,4 @@
"use client";
import { TECH_OPTIONS } from "@/lib/constant";
import { cn } from "@/lib/utils";
import discordLogo from "@/public/icon/discord.svg";
import {
Check,
ChevronRight,
@@ -13,6 +10,9 @@ import {
import Image from "next/image";
import Link from "next/link";
import { useEffect, useState } from "react";
import { TECH_OPTIONS } from "@/lib/constant";
import { cn } from "@/lib/utils";
import discordLogo from "@/public/icon/discord.svg";
import Footer from "./_components/footer";
import PackageIcon from "./_components/icons";
import Navbar from "./_components/navbar";

View File

@@ -1,5 +1,5 @@
import { source } from "@/lib/source";
import { createFromSource } from "fumadocs-core/search/server";
import { source } from "@/lib/source";
export const revalidate = false;

View File

@@ -1,4 +1,3 @@
import { source } from "@/lib/source";
import Features from "components/features";
import defaultMdxComponents from "fumadocs-ui/mdx";
import {
@@ -8,6 +7,7 @@ import {
DocsTitle,
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import { source } from "@/lib/source";
export default async function Page(props: {
params: Promise<{ slug?: string[] }>;

View File

@@ -1,7 +1,7 @@
import { baseOptions } from "@/app/layout.config";
import { source } from "@/lib/source";
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { source } from "@/lib/source";
export default function Layout({ children }: { children: ReactNode }) {
return (

View File

@@ -1,10 +1,11 @@
export const dynamic = "force-static";
import { Toaster } from "@/components/ui/sonner";
import { RootProvider } from "fumadocs-ui/provider";
import type { Metadata } from "next";
import { Poppins } from "next/font/google";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import type { ReactNode } from "react";
import { Toaster } from "@/components/ui/sonner";
import "./global.css";
const poppins = Poppins({

View File

@@ -1,4 +1,5 @@
export const dynamic = "force-static";
import type { MetadataRoute } from "next";
export default function manifest(): MetadataRoute.Manifest {

View File

@@ -1,4 +1,5 @@
export const dynamic = "force-static";
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {

View File

@@ -1,4 +1,5 @@
export const dynamic = "force-static";
import type { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {

View File

@@ -1,10 +1,10 @@
"use client";
import { cn } from "@/lib/utils";
import * as SwitchPrimitives from "@radix-ui/react-switch";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import * as React from "react";
import { cn } from "@/lib/utils";
export function ThemeToggle({ className }: { className?: string }) {
const { setTheme, resolvedTheme } = useTheme();

View File

@@ -1,4 +1,4 @@
import { type VariantProps, cva } from "class-variance-authority";
import { cva, type VariantProps } from "class-variance-authority";
import { Slot as SlotPrimitive } from "radix-ui";
import type * as React from "react";

View File

@@ -80,7 +80,7 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
return (
<style
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
// biome-ignore lint/security/noDangerouslySetInnerHtml: This is safe as we control the content.
dangerouslySetInnerHTML={{
__html: Object.entries(THEMES)
.map(

View File

@@ -1,5 +1,5 @@
import { docs } from "@/.source";
import { loader } from "fumadocs-core/source";
import { docs } from "@/.source";
export const source = loader({
baseUrl: "/docs",

View File

@@ -1,10 +1,10 @@
import { DEFAULT_STACK, type StackState, TECH_OPTIONS } from "@/lib/constant";
import {
type UrlKeys,
parseAsArrayOf,
parseAsString,
parseAsStringEnum,
type UrlKeys,
} from "nuqs";
import { DEFAULT_STACK, type StackState, TECH_OPTIONS } from "@/lib/constant";
const getValidIds = (category: keyof typeof TECH_OPTIONS): string[] => {
return TECH_OPTIONS[category]?.map((opt) => opt.id) ?? [];