Skip to content

Commit 440de7b

Browse files
committed
merge
2 parents 9f47cef + 58eac13 commit 440de7b

File tree

102 files changed

+1158
-4998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1158
-4998
lines changed

.github/workflows/lint.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Linting Check for Pull Requests
2+
#
3+
# This workflow runs code quality checks on all pull requests to ensure
4+
# consistent code style and catch potential issues before they're merged.
5+
# It uses Biome for linting with the configuration from biome.jsonc.
6+
#
7+
name: Lint
8+
9+
on:
10+
pull_request:
11+
branches: [ "main" ]
12+
push:
13+
branches: [ "main" ]
14+
merge_group:
15+
branches: [ "main" ]
16+
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
21+
jobs:
22+
lint:
23+
name: Lint Code
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Bun
30+
uses: oven-sh/setup-bun@v1
31+
with:
32+
bun-version: 1.2.19
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.bun/install/cache
38+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-bun-
41+
42+
- name: Install dependencies
43+
run: bun install
44+
45+
- name: Run lint check
46+
run: bun run lint

apps/api/src/agent/core/response-processor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import type { StreamingUpdate } from '@databuddy/shared';
12
import type { z } from 'zod';
23
import { handleChartResponse } from '../handlers/chart-handler';
34
import { handleMetricResponse } from '../handlers/metric-handler';
45
import type { AIResponseJsonSchema } from '../prompts/agent';
5-
import type { StreamingUpdate } from '@databuddy/shared';
66
import { generateThinkingSteps } from '../utils/stream-utils';
77
import type { AssistantSession } from './assistant-session';
88

apps/api/src/lib/export/formatters.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import type { ExportFormat } from './types';
55
export function convertToCSV<T extends Record<string, unknown>>(
66
data: T[]
77
): string {
8-
if (data.length === 0) return '';
8+
if (data.length === 0) {
9+
return '';
10+
}
911

1012
const headers = Object.keys(data[0] || {}).join(',');
1113
const rows = data
@@ -36,7 +38,9 @@ export function convertToCSV<T extends Record<string, unknown>>(
3638
export function convertToTXT<T extends Record<string, unknown>>(
3739
data: T[]
3840
): string {
39-
if (data.length === 0) return '';
41+
if (data.length === 0) {
42+
return '';
43+
}
4044

4145
const headers = Object.keys(data[0] || {}).join('\t');
4246
const rows = data
@@ -60,7 +64,9 @@ export function convertToProto<T extends Record<string, unknown>>(
6064
data: T[],
6165
typeName: string
6266
): string {
63-
if (data.length === 0) return '';
67+
if (data.length === 0) {
68+
return '';
69+
}
6470

6571
let protoContent = `# Protocol Buffer Text Format\n# Type: ${typeName}\n\n`;
6672

@@ -110,7 +116,6 @@ export function formatData<T extends Record<string, unknown>>(
110116
return convertToTXT(data);
111117
case 'proto':
112118
return convertToProto(data, typeName);
113-
case 'json':
114119
default:
115120
return JSON.stringify(data, null, 2);
116121
}
@@ -124,7 +129,6 @@ export function getFileExtension(format: ExportFormat): string {
124129
return 'txt';
125130
case 'proto':
126131
return 'proto.txt';
127-
case 'json':
128132
default:
129133
return 'json';
130134
}

apps/api/src/routes/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createRateLimitMiddleware } from '../middleware/rate-limit';
1111

1212
dayjs.extend(utc);
1313

14-
const exportRateLimit = createRateLimitMiddleware({
14+
const _exportRateLimit = createRateLimitMiddleware({
1515
type: 'expensive',
1616
identifier: 'export',
1717
customConfig: {

apps/basket/src/routes/basket.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ async function insertWebVitals(
314314
async function insertCustomEvent(
315315
customData: any,
316316
clientId: string,
317-
userAgent: string,
318-
ip: string
317+
_userAgent: string,
318+
_ip: string
319319
): Promise<void> {
320320
let eventId = sanitizeString(
321321
customData.eventId,
@@ -369,8 +369,8 @@ async function insertCustomEvent(
369369
async function insertOutgoingLink(
370370
linkData: any,
371371
clientId: string,
372-
userAgent: string,
373-
ip: string
372+
_userAgent: string,
373+
_ip: string
374374
): Promise<void> {
375375
let eventId = sanitizeString(
376376
linkData.eventId,

apps/dashboard/app/(auth)/login/page.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
'use client';
22

33
import { signIn } from '@databuddy/auth/client';
4-
import { EyeIcon, EyeSlashIcon, GithubLogoIcon, SpinnerIcon, SparkleIcon, GoogleLogoIcon } from '@phosphor-icons/react';
4+
import {
5+
EyeIcon,
6+
EyeSlashIcon,
7+
GithubLogoIcon,
8+
GoogleLogoIcon,
9+
SparkleIcon,
10+
SpinnerIcon,
11+
} from '@phosphor-icons/react';
512
import Link from 'next/link';
613
import { useRouter } from 'next/navigation';
714
import { Suspense, useEffect, useState } from 'react';
@@ -100,7 +107,7 @@ function LoginPage() {
100107

101108
return (
102109
<>
103-
<div className="mb-8 text-center -mt-8">
110+
<div className="-mt-8 mb-8 text-center">
104111
<h1 className="font-bold text-2xl text-foreground">Welcome back</h1>
105112
<p className="mt-2 text-muted-foreground">
106113
Sign in to your account to continue your journey with Databuddy
@@ -111,7 +118,7 @@ function LoginPage() {
111118
<div className="-bottom-40 -left-40 pointer-events-none absolute h-80 w-80 rounded-full blur-3xl" />
112119
<div className="relative z-10">
113120
<div className="space-y-6">
114-
<div className="grid grid-cols-1 gap-3 lg:grid-cols-2 -mt-2">
121+
<div className="-mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2">
115122
<Button
116123
className="relative flex h-11 w-full cursor-pointer items-center justify-center transition-all duration-200 hover:bg-primary/5"
117124
disabled={isLoading}
@@ -122,7 +129,7 @@ function LoginPage() {
122129
<GithubLogoIcon className="mr-2 h-5 w-5" />
123130
<span>Sign in with GitHub</span>
124131
{lastUsed === 'github' && (
125-
<span className="absolute -top-4 -right-0.5 inline-flex items-center rounded-full border border-primary/20 bg-primary/10 px-1.5 py-0.5 font-medium text-primary text-xs">
132+
<span className="-top-4 -right-0.5 absolute inline-flex items-center rounded-full border border-primary/20 bg-primary/10 px-1.5 py-0.5 font-medium text-primary text-xs">
126133
Last used
127134
</span>
128135
)}
@@ -137,7 +144,7 @@ function LoginPage() {
137144
<GoogleLogoIcon className="mr-2 h-5 w-5" />
138145
<span>Sign in with Google</span>
139146
{lastUsed === 'google' && (
140-
<span className="absolute -top-4 -right-0.5 inline-flex items-center rounded-full border border-primary/20 bg-primary/10 px-1.5 py-0.5 font-medium text-primary text-xs">
147+
<span className="-top-4 -right-0.5 absolute inline-flex items-center rounded-full border border-primary/20 bg-primary/10 px-1.5 py-0.5 font-medium text-primary text-xs">
141148
Last used
142149
</span>
143150
)}
@@ -161,7 +168,7 @@ function LoginPage() {
161168
<div className="relative">
162169
<Input
163170
autoComplete="email"
164-
className="h-11 border-none text-foreground bg-input transition-all duration-200 focus:ring-2 focus:ring-primary/20 placeholder:text-muted-foreground/50"
171+
className="h-11 border-none bg-input text-foreground transition-all duration-200 placeholder:text-muted-foreground/50 focus:ring-2 focus:ring-primary/20"
165172
id="email"
166173
name="email"
167174
onChange={(e) => setEmail(e.target.value)}
@@ -197,7 +204,7 @@ function LoginPage() {
197204
<div className="relative">
198205
<Input
199206
autoComplete="current-password"
200-
className="h-11 pr-10 bg-input border-none transition-all duration-200 focus:ring-2 focus:ring-primary/20 placeholder:text-muted-foreground/50"
207+
className="h-11 border-none bg-input pr-10 transition-all duration-200 placeholder:text-muted-foreground/50 focus:ring-2 focus:ring-primary/20"
201208
id="password"
202209
name="password"
203210
onChange={(e) => setPassword(e.target.value)}
@@ -207,7 +214,9 @@ function LoginPage() {
207214
value={password}
208215
/>
209216
<Button
210-
aria-label={showPassword ? 'Hide password' : 'Show password'}
217+
aria-label={
218+
showPassword ? 'Hide password' : 'Show password'
219+
}
211220
className="absolute top-0 right-0 h-full px-3 text-muted-foreground hover:text-foreground"
212221
onClick={() => setShowPassword(!showPassword)}
213222
size="sm"

apps/dashboard/app/(main)/observability/layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export default function ObservabilityLayout({
44
children: React.ReactNode;
55
}) {
66
return (
7-
<div className="mx-auto max-w-[1600px] space-y-6 p-4 sm:p-6 lg:p-8">{children}</div>
7+
<div className="mx-auto max-w-[1600px] space-y-6 p-4 sm:p-6 lg:p-8">
8+
{children}
9+
</div>
810
);
9-
}
11+
}

apps/dashboard/app/(main)/revenue/_components/onboarding/steps/overview-step.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export function OverviewStep({ onNext }: OverviewStepProps) {
1111
return (
1212
<div className="space-y-4">
1313
<div className="rounded-lg border border-blue-200 bg-blue-50 p-4 dark:border-blue-800 dark:bg-blue-950/20">
14-
<h3 className="mb-2 font-medium text-foreground">
15-
What you'll get:
16-
</h3>
14+
<h3 className="mb-2 font-medium text-foreground">What you'll get:</h3>
1715
<ul className="space-y-2 text-muted-foreground text-sm">
1816
<li className="flex items-center gap-2">
1917
<CheckCircleIcon

apps/dashboard/app/(main)/settings/_components/sessions-form.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function SessionsForm() {
3737

3838
useEffect(() => {
3939
fetchSessions();
40-
}, []);
40+
}, [fetchSessions]);
4141

4242
const fetchSessions = async () => {
4343
setIsLoading(true);
@@ -110,8 +110,9 @@ export function SessionsForm() {
110110
};
111111

112112
const getDeviceIcon = (userAgent?: string | null) => {
113-
if (!userAgent)
113+
if (!userAgent) {
114114
return <GlobeIcon className="h-4 w-4" size={16} weight="duotone" />;
115+
}
115116

116117
const ua = userAgent.toLowerCase();
117118
if (
@@ -126,7 +127,9 @@ export function SessionsForm() {
126127
};
127128

128129
const formatUserAgent = (userAgent?: string | null) => {
129-
if (!userAgent) return 'Unknown Device';
130+
if (!userAgent) {
131+
return 'Unknown Device';
132+
}
130133

131134
// Extract browser and OS information
132135
let browser = 'Unknown Browser';

apps/dashboard/app/(main)/websites/[id]/_components/tabs/audience-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function WebsiteAudienceTab({
192192
}, [isRefreshing, handleRefresh]);
193193

194194
const onAddFilter = useCallback(
195-
(field: string, value: string, tableTitle?: string) => {
195+
(field: string, value: string, _tableTitle?: string) => {
196196
// The field parameter now contains the correct filter field from the tab configuration
197197
const filter = {
198198
field,

0 commit comments

Comments
 (0)