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
303 changes: 174 additions & 129 deletions bun.lock

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@hookform/resolvers": "^5.2.2",
"@marsidev/react-turnstile": "1.4.0",
"@hookform/resolvers": "^5.4.0",
"@marsidev/react-turnstile": "1.5.2",
"@radix-ui/react-avatar": "^1.1.11",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-collapsible": "^1.1.12",
Expand All @@ -15,47 +15,48 @@
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tooltip": "^1.2.8",
"@tabler/icons-react": "3.36.0",
"@tabler/icons-react": "3.44.0",
"@tanstack/react-table": "^8.21.3",
"@xterm/addon-fit": "0.10.0",
"@xterm/addon-search": "0.15.0",
"@xterm/addon-web-links": "0.11.0",
"@xterm/addon-webgl": "0.18.0",
"@xterm/xterm": "^6.0.0",
"@xterm/addon-fit": "0.11.0",
"@xterm/addon-search": "0.16.0",
"@xterm/addon-web-links": "0.12.0",
"@xterm/addon-webgl": "0.19.0",
"ansi-styles": "6.2.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"iron-session": "8.0.4",
"lucide-react": "^0.562.0",
"next": "16.1.0",
"lucide-react": "^1.17.0",
"next": "16.2.6",
"next-themes": "^0.4.6",
"pretty-bytes": "7.1.0",
"pretty-ms": "9.3.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-hook-form": "7.69.0",
"recharts": "^3.6.0",
"react": "19.2.6",
"react-dom": "19.2.6",
"react-hook-form": "7.76.1",
"recharts": "^3.8.1",
"sonner": "^2.0.7",
"strip-ansi": "7.1.2",
"tailwind-merge": "^3.4.0",
"strip-ansi": "7.2.0",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "3.2.2",
"use-debounce": "10.0.6",
"zod": "^4.2.1"
"use-debounce": "10.1.1",
"zod": "^4.4.3"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.0.3",
"@types/react": "19.2.7",
"@tailwindcss/postcss": "^4.3.0",
"@types/node": "^25.9.1",
"@types/react": "19.2.15",
"@types/react-dom": "19.2.3",
"eslint": "^9.39.2",
"eslint-config-next": "16.1.0",
"eslint": "^9.39.4",
"eslint-config-next": "16.2.6",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-perfectionist": "^5.0.0",
"eslint-plugin-prettier": "^5.5.4",
"prettier": "^3.7.4",
"tailwindcss": "^4.1.18",
"eslint-plugin-perfectionist": "^5.9.0",
"eslint-plugin-prettier": "^5.5.6",
"prettier": "^3.8.3",
"tailwindcss": "^4.3.0",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3"
"typescript": "^6.0.3"
},
"name": "cachyos-builder-dashboard",
"packageManager": "bun@1.3.4",
Expand Down
2 changes: 0 additions & 2 deletions src/app/actions/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ export async function getAccessibleServers() {
export async function getLoggedInUser(
fullProfile: false
): Promise<UserData | {error: string}>;

export async function getLoggedInUser(
fullProfile: true
): Promise<UserProfile | {error: string}>;

export async function getLoggedInUser(fullProfile = false) {
const {cachyBuilderClient, session} = await getSession();
if (!session.isLoggedIn) {
Expand Down
3 changes: 0 additions & 3 deletions src/app/actions/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ import {
export async function getPackageStats(
type: PackageStatsType.CATEGORY
): Promise<PackageStatsList | {error: string}>;

export async function getPackageStats(
type: PackageStatsType.MONTH
): Promise<ProcessedPackageStatsByMonthList | {error: string}>;

export async function getPackageStats(
type: PackageStatsType.BUILD_TIME
): Promise<BuildTimeStatsDataList | {error: string}>;

export async function getPackageStats(
type: PackageStatsType = PackageStatsType.CATEGORY
): Promise<
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import {useCallback, useEffect, useMemo, useState} from 'react';
import {useCallback, useEffect, useState} from 'react';
import {toast} from 'sonner';

import {getLoggedInUser} from '@/app/actions/session';
Expand Down
9 changes: 6 additions & 3 deletions src/components/charts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import {
XAxis,
YAxis,
} from 'recharts';
import {ValueType} from 'recharts/types/component/DefaultTooltipContent';
import {
NameType,
ValueType,
} from 'recharts/types/component/DefaultTooltipContent';

import {
ChartConfig,
Expand Down Expand Up @@ -293,14 +296,14 @@ export function MonthlyStatsAreaChart({
);
}

function buildStatsMemoryContentFormatter(value: ValueType, name: string) {
function buildStatsMemoryContentFormatter(value: ValueType, name: NameType) {
if (name === 'average_max_rss' && typeof value === 'number') {
return prettyBytes(value * 1024);
}
return value.toLocaleString();
}

function buildStatsTimeContentFormatter(value: ValueType, name?: string) {
function buildStatsTimeContentFormatter(value: ValueType, name?: NameType) {
if (
(!name || name === 'average_user_time' || name === 'average_build_time') &&
typeof value === 'number'
Expand Down
18 changes: 9 additions & 9 deletions src/components/ui/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export type ChartConfig = {
[k in string]: ChartConfigValue;
};

export type ChartConfigValue = {
icon?: React.ComponentType;
label?: React.ReactNode;
} & (
export type ChartConfigValue = (
| {color?: never; theme: Record<keyof typeof THEMES, string>}
| {color?: string; theme?: never}
);
) & {
icon?: React.ComponentType;
label?: React.ReactNode;
};

export type ChartLegendContentProps = {
className?: string;
Expand All @@ -41,9 +41,9 @@ export type CustomTooltipProps = TooltipContentProps<ValueType, NameType> & {
className?: string;
color?: string;
contentFormatter?: (
value: number | string,
name: string,
item: Payload<number | string, string>,
value: RechartsPrimitive.TooltipValueType,
name: NameType,
item: RechartsPrimitive.TooltipPayloadEntry,
index: number,
payload: ReadonlyArray<Payload<number | string, string>>
) => number | string;
Expand Down Expand Up @@ -236,7 +236,7 @@ function ChartTooltipContent({
'[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
indicator === 'dot' && 'items-center'
)}
key={item.dataKey}
key={key}
>
{formatter && item?.value !== undefined && item.name ? (
formatter(item.value, item.name, item, index, item.payload)
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function DataTable<TData, TValue>({
setRowSelection({});
}, [resetSelection]);
const primarySearchFilterInputRef = React.useRef<HTMLInputElement>(null);
// eslint-disable-next-line react-hooks/incompatible-library
const table = useReactTable({
columns,
data,
Expand Down
24 changes: 9 additions & 15 deletions src/hooks/use-keyboard-shortcut-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import {useEffect, useState} from 'react';

const numericKeyRegex = /^\d$/;

const clearTimer = (timer: NodeJS.Timeout | null) => {
if (timer) {
clearTimeout(timer);
}
};

export function useGenericShortcutListener(
key: string,
callback: () => void,
Expand Down Expand Up @@ -39,9 +33,9 @@ export function useGenericVimShortcutListener(
callback: () => void
) {
const [colonAndKeyPressed, setColonAndKeyPressed] = useState(false);
let timer: NodeJS.Timeout | null = null;

useEffect(() => {
let timer: NodeJS.Timeout | undefined;
let colonPressed = false;
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === ':') {
Expand All @@ -55,20 +49,20 @@ export function useGenericVimShortcutListener(
) {
setColonAndKeyPressed(true);
colonPressed = false;
clearTimer(timer);
clearTimeout(timer);
} else {
colonPressed = false;
clearTimer(timer);
clearTimeout(timer);
Comment on lines +52 to +55
}
};

globalThis.addEventListener('keydown', handleKeyDown);

return () => {
globalThis.removeEventListener('keydown', handleKeyDown);
clearTimer(timer);
clearTimeout(timer);
};
}, []);
}, [key]);

useEffect(() => {
if (colonAndKeyPressed) {
Expand Down Expand Up @@ -102,9 +96,9 @@ export function useNumericKeyVimShortcutListener(
const [colonAndKeyPressed, setColonAndKeyPressed] = useState<null | number>(
null
);
let timer: NodeJS.Timeout | null = null;

useEffect(() => {
let timer: NodeJS.Timeout | undefined;
let colonPressed = false;
const handleKeyDown = (event: KeyboardEvent) => {
const key = event.key.toLowerCase();
Expand All @@ -116,18 +110,18 @@ export function useNumericKeyVimShortcutListener(
} else if (colonPressed && numericKeyRegex.test(key)) {
setColonAndKeyPressed(Number.parseInt(key, 10));
colonPressed = false;
clearTimer(timer);
clearTimeout(timer);
} else {
colonPressed = false;
clearTimer(timer);
clearTimeout(timer);
}
};

globalThis.addEventListener('keydown', handleKeyDown);

return () => {
globalThis.removeEventListener('keydown', handleKeyDown);
clearTimer(timer);
clearTimeout(timer);
};
}, []);

Expand Down