mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-20 09:16:13 +01:00
refactor: clean up client workflow and update package dependencies
This commit is contained in:
parent
a65e33758d
commit
f1204531a8
9 changed files with 141 additions and 117 deletions
|
|
@ -22,11 +22,6 @@
|
|||
"dev": "rollup -c -w --bundleConfigAsCjs"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.2.0 || ^19.0.0",
|
||||
"react-dom": "^18.2.0 || ^19.0.0",
|
||||
"@tanstack/react-query": "^4.28.0 || ^5.69.0",
|
||||
"jotai": "^2.12.5",
|
||||
"react-hook-form": "^7.56.4 || ^7.60.0",
|
||||
"@ariakit/react": "^0.4.15 || ^0.4.16",
|
||||
"@ariakit/react-core": "^0.4.17",
|
||||
"@headlessui/react": "^2.1.2",
|
||||
|
|
@ -50,11 +45,16 @@
|
|||
"@radix-ui/react-toast": "^1.1.5",
|
||||
"@radix-ui/react-tooltip": "^1.2.7",
|
||||
"@react-spring/web": "^9.7.5",
|
||||
"@tanstack/react-query": "^4.28.0 || ^5.69.0",
|
||||
"@tanstack/react-table": "^8.11.7",
|
||||
"@tanstack/react-virtual": "^3.0.0",
|
||||
"framer-motion": "^11.5.4",
|
||||
"i18next": "^24.2.2 || ^24.2.3",
|
||||
"i18next-browser-languagedetector": "^8.0.3 || ^8.0.4",
|
||||
"jotai": "^2.12.5",
|
||||
"react": "^18.2.0 || ^19.0.0",
|
||||
"react-dom": "^18.2.0 || ^19.0.0",
|
||||
"react-hook-form": "^7.56.4 || ^7.60.0",
|
||||
"react-i18next": "^15.4.0 || ^15.4.1",
|
||||
"react-resizable-panels": "^3.0.2",
|
||||
"react-textarea-autosize": "^8.4.0"
|
||||
|
|
@ -92,25 +92,32 @@
|
|||
"@radix-ui/react-toast": "^1.1.5",
|
||||
"@radix-ui/react-tooltip": "^1.2.7",
|
||||
"@react-spring/web": "^9.7.5",
|
||||
"@tanstack/react-table": "^8.11.7",
|
||||
"@tanstack/react-virtual": "^3.0.0",
|
||||
"framer-motion": "^11.5.4",
|
||||
"i18next": "^24.2.3",
|
||||
"i18next-browser-languagedetector": "^8.0.4",
|
||||
"react-i18next": "^15.4.1",
|
||||
"react-resizable-panels": "^3.0.2",
|
||||
"react-textarea-autosize": "^8.4.0",
|
||||
"@rollup/plugin-alias": "^5.1.0",
|
||||
"@rollup/plugin-commonjs": "^25.0.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.0",
|
||||
"@rollup/plugin-replace": "^5.0.5",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@tanstack/react-query": "^5.69.0",
|
||||
"@tanstack/react-table": "^8.11.7",
|
||||
"@tanstack/react-virtual": "^3.0.0",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@types/react": "^19.0.12",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"framer-motion": "^11.5.4",
|
||||
"i18next": "^24.2.3",
|
||||
"i18next-browser-languagedetector": "^8.0.4",
|
||||
"jotai": "^2.12.5",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-import": "^15.1.0",
|
||||
"postcss-preset-env": "^8.5.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-hook-form": "^7.56.4",
|
||||
"react-i18next": "^15.4.1",
|
||||
"react-resizable-panels": "^3.0.2",
|
||||
"react-textarea-autosize": "^8.4.0",
|
||||
"rimraf": "^5.0.1",
|
||||
"rollup": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||
|
|
@ -118,11 +125,7 @@
|
|||
"rollup-plugin-typescript2": "^0.35.0",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tailwindcss-animate": "^1.0.5",
|
||||
"typescript": "^5.0.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"@tanstack/react-query": "^5.69.0",
|
||||
"jotai": "^2.12.5",
|
||||
"react-hook-form": "^7.56.4"
|
||||
"tailwindcss-radix": "^2.8.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,23 +30,20 @@ const plugins = [
|
|||
}),
|
||||
commonjs(),
|
||||
postcss({
|
||||
// Extract CSS to a separate file
|
||||
extract: false,
|
||||
// Inject CSS into JS (better for component libraries)
|
||||
inject: true,
|
||||
// Minimize CSS in production
|
||||
minimize: process.env.NODE_ENV === 'production',
|
||||
// Enable CSS modules if needed
|
||||
modules: false,
|
||||
}),
|
||||
typescript({
|
||||
tsconfig: './tsconfig.json',
|
||||
useTsconfigDeclarationDir: true,
|
||||
clean: true,
|
||||
check: false,
|
||||
}),
|
||||
terser({
|
||||
compress: {
|
||||
directives: false, // Preserve directives like 'use client'
|
||||
directives: false,
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import * as Ariakit from '@ariakit/react';
|
||||
import { ReactNode, forwardRef, useEffect, useRef } from 'react';
|
||||
import { forwardRef, useEffect, useRef } from 'react';
|
||||
import type { ElementRef } from 'react';
|
||||
import { cn } from '~/utils';
|
||||
import './AnimatedTabs.css';
|
||||
|
||||
export interface TabItem {
|
||||
id?: string;
|
||||
label: ReactNode;
|
||||
content: ReactNode;
|
||||
label: React.ReactNode;
|
||||
content: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ export interface AnimatedTabsProps {
|
|||
}
|
||||
|
||||
function usePrevious<T>(value: T) {
|
||||
const ref = useRef<T>();
|
||||
const ref = useRef<T | undefined>(undefined);
|
||||
useEffect(() => {
|
||||
ref.current = value;
|
||||
}, [value]);
|
||||
|
|
@ -132,7 +132,8 @@ export function AnimatedTabs({
|
|||
className={tabClassName}
|
||||
data-state={tabIds[index] === firstTabId ? 'active' : 'inactive'}
|
||||
>
|
||||
{tab.label}
|
||||
{/* TypeScript workaround for React i18next children type compatibility */}
|
||||
{tab.label as any}
|
||||
</Tab>
|
||||
))}
|
||||
</Ariakit.TabList>
|
||||
|
|
@ -150,7 +151,8 @@ export function AnimatedTabs({
|
|||
tabId={tabIds[index]}
|
||||
className={tabPanelClassName}
|
||||
>
|
||||
{tab.content}
|
||||
{/* TypeScript workaround for React i18next children type compatibility */}
|
||||
{tab.content as any}
|
||||
</TabPanel>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ import { cn } from '~/utils';
|
|||
|
||||
const Label = React.forwardRef<
|
||||
React.ElementRef<typeof LabelPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
||||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {
|
||||
className?: string;
|
||||
}
|
||||
>(({ className = '', ...props }, ref) => (
|
||||
<LabelPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn(
|
||||
{...(props as any)}
|
||||
{...({ className: cn(
|
||||
'block w-full break-all text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-200',
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
) } as any)}
|
||||
/>
|
||||
));
|
||||
Label.displayName = LabelPrimitive.Root.displayName;
|
||||
|
|
|
|||
|
|
@ -5,18 +5,22 @@ import { cn } from '~/utils';
|
|||
|
||||
const Separator = React.forwardRef<
|
||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
||||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> & {
|
||||
className?: string;
|
||||
}
|
||||
>(({ className = '', orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
||||
<SeparatorPrimitive.Root
|
||||
ref={ref}
|
||||
decorative={decorative}
|
||||
orientation={orientation}
|
||||
className={cn(
|
||||
'shrink-0 bg-border-light',
|
||||
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
{...(props as any)}
|
||||
{...({
|
||||
decorative,
|
||||
orientation,
|
||||
className: cn(
|
||||
'shrink-0 bg-border-light',
|
||||
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
||||
className,
|
||||
),
|
||||
} as any)}
|
||||
/>
|
||||
));
|
||||
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
||||
|
|
|
|||
|
|
@ -4,21 +4,26 @@ import { cn } from '~/utils';
|
|||
|
||||
const Slider = React.forwardRef<
|
||||
React.ElementRef<typeof SliderPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & { onDoubleClick?: () => void }
|
||||
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {
|
||||
className?: string;
|
||||
onDoubleClick?: () => void;
|
||||
}
|
||||
>(({ className, onDoubleClick, ...props }, ref) => (
|
||||
<SliderPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'relative flex w-full cursor-pointer touch-none select-none items-center',
|
||||
className,
|
||||
)}
|
||||
onDoubleClick={onDoubleClick}
|
||||
{...props}
|
||||
{...(props as any)}
|
||||
{...({
|
||||
className: cn(
|
||||
'relative flex w-full cursor-pointer touch-none select-none items-center',
|
||||
className,
|
||||
),
|
||||
onDoubleClick,
|
||||
} as any)}
|
||||
>
|
||||
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
|
||||
<SliderPrimitive.Range className="absolute h-full bg-primary" />
|
||||
<SliderPrimitive.Track {...({ className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary" } as any)}>
|
||||
<SliderPrimitive.Range {...({ className: "absolute h-full bg-primary" } as any)} />
|
||||
</SliderPrimitive.Track>
|
||||
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
|
||||
<SliderPrimitive.Thumb {...({ className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" } as any)} />
|
||||
</SliderPrimitive.Root>
|
||||
));
|
||||
Slider.displayName = SliderPrimitive.Root.displayName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue