chore(root): migrate to biome

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-16 12:20:40 +02:00
parent 1f6e198336
commit 32e91959f6
383 changed files with 1943 additions and 3085 deletions

View File

@@ -114,7 +114,7 @@ export default function Page() {
<strong>Website</strong> refers to Openpanel, accessible from{' '}
<a
href="https://openpanel.com"
rel="external nofollow noopener"
rel="noreferrer external nofollow noopener"
target="_blank"
>
https://openpanel.com
@@ -206,7 +206,7 @@ export default function Page() {
<a
href="https://www.termsfeed.com/blog/cookies/#What_Are_Cookies"
target="_blank"
rel="nofollow"
rel="noreferrer nofollow"
>
here
</a>

View File

@@ -112,7 +112,7 @@ export default function Page() {
<strong>Website</strong> refers to Openpanel, accessible from{' '}
<a
href="https://openpanel.dev"
rel="external nofollow noopener"
rel="noreferrer external nofollow noopener"
target="_blank"
>
https://openpanel.dev

View File

@@ -19,7 +19,6 @@ const AnimatedText = ({ texts }: Props) => {
index === 0 ? 3000 : 2000,
];
}, [] as any[]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
@@ -36,7 +35,7 @@ const AnimatedText = ({ texts }: Props) => {
preRenderFirstString={true}
sequence={sequence}
wrapper="span"
repeat={Infinity}
repeat={Number.POSITIVE_INFINITY}
omitDeletionAnimation
/>
</span>

View File

@@ -28,7 +28,7 @@ export function Heading1({ children, className }: Props) {
<h1
className={cn(
'font-serif text-4xl font-bold !leading-tight text-slate-900 md:text-5xl',
className
className,
)}
>
{children}
@@ -41,7 +41,7 @@ export function Heading2({ children, className }: Props) {
<h2
className={cn(
'font-serif text-4xl font-bold text-slate-900 md:text-5xl',
className
className,
)}
>
{children}
@@ -54,7 +54,7 @@ export function Heading3({ children, className }: Props) {
<h3
className={cn(
'font-serif text-2xl font-bold text-slate-900 md:text-3xl',
className
className,
)}
>
{children}
@@ -67,7 +67,7 @@ export function Heading4({ children, className }: Props) {
<h3
className={cn(
'font-serif text-xl font-bold text-slate-900 md:text-2xl',
className
className,
)}
>
{children}

View File

@@ -123,7 +123,7 @@ export function Feature({
<div
className={cn(
'container flex min-h-[300px] items-center justify-between gap-16 max-md:flex-col-reverse',
!even && 'md:flex-row-reverse'
!even && 'md:flex-row-reverse',
)}
>
<div className="flex w-full flex-col">

View File

@@ -8,7 +8,7 @@ import { Heading2, Lead2 } from './copy';
export default function Footer() {
return (
<footer className="bg-blue-darker relative mt-40 text-white">
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]" />
<div className="container relative flex flex-col items-center text-center">
<div className="my-24">
<Heading2 className="mb-2 text-white">Get early access</Heading2>
@@ -40,7 +40,7 @@ export default function Footer() {
</div>
</div>
<div className="relative z-10 -mt-8">
<div className="h-px w-full bg-[radial-gradient(circle,rgba(255,255,255,0.7)_0%,rgba(255,255,255,0.7)_50%,rgba(255,255,255,0)_100%)]"></div>
<div className="h-px w-full bg-[radial-gradient(circle,rgba(255,255,255,0.7)_0%,rgba(255,255,255,0.7)_50%,rgba(255,255,255,0)_100%)]" />
<div className="bg-blue-darker p-4">
<div className="container">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
@@ -56,7 +56,7 @@ export default function Footer() {
className="hover:underline"
href="https://twitter.com/CarlLindesvard"
target="_blank"
rel="nofollow"
rel="noreferrer nofollow"
>
Follow on X
</a>

View File

@@ -1,6 +1,6 @@
import { ALink } from '@/components/ui/button';
import { chQuery, TABLE_NAMES } from '@openpanel/db';
import { TABLE_NAMES, chQuery } from '@openpanel/db';
import { cacheable } from '../../../../packages/redis';
import AnimatedText from './animated-text';
@@ -8,15 +8,15 @@ import { Heading1, Lead2 } from './copy';
function shortNumber(num: number) {
if (num < 1e3) return num;
if (num >= 1e3 && num < 1e6) return +(num / 1e3).toFixed(1) + 'K';
if (num >= 1e6 && num < 1e9) return +(num / 1e6).toFixed(1) + 'M';
if (num >= 1e9 && num < 1e12) return +(num / 1e9).toFixed(1) + 'B';
if (num >= 1e12) return +(num / 1e12).toFixed(1) + 'T';
if (num >= 1e3 && num < 1e6) return `${+(num / 1e3).toFixed(1)}K`;
if (num >= 1e6 && num < 1e9) return `${+(num / 1e6).toFixed(1)}M`;
if (num >= 1e9 && num < 1e12) return `${+(num / 1e9).toFixed(1)}B`;
if (num >= 1e12) return `${+(num / 1e12).toFixed(1)}T`;
}
const getProjectsWithCount = cacheable(async () => {
const projects = await chQuery<{ project_id: string; count: number }>(
`SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()`
`SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()`,
);
return projects;
@@ -28,7 +28,7 @@ export async function Hero() {
const eventCount = projects.reduce((acc, { count }) => acc + count, 0);
return (
<div className="relative overflow-hidden">
{/* <div className="bg-blue-50 w-2/5 h-full absolute top-0 right-0"></div> */}
{/* <div className="bg-blue-50 w-2/5 h-full absolute top-0 right-0"/> */}
<div className="container relative flex min-h-[700px] flex-col items-center gap-4 max-md:pt-32 md:h-screen md:flex-row md:gap-8">
<div className="flex-1 max-md:text-center sm:min-w-[350px] lg:min-w-[400px]">
<div className="mb-4 flex justify-center md:justify-start">

View File

@@ -1,6 +1,5 @@
'use client';
import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Dialog,
@@ -11,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { cn } from '@/utils/cn';
import { useEffect, useState } from 'react';
interface JoinWaitlistProps {
className?: string;
@@ -66,7 +66,7 @@ export function JoinWaitlistHero({ className }: JoinWaitlistProps) {
placeholder="Enter your email"
className={cn(
'text-blue-darker h-12 w-full rounded-md border border-slate-100 bg-white px-4 shadow-sm outline-none ring-black focus:ring-1',
className
className,
)}
value={value}
onChange={(e) => setValue(e.target.value)}

View File

@@ -1,6 +1,5 @@
'use client';
import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Dialog,
@@ -11,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { cn } from '@/utils/cn';
import { useEffect, useState } from 'react';
interface JoinWaitlistProps {
className?: string;
@@ -66,7 +66,7 @@ export function JoinWaitlist({ className }: JoinWaitlistProps) {
placeholder="Enter your email"
className={cn(
'text-blue-darker h-12 w-full rounded-md border border-slate-100 bg-white px-4 shadow-sm outline-none ring-black focus:ring-1',
className
className,
)}
value={value}
onChange={(e) => setValue(e.target.value)}

View File

@@ -42,7 +42,7 @@ export default function RootLayout({
className={cn(
'grainy min-h-screen font-sans text-slate-900 antialiased',
head.variable,
body.variable
body.variable,
)}
>
<Navbar darkText />

View File

@@ -18,7 +18,7 @@ export function Navbar({ darkText = false, className }: Props) {
className={cn(
'fixed left-0 right-0 top-0 z-10 z-50 flex h-20 items-center border-b border-border bg-white',
textColor,
className
className,
)}
>
<div className="container flex items-center justify-between py-4">
@@ -28,13 +28,17 @@ export function Navbar({ darkText = false, className }: Props) {
<Link href="/#pricing" data-event="click_pricing">
Pricing
</Link>
<a href="https://docs.openpanel.dev" target="_blank">
<a href="https://docs.openpanel.dev" target="_blank" rel="noreferrer">
Docs
</a>
<a href="https://git.new/openpanel" target="_blank">
<a href="https://git.new/openpanel" target="_blank" rel="noreferrer">
Github
</a>
<a href="https://dashboard.openpanel.dev" target="_blank">
<a
href="https://dashboard.openpanel.dev"
target="_blank"
rel="noreferrer"
>
Sign in
</a>
</nav>

View File

@@ -130,7 +130,7 @@ const items = [
export function PunchLines() {
return (
<div className="bg-blue-darker relative py-32">
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]" />
<div className="relative">
<Heading2 className="mb-16 text-center text-white">
Not convinced?
@@ -147,7 +147,7 @@ export function PunchLines() {
<div
className={cn(
'mb-4 flex h-14 w-14 items-center justify-center rounded-full',
item.color
item.color,
)}
style={{ background: item.color }}
>

View File

@@ -69,5 +69,5 @@ export function SocialProof({ className, count }: JoinWaitlistProps) {
);
}
// <div class="flex flex-col gap-y-2 mt-5 lg:mt-3"><p class="text-gray-700 dark:text-gray-100 text-sm w-24 text-start font-semibold whitespace-nowrap">What users think</p><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1744063824431370240/BbVtyCiy_normal.png" alt="feedback_0"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Been a long time Mixpanel user and without a doubt there's a bunch of room to innovate. I'm confident Openpanel is on the right path! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg></div><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1751607056316944384/8E4F88FL_normal.jpg" alt="feedback_1"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Openpanel for the last 6 months (since Im the creator) for 3 different sites/apps. Its a great analytics product that has everything you need. Still lacking a native app but will work hard to make that a reality! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1701887174042324992/g2GBIQay_normal.jpg" alt="feedback_2"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ would be cool if it was easier to edit text after image is generated ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg></div><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1194368464946974728/1D2biimN_normal.jpg" alt="feedback_3"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Awesome product, very easy to use and understand. I miss a native app and the documentation could be improved. Otherwise I love it. ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocIWiGTd3nWE5etp-CFhxrTKFvSLSJJd7pPmiM9SNJ9sAg=s96-c" alt="feedback_4"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Open panel since the private beta and i'm super impressed by the product already, the speed after you give feedback to actually get the features is truly amazing! Can't wait to see where Openpanel are in 6 months! ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocKymAw_YoIrfoGp-bWMlDsXgM6St0dzaVJ7m_lGNXDtrA=s96-c" alt="feedback_5"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Impressively fast UI and easy to integrate! Added it alongside my current analytics tool for my native app in less than an hour. ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1735771119980879872/Mx5MlB9e_normal.jpg" alt="feedback_6"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Im using plausible and find it pleasing but limited.
// Im looking forward to trying out Openpanel, the demo pictures and the page look professional. The listed features seem to be broader then plausible. :) ”</span></div><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"></div><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1767459527006334976/unbMENPG_normal.jpg" alt="feedback_7"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Incredibly easy to implement and a joy to use. 5/5 would recommend. ”</span></div></div>
// <div class="flex flex-col gap-y-2 mt-5 lg:mt-3"><p class="text-gray-700 dark:text-gray-100 text-sm w-24 text-start font-semibold whitespace-nowrap">What users think</p><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1744063824431370240/BbVtyCiy_normal.png" alt="feedback_0"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Been a long time Mixpanel user and without a doubt there's a bunch of room to innovate. I'm confident Openpanel is on the right path! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg/><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1751607056316944384/8E4F88FL_normal.jpg" alt="feedback_1"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Openpanel for the last 6 months (since Im the creator) for 3 different sites/apps. Its a great analytics product that has everything you need. Still lacking a native app but will work hard to make that a reality! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1701887174042324992/g2GBIQay_normal.jpg" alt="feedback_2"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ would be cool if it was easier to edit text after image is generated ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-flame w-5 h-5 text-red-600 fill-orange-400 animate-pulse"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg/><img class="w-5 h-5 rounded-full border border-2 border-red-500" src="https://pbs.twimg.com/profile_images/1194368464946974728/1D2biimN_normal.jpg" alt="feedback_3"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Awesome product, very easy to use and understand. I miss a native app and the documentation could be improved. Otherwise I love it. ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocIWiGTd3nWE5etp-CFhxrTKFvSLSJJd7pPmiM9SNJ9sAg=s96-c" alt="feedback_4"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ I have used Open panel since the private beta and i'm super impressed by the product already, the speed after you give feedback to actually get the features is truly amazing! Can't wait to see where Openpanel are in 6 months! ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://lh3.googleusercontent.com/a/ACg8ocKymAw_YoIrfoGp-bWMlDsXgM6St0dzaVJ7m_lGNXDtrA=s96-c" alt="feedback_5"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Impressively fast UI and easy to integrate! Added it alongside my current analytics tool for my native app in less than an hour. ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1735771119980879872/Mx5MlB9e_normal.jpg" alt="feedback_6"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Im using plausible and find it pleasing but limited.
// Im looking forward to trying out Openpanel, the demo pictures and the page look professional. The listed features seem to be broader then plausible. :) ”</span/><div class="flex flex-row w-full gap-x-2 items-start"><div class="w-5 shrink-0"/><img class="w-5 h-5 rounded-full " src="https://pbs.twimg.com/profile_images/1767459527006334976/unbMENPG_normal.jpg" alt="feedback_7"><span class="flex-wrap text-sm text-gray-600 dark:text-gray-200 text-start font-normal">“ Incredibly easy to implement and a joy to use. 5/5 would recommend. ”</span/></div>